public class ContentCardsFragment
extends Fragment
Modifier and Type | Class and Description |
---|---|
protected class |
ContentCardsFragment.ContentCardsUpdateRunnable
A main thread runnable to handle
ContentCardsUpdatedEvent on the main thread. |
protected class |
ContentCardsFragment.NetworkUnavailableRunnable
A main thread runnable to handle displaying network unavailable messages on the main thread.
|
Modifier and Type | Field and Description |
---|---|
protected ContentCardAdapter |
mCardAdapter |
protected SwipeRefreshLayout |
mContentCardsSwipeLayout |
protected IEventSubscriber<ContentCardsUpdatedEvent> |
mContentCardsUpdatedSubscriber |
protected IContentCardsViewBindingHandler |
mCustomContentCardsViewBindingHandler |
protected IContentCardsUpdateHandler |
mCustomContentCardUpdateHandler |
protected IContentCardsViewBindingHandler |
mDefaultContentCardsViewBindingHandler |
protected IContentCardsUpdateHandler |
mDefaultContentCardUpdateHandler |
protected EmptyContentCardsAdapter |
mDefaultEmptyContentCardsAdapter |
protected java.lang.Runnable |
mDefaultNetworkUnavailableRunnable |
protected RecyclerView |
mRecyclerView |
protected IEventSubscriber<SdkDataWipeEvent> |
mSdkDataWipeEventSubscriber |
Constructor and Description |
---|
ContentCardsFragment() |
Modifier and Type | Method and Description |
---|---|
protected void |
attachSwipeHelperCallback()
Creates and attaches a
SimpleItemTouchHelperCallback to handle swipe-to-dismiss functionality. |
RecyclerView |
getContentCardsRecyclerView()
The
RecyclerView used in this fragment. |
IContentCardsViewBindingHandler |
getContentCardsViewBindingHandler() |
IContentCardsUpdateHandler |
getContentCardUpdateHandler() |
protected java.lang.Runnable |
getContentCardUpdateRunnable(ContentCardsUpdatedEvent event) |
protected <any> |
getEmptyCardsAdapter() |
protected java.lang.Runnable |
getNetworkUnavailableRunnable() |
protected void |
handleContentCardsUpdatedEvent(ContentCardsUpdatedEvent event)
Handles the processing and rendering for a
ContentCardsUpdatedEvent on the UI thread. |
protected void |
initializeRecyclerView() |
void |
onCreate(android.os.Bundle savedInstanceState) |
android.view.View |
onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState) |
void |
onPause() |
void |
onRefresh()
Called when the user swipes down and requests a feed refresh.
|
void |
onResume() |
void |
onSaveInstanceState(android.os.Bundle outState) |
void |
onViewStateRestored(android.os.Bundle savedInstanceState) |
void |
setContentCardsViewBindingHandler(IContentCardsViewBindingHandler contentCardsViewBindingHandler)
Sets the
IContentCardsViewBindingHandler . |
void |
setContentCardUpdateHandler(IContentCardsUpdateHandler contentCardUpdateHandler)
Sets an
IContentCardsUpdateHandler for this ContentCardsFragment . |
protected void |
swapRecyclerViewAdapter(<any> newAdapter)
Swaps the current
RecyclerView RecyclerView.Adapter for a new one. |
protected java.lang.Runnable mDefaultNetworkUnavailableRunnable
protected RecyclerView mRecyclerView
protected ContentCardAdapter mCardAdapter
protected EmptyContentCardsAdapter mDefaultEmptyContentCardsAdapter
protected SwipeRefreshLayout mContentCardsSwipeLayout
protected IEventSubscriber<ContentCardsUpdatedEvent> mContentCardsUpdatedSubscriber
protected IEventSubscriber<SdkDataWipeEvent> mSdkDataWipeEventSubscriber
protected final IContentCardsUpdateHandler mDefaultContentCardUpdateHandler
protected IContentCardsUpdateHandler mCustomContentCardUpdateHandler
protected final IContentCardsViewBindingHandler mDefaultContentCardsViewBindingHandler
protected IContentCardsViewBindingHandler mCustomContentCardsViewBindingHandler
public void onCreate(android.os.Bundle savedInstanceState)
public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
public void onRefresh()
public void onResume()
public void onPause()
public IContentCardsUpdateHandler getContentCardUpdateHandler()
public void setContentCardUpdateHandler(IContentCardsUpdateHandler contentCardUpdateHandler)
IContentCardsUpdateHandler
for this ContentCardsFragment
.contentCardUpdateHandler
- a handler for doing any work on Card
s before being rendered in the ContentCards.public IContentCardsViewBindingHandler getContentCardsViewBindingHandler()
public void setContentCardsViewBindingHandler(IContentCardsViewBindingHandler contentCardsViewBindingHandler)
IContentCardsViewBindingHandler
. Note that this method should
only be called before the ContentCardsFragment
is first displayed
or the ContentCardAdapter
will not update correctly.contentCardsViewBindingHandler
- The IContentCardsViewBindingHandler
responsible for rendering each Card
in the RecyclerView
.public void onSaveInstanceState(android.os.Bundle outState)
public void onViewStateRestored(android.os.Bundle savedInstanceState)
public RecyclerView getContentCardsRecyclerView()
RecyclerView
used in this fragment. Note that this will be
null until Fragment#onCreateView(LayoutInflater, ViewGroup, Bundle)
is called.RecyclerView
associated with ContentCardsFragment
.protected void initializeRecyclerView()
protected void attachSwipeHelperCallback()
SimpleItemTouchHelperCallback
to handle swipe-to-dismiss functionality.protected void handleContentCardsUpdatedEvent(ContentCardsUpdatedEvent event)
ContentCardsUpdatedEvent
on the UI thread.protected void swapRecyclerViewAdapter(<any> newAdapter)
RecyclerView
RecyclerView.Adapter
for a new one. If
the current adapter matches the new adapter, then this method does nothing.protected <any> getEmptyCardsAdapter()
protected java.lang.Runnable getContentCardUpdateRunnable(ContentCardsUpdatedEvent event)
ContentCardsUpdatedEvent
/protected java.lang.Runnable getNetworkUnavailableRunnable()