CEInFeedHelper
CEInFeedHelper
is the class that simplifies in-feed integration of Card Ad and Native Ad.
Public construct
Create inFeedHelper object
Public methods
void
set Ad source by your Ad format to CEInFeedHelper
void
check if the feed is idle or scrolling
void
check the scroll state
Public methods
CEIFAdView
request Ad view from CEInFeedHelper
void
set Ad event listener to receive Ad status
boolean
check if this position is Ad
boolean
check if this view is Ad
synchronized void
reset the Ad cache to request new Ad when you want to reload the dataset
void
set the number of original in-feed items into CEInFeedHelper
int
get the number of current in-feed items
int
get the item's original position when there are Ad items in the view
int
get the item's adjusted position when there are no Ad items in the view
Object
request Ad object from CEInFeedHelper
int
always return 2, because there are 2 type of items, normal ones and Ads
setAdSource
void setAdSource(CEIFAdSource adSource)
set Ad source by your Ad format to CEInFeedHelper
Parameter
adSource
CEIFAdSource: In-feed Ad source info
onScrollStateChanged
void onScrollStateChanged(int state)
check if the feed is idle or scrolling
Parameter
state
int: the current scroll state
onScroll
void onScroll(int visiblePos, int visibleItems, int totalChildView)
check the scroll state
Parameter
visiblePos
int: the index of the first visible cell
visibleItems
int: the number of visible cells
totalChildView
int: the number of items in the list adapter
getAdView
CEIFAdView getAdView(int position)
request Ad view from CEInFeedHelper if you don't want to use CEIFAdapter/CEIFRecyclerViewAdapter
Parameter
position
int: the position of the in-feed content
setAdEventListener
void setAdEventListener(CEIFHelperAdEventListener listener)
set Ad event listener to receive Ad status
Parameter
listener
CEIFHelperAdEventListener: the listener for ad event callback
isAd
boolean isAd(int position)
check if this position is Ad
Parameter
position
int: the Dataset's position
isAd
boolean isAd(View view)
check if this view is Ad
Parameter
view
View
reset
synchronized void reset()
reset the Ad cache to request new Ad when you want to reload the dataset. To be more specific, you can call this API when users pull down to refresh the in-feed page.
setItemCount
void setItemCount(int originalCount)
set the number of original in-feed items into CEInFeedHelper
Parameter
originalCount
int: the number of original in-feed items
getAdjustedCount
int getAdjustedCount(int originalCount)
get the number of current in-feed items
Parameter
originalCount
int: number of original in-feed items
getOriginalPosition
int getOriginalPosition(int position)
get the item's original position when there are Ad items in the view
Parameter
position
int: the in-feed item's current position
getAdjustedPosition
int getAdjustedPosition(final int originalPosition)
Parameter
originalPosition
int: the in-feed's item original position
getAdData
Object getAdData(int position)
request Ad object from CEInFeedHelper
Parameter
position
int: the Ad item's position
getViewTypeCount
int getViewTypeCount()
**always return 2, because there are 2 type of items, normal ones and Ads
Last updated