Class NewsfeedAttachmentsViewPagerAdapter
- java.lang.Object
-
- androidx.viewpager.widget.PagerAdapter
-
- com.cheetahdigital.newsfeed.ui.attachments.NewsfeedAttachmentsViewPagerAdapter
-
public class NewsfeedAttachmentsViewPagerAdapter extends androidx.viewpager.widget.PagerAdapterThe adapter used to display attachments (images and videos) ofNewsfeedAttachmentsViewPagerActivity
-
-
Constructor Summary
Constructors Constructor Description NewsfeedAttachmentsViewPagerAdapter(android.app.Activity activity, java.lang.String attachmentUrl, java.util.ArrayList<java.lang.String> allAttachmentUrl, java.util.ArrayList<java.lang.String> allAttachmentThumbnailLink)Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroyItem(android.view.ViewGroup container, int position, java.lang.Object object)protected voiddisplayImage(java.lang.String url, android.widget.ImageView imageView, android.view.View progressBar)Show image into the imageViewprotected voiddisplayVideo(int position, android.view.View videoViewLayout, android.widget.VideoView videoView, android.view.View progressBar, android.view.View layout)Displays the selected videointgetCount()java.lang.ObjectinstantiateItem(android.view.ViewGroup container, int position)booleanisViewFromObject(android.view.View view, java.lang.Object o)-
Methods inherited from class androidx.viewpager.widget.PagerAdapter
destroyItem, finishUpdate, finishUpdate, getItemPosition, getPageTitle, getPageWidth, instantiateItem, notifyDataSetChanged, registerDataSetObserver, restoreState, saveState, setPrimaryItem, setPrimaryItem, startUpdate, startUpdate, unregisterDataSetObserver
-
-
-
-
Constructor Detail
-
NewsfeedAttachmentsViewPagerAdapter
public NewsfeedAttachmentsViewPagerAdapter(android.app.Activity activity, java.lang.String attachmentUrl, java.util.ArrayList<java.lang.String> allAttachmentUrl, java.util.ArrayList<java.lang.String> allAttachmentThumbnailLink)Default constructor- Parameters:
activity- source activity for attachmentattachmentUrl- url link for a single attachmentallAttachmentUrl- url link for all attachmentsallAttachmentThumbnailLink- url link for all attachments thumbnails
-
-
Method Detail
-
instantiateItem
public java.lang.Object instantiateItem(android.view.ViewGroup container, int position)- Overrides:
instantiateItemin classandroidx.viewpager.widget.PagerAdapter
-
displayVideo
protected void displayVideo(int position, android.view.View videoViewLayout, android.widget.VideoView videoView, android.view.View progressBar, android.view.View layout)Displays the selected video- Parameters:
position- position of item in the adaptervideoViewLayout- container of video viewvideoView- view to display the ui of the video attachmentprogressBar- progress bar to show loadinglayout- layout of view pager attachment
-
displayImage
protected void displayImage(java.lang.String url, android.widget.ImageView imageView, android.view.View progressBar)Show image into the imageView- Parameters:
url- url of imageimageView- image view container of the image urlprogressBar- progress bar to display while loading the image
-
destroyItem
public void destroyItem(android.view.ViewGroup container, int position, java.lang.Object object)- Overrides:
destroyItemin classandroidx.viewpager.widget.PagerAdapter
-
getCount
public int getCount()
- Specified by:
getCountin classandroidx.viewpager.widget.PagerAdapter
-
isViewFromObject
public boolean isViewFromObject(android.view.View view, java.lang.Object o)- Specified by:
isViewFromObjectin classandroidx.viewpager.widget.PagerAdapter
-
-