use of io.jawg.osmcontributor.ui.adapters.ImageAdapter in project osm-contributor by jawg.
the class PhotoActivity method onPhotosFoundEvent.
/*=========================================*/
/*---------------EVENTS--------------------*/
/*=========================================*/
/**
* Event called when GetFlickrPhotos AsyncTask is done.
*
* @param photosFoundEvent event with photos found
*/
@Subscribe(threadMode = ThreadMode.MAIN)
public void onPhotosFoundEvent(PhotosFoundEvent photosFoundEvent) {
List<List<Size>> photos = photosFoundEvent.getPhotos();
if (photos != null && !photos.isEmpty() && photosFoundEvent.getPoiId().equals(poiId)) {
noPhotos.setVisibility(View.INVISIBLE);
gridPhotos.setVisibility(View.VISIBLE);
imageAdapter = new ImageAdapter(this, poiId);
gridPhotos.setAdapter(imageAdapter);
for (List<Size> size : photos) {
imageAdapter.addPhoto(size.get(Size.SQUARE).getSource(), poiId, Size.SQUARE);
imageAdapter.addPhoto(size.get(Size.ORIGINAL).getSource(), poiId, Size.ORIGINAL);
}
} else {
noPhotos.setVisibility(View.VISIBLE);
gridPhotos.setVisibility(View.INVISIBLE);
}
loadingImage.setVisibility(View.INVISIBLE);
}
Aggregations