public class CurationsInfiniteRecyclerView
extends BVRecyclerView
CurationsFeedItems
CurationsImageLoader to manage the fetching and
displaying of images. We use this interface to be able to tie into whatever existing image
fetching/caching/manipulating library you are already using.
<com.bazaarvoice.bvandroidsdk.CurationsInfiniteRecyclerView
android:id="@+id/curations_recycler_view"
android:layout_width="match_parent"
android:layout_height="@dimen/curations_height"
app:curationSpanCount="3"
app:curationCellWidthRatio="4"
app:curationCellHeightRatio="3"
app:curationPageSize="20"
app:curationOrientation="horizontal"/>
android.app.Activity#onCreate(Bundle) after inflating your layout, add{@code
final CurationsFeedRequest request = new CurationsFeedRequest
.Builder(Arrays.asList("__foo__", "__bar__"))
.build();
curationsRecyclerView
.setRequest(request)
.setImageLoader(curationsImageLoader)
.setOnPageLoadListener(new CurationsInfiniteRecyclerView.OnPageLoadListener() {| Modifier and Type | Class and Description |
|---|---|
static interface |
CurationsInfiniteRecyclerView.OnFeedItemClickListener
Listener to be notified when a
CurationsFeedItem cell is tapped |
static interface |
CurationsInfiniteRecyclerView.OnPageLoadListener
Listener to be notified when paging requests succeeds or fails
|
| Constructor and Description |
|---|
CurationsInfiniteRecyclerView(android.content.Context context) |
CurationsInfiniteRecyclerView(android.content.Context context,
android.util.AttributeSet attrs) |
CurationsInfiniteRecyclerView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle) |
public CurationsInfiniteRecyclerView(android.content.Context context)
public CurationsInfiniteRecyclerView(android.content.Context context,
android.util.AttributeSet attrs)
public CurationsInfiniteRecyclerView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyle)
protected void init(android.content.Context context,
android.util.AttributeSet attr)
public CurationsInfiniteRecyclerView setRequest(CurationsFeedRequest request)
request - Your CurationsFeedRequest. This class will manage the paging.public CurationsInfiniteRecyclerView setOnPageLoadListener(CurationsInfiniteRecyclerView.OnPageLoadListener pageLoadListener)
pageLoadListener - Your implementation of the CurationsInfiniteRecyclerView.OnPageLoadListener interfacepublic CurationsInfiniteRecyclerView setOnFeedItemClickListener(CurationsInfiniteRecyclerView.OnFeedItemClickListener onFeedItemClickListener)
onFeedItemClickListener - Your implementation of the CurationsInfiniteRecyclerView.OnFeedItemClickListener interfacepublic CurationsInfiniteRecyclerView setImageLoader(CurationsImageLoader imageLoader)
imageLoader - Your implementation of the CurationsImageLoader interfacepublic CurationsInfiniteRecyclerView setMaxFeedItemCount(int maxFeedItemCount)
CurationsFeedItems
that this View will associate with the Adapter. Default is 360,430 which should
be sufficient as is. Increasing this number, increases the amount of heap that
is retained by the adapter.maxFeedItemCount - Max number of items associated with Adapterpublic CurationsInfiniteRecyclerView setCellWidthRatio(int cellWidthRatio)
cellWidthRatio - Used with setCellHeightRatio(int) to set the aspect ratio
that this cell will be rendered at.public CurationsInfiniteRecyclerView setCellHeightRatio(int cellHeightRatio)
cellHeightRatio - Used with setCellWidthRatio(int) to set the aspect ratio
that this cell will be rendered at.public CurationsInfiniteRecyclerView setSpanCount(int spanCount)
spanCount - Number of columns if orientation is LinearLayoutManager#VERTICAL and
number of rows if orientation is LinearLayoutManager#HORIZONTALpublic CurationsInfiniteRecyclerView setOrientation(int orientation)
orientation - Orientation for the list/grid. Can be LinearLayoutManager#VERTICAL or
LinearLayoutManager#HORIZONTALpublic void load()
public void setAdapter(Adapter adapter)
public void setLayoutManager(LayoutManager layoutManager)
public java.lang.String getProductId()
public void onViewGroupInteractedWith()
public void onAddedToViewHierarchy()
public boolean startNestedScroll(int axes)