use of com.abewy.android.apps.klyph.core.fql.Media.Photo in project Klyph by jonathangerbaud.
the class PhotoAlbumAdapter method mergeViewWithData.
@Override
protected void mergeViewWithData(View view, GraphObject data) {
super.mergeViewWithData(view, data);
final RatioImageView rImageView = (RatioImageView) view;
Photo photo = (Photo) data;
Collections.sort(photo.getImages(), new Comparator<Image>() {
@Override
public int compare(Image lhs, Image rhs) {
if (lhs.getWidth() > rhs.getWidth())
return 1;
else if (lhs.getWidth() < rhs.getWidth())
return -1;
return 0;
}
});
Image selectedImage = photo.getImages().get(0);
rImageView.setImageSize(selectedImage.getWidth(), selectedImage.getHeight());
if (placeHolder == -1)
placeHolder = AttrUtil.getResourceId(getContext(view), R.attr.squarePlaceHolderIcon);
loadImage(rImageView, selectedImage.getSrc(), placeHolder, data);
}
Aggregations