com.googlecode.flickrjandroid.photos.PhotosInterface Java Examples
The following examples show how to use
com.googlecode.flickrjandroid.photos.PhotosInterface.
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: FlickrApi.java From GestureViews with Apache License 2.0 | 5 votes |
@Background(singleThread = true) @Subscribe(LOAD_IMAGES_EVENT) private static synchronized EventResult loadImages(int count) throws Exception { SearchParameters params = new SearchParameters(); params.setText(SEARCH_QUERY); params.setSafeSearch(Flickr.SAFETYLEVEL_SAFE); params.setSort(SearchParameters.RELEVANCE); params.setLicense(LICENCE_ID); params.setExtras(photoParams); boolean hasNext = hasNext(); final PhotosInterface flickrPhotos = new Flickr(API_KEY).getPhotosInterface(); while (photos.size() < count && hasNext) { final PhotoList loaded = flickrPhotos.search(params, PER_PAGE, pages.size() + 1); pages.add(loaded); photos.addAll(loaded); hasNext = hasNext(); } int resultSize; if (photos.size() >= count) { resultSize = count; } else { resultSize = photos.size(); } List<Photo> result = new ArrayList<>(photos.subList(0, resultSize)); if (!hasNext) { hasNext = photos.size() > count; } return EventResult.create().result(result, hasNext).build(); }
Example #2
Source File: FlickrHelper.java From glimmr with Apache License 2.0 | 5 votes |
public PhotosInterface getPhotosInterface() { Flickr f = getFlickr(); if (f != null) { return f.getPhotosInterface(); } else { return null; } }