public class GfycatPickerFragment extends Fragment implements CategoriesFragmentController
Subscribe for onGfycatSelected event to get a Gfycat object user has selected.
Set accentTint parameter to customize the accent color of a Picker for your app needs.
NOTE: com.gfycat.core.GfyCore needs to be initialized before this Fragment is used.
See http://developers.gfycat.com/androidsdk/#gfycat-picker-fragment for more integration details.
| Modifier and Type | Class and Description |
|---|---|
static interface |
GfycatPickerFragment.OnGfycatSelectedListener |
| Modifier and Type | Field and Description |
|---|---|
static float |
DEFAULT_CATEGORY_ASPECT_RATIO |
static int |
DEFAULT_ORIENTATION |
| Constructor and Description |
|---|
GfycatPickerFragment() |
| Modifier and Type | Method and Description |
|---|---|
void |
addOnGfycatSelectedListener(GfycatPickerFragment.OnGfycatSelectedListener onGfycatSelectedListener)
Subscribe on Gfycat selected event.
|
void |
closeCategory()
Close category and move to categories list.
|
int |
getAccentTintColor() |
int |
getCategoriesColumnCount() |
float |
getCategoryAspectRatio() |
float |
getCategoryCornerRadius()
Returns category corner radius.
|
int |
getContentBottomPadding() |
int |
getContentLeftPadding() |
int |
getContentTopPadding() |
float |
getGfycatCornerRadius()
Returns gfycat corner radius.
|
int |
getGfycatsColumnCount() |
int |
getOrientation()
Returns orientation as
android.support.v7.widget.OrientationHelper#HORIZONTAL
or android.support.v7.widget.OrientationHelper#VERTICAL |
protected RecyclerView |
getRecyclerView() |
java.lang.String |
getSearchFilter() |
int |
getSearchViewTopPadding() |
boolean |
onBackPressed() |
void |
onCategoryClick(GfycatCategory category) |
void |
onCreateAdditionalViews(android.view.LayoutInflater inflater,
android.view.ViewGroup fragmentRootView,
android.os.Bundle savedInstanceState)
Provide possibility to add some views on top of categories fragments.
|
SearchController |
onCreateSearchView(android.view.ViewGroup container)
Called to have the fragment instantiate its Search View.
|
android.view.View |
onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState) |
void |
onGfycatClick(FeedIdentifier identifier,
Gfycat gfycat,
int position) |
void |
onGfycatSelected(FeedIdentifier identifier,
Gfycat gfycat,
int position)
Called when user clicked on gfycat in identifier.getName() category.
|
void |
onInflate(android.content.Context context,
android.util.AttributeSet attrs,
android.os.Bundle savedInstanceState) |
void |
onPhotoMomentsCategoryClick() |
void |
onSaveInstanceState(android.os.Bundle outState) |
void |
removeOnGfycatSelectedListener(GfycatPickerFragment.OnGfycatSelectedListener onGfycatSelectedListener)
Unsubscribe from Gfycat selected event.
|
void |
restoreInstanceState(android.os.Bundle inState) |
void |
saveInstanceState(android.os.Bundle outState) |
void |
setAccentTintColor(int color)
Style picker's tint color.
|
void |
setCloseOnGfycatClick(boolean shouldClose)
Will close current category and move back to categories list once Gfycat will be clicked
|
void |
setPlaybackEnabled(boolean enabled) |
void |
setRecentCategoryEnabled(boolean recentCategoryEnabled)
Enables Recent category that will be populated with Gfycats that have been tapped by user.
|
void |
setSearchFilter(java.lang.String searchFilter) |
protected void |
setupScrollListener(RecyclerView.OnScrollListener scrollListener) |
public static final float DEFAULT_CATEGORY_ASPECT_RATIO
public static final int DEFAULT_ORIENTATION
public void setPlaybackEnabled(boolean enabled)
enabled - false if webp should not play, true otherwise.public void setSearchFilter(java.lang.String searchFilter)
searchFilter - from outside of GfycatPickerFragment.public java.lang.String getSearchFilter()
public void onCreateAdditionalViews(android.view.LayoutInflater inflater,
android.view.ViewGroup fragmentRootView,
android.os.Bundle savedInstanceState)
public void addOnGfycatSelectedListener(GfycatPickerFragment.OnGfycatSelectedListener onGfycatSelectedListener)
onGfycatSelectedListener - public void removeOnGfycatSelectedListener(GfycatPickerFragment.OnGfycatSelectedListener onGfycatSelectedListener)
onGfycatSelectedListener - public void onGfycatSelected(FeedIdentifier identifier,
Gfycat gfycat,
int position)
public int getGfycatsColumnCount()
getGfycatsColumnCount in interface CategoriesFragmentControllerpublic int getSearchViewTopPadding()
public int getContentBottomPadding()
getContentBottomPadding in interface CategoriesFragmentControllerpublic int getContentLeftPadding()
getContentLeftPadding in interface CategoriesFragmentControllerpublic int getContentTopPadding()
getContentTopPadding in interface CategoriesFragmentControllerpublic SearchController onCreateSearchView(android.view.ViewGroup container)
This will be called in onCreateView(LayoutInflater, ViewGroup, Bundle).
container - Search View should be added to this ViewGroup object.public final void setAccentTintColor(int color)
color - - tint color.public int getAccentTintColor()
public void setRecentCategoryEnabled(boolean recentCategoryEnabled)
recentCategoryEnabled - public void setCloseOnGfycatClick(boolean shouldClose)
shouldClose - public final void closeCategory()
public int getOrientation()
CategoriesFragmentControllerandroid.support.v7.widget.OrientationHelper#HORIZONTAL
or android.support.v7.widget.OrientationHelper#VERTICALgetOrientation in interface CategoriesFragmentControllerpublic float getCategoryAspectRatio()
getCategoryAspectRatio in interface CategoriesFragmentControllerpublic float getCategoryCornerRadius()
CategoriesFragmentControllergetCategoryCornerRadius in interface CategoriesFragmentControllerpublic float getGfycatCornerRadius()
CategoriesFragmentControllergetGfycatCornerRadius in interface CategoriesFragmentControllerpublic int getCategoriesColumnCount()
getCategoriesColumnCount in interface CategoriesFragmentControllerpublic final boolean onBackPressed()
public void onInflate(android.content.Context context,
android.util.AttributeSet attrs,
android.os.Bundle savedInstanceState)
public android.view.View onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState)
public void onSaveInstanceState(android.os.Bundle outState)
public void saveInstanceState(android.os.Bundle outState)
public void restoreInstanceState(android.os.Bundle inState)
public final void onCategoryClick(GfycatCategory category)
onCategoryClick in interface CategoriesFragmentControllercategory - click happens.public void onPhotoMomentsCategoryClick()
onPhotoMomentsCategoryClick in interface CategoriesFragmentControllerpublic final void onGfycatClick(FeedIdentifier identifier,
Gfycat gfycat,
int position)
onGfycatClick in interface CategoriesFragmentControllergfycat - user clicked on.position - gfycat is in list.protected final void setupScrollListener(RecyclerView.OnScrollListener scrollListener)
protected final RecyclerView getRecyclerView()