Java Code Examples for com.googlecode.flickrjandroid.photos.Photo#getLargeUrl()

The following examples show how to use com.googlecode.flickrjandroid.photos.Photo#getLargeUrl() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DemoGlideHelper.java    From GestureViews with Apache License 2.0 6 votes vote down vote up
public static void loadFlickrFull(Photo photo, ImageView image, LoadingListener listener) {
    final String photoUrl = photo.getLargeSize() == null
            ? photo.getMediumUrl() : photo.getLargeUrl();

    final RequestOptions options = new RequestOptions()
            .diskCacheStrategy(DiskCacheStrategy.DATA)
            .override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
            .dontTransform();

    final RequestBuilder<Drawable> thumbRequest = Glide.with(image)
            .load(photo.getMediumUrl())
            .apply(options);

    Glide.with(image)
            .load(photoUrl)
            .apply(new RequestOptions().apply(options).placeholder(image.getDrawable()))
            .thumbnail(thumbRequest)
            .listener(new RequestListenerWrapper<>(listener))
            .into(image);
}
 
Example 2
Source File: PhotoViewerFragment.java    From glimmr with Apache License 2.0 5 votes vote down vote up
/**
 * Return the largest size available for a given photo.
 * <p/>
 * All should have medium, but not all have large.
 */
private String getLargestUrlAvailable(Photo photo) {
    Size size = photo.getLargeSize();
    if (size != null) {
        return photo.getLargeUrl();
    } else {
        /* No large size available, fall back to medium */
        return photo.getMediumUrl();
    }
}