Class LocationPhotoAdapter
- java.lang.Object
-
- androidx.viewpager.widget.PagerAdapter
-
- com.smarteist.autoimageslider.SliderViewAdapter<com.cmput301w23t09.qrhunter.locationphoto.LocationPhotoAdapter.LocationPhotoHolder>
-
- com.cmput301w23t09.qrhunter.locationphoto.LocationPhotoAdapter
-
public class LocationPhotoAdapter extends com.smarteist.autoimageslider.SliderViewAdapter<com.cmput301w23t09.qrhunter.locationphoto.LocationPhotoAdapter.LocationPhotoHolder>Displays a QRCode's location photos inside a slider view.Uses and adapts code from Android Image Slider (https://github.com/smarteist/Android-Image-Slider) By: Ali Hosseini (https://github.com/smarteist) License: Apache 2.0
-
-
Constructor Summary
Constructors Constructor Description LocationPhotoAdapter(android.content.Context ctx, QRCode qrCode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCount()intgetPlayerLocationPhoto(Player player)Gets the index of the player's location photovoidonBindViewHolder(com.cmput301w23t09.qrhunter.locationphoto.LocationPhotoAdapter.LocationPhotoHolder viewHolder, int position)com.cmput301w23t09.qrhunter.locationphoto.LocationPhotoAdapter.LocationPhotoHolderonCreateViewHolder(android.view.ViewGroup parent)voidrenewLocationPhotos(java.util.function.Consumer<java.util.List<com.google.firebase.storage.StorageReference>> callback)Fetchs all location photos for the QRCode and updates the slider view-
Methods inherited from class com.smarteist.autoimageslider.SliderViewAdapter
destroyItem, getItemPosition, instantiateItem, isViewFromObject, notifyDataSetChanged
-
-
-
-
Constructor Detail
-
LocationPhotoAdapter
public LocationPhotoAdapter(android.content.Context ctx, QRCode qrCode)
-
-
Method Detail
-
renewLocationPhotos
public void renewLocationPhotos(java.util.function.Consumer<java.util.List<com.google.firebase.storage.StorageReference>> callback)
Fetchs all location photos for the QRCode and updates the slider view- Parameters:
callback- A callback function to run after all photos have been fetched
-
getPlayerLocationPhoto
public int getPlayerLocationPhoto(Player player)
Gets the index of the player's location photo- Parameters:
player- The player we want to find the location photo of- Returns:
- The index of the player's location photo
-
onCreateViewHolder
public com.cmput301w23t09.qrhunter.locationphoto.LocationPhotoAdapter.LocationPhotoHolder onCreateViewHolder(android.view.ViewGroup parent)
- Specified by:
onCreateViewHolderin classcom.smarteist.autoimageslider.SliderViewAdapter<com.cmput301w23t09.qrhunter.locationphoto.LocationPhotoAdapter.LocationPhotoHolder>
-
onBindViewHolder
public void onBindViewHolder(com.cmput301w23t09.qrhunter.locationphoto.LocationPhotoAdapter.LocationPhotoHolder viewHolder, int position)- Specified by:
onBindViewHolderin classcom.smarteist.autoimageslider.SliderViewAdapter<com.cmput301w23t09.qrhunter.locationphoto.LocationPhotoAdapter.LocationPhotoHolder>
-
getCount
public int getCount()
- Specified by:
getCountin classandroidx.viewpager.widget.PagerAdapter
-
-