コード例 #1
0
 @Override
 protected List<Photo> doInBackground(OAuth... params) {
   OAuth oauth = params[0];
   if (oauth != null) {
     OAuthToken token = oauth.getToken();
     Flickr f =
         FlickrHelper.getInstance()
             .getFlickrAuthed(token.getOauthToken(), token.getOauthTokenSecret());
     if (BuildConfig.DEBUG) Log.d(TAG, "Fetching page " + mPage);
     try {
       return f.getPoolsInterface()
           .getPhotos(mGroup.getId(), null, Constants.EXTRAS, Constants.FETCH_PER_PAGE, mPage);
     } catch (Exception e) {
       e.printStackTrace();
       mException = e;
     }
   } else {
     if (BuildConfig.DEBUG) Log.d(TAG, "Making unauthenticated call");
     if (BuildConfig.DEBUG) Log.d(TAG, "Fetching page " + mPage);
     try {
       return FlickrHelper.getInstance()
           .getPoolsInterface()
           .getPhotos(mGroup.getId(), null, Constants.EXTRAS, Constants.FETCH_PER_PAGE, mPage);
     } catch (Exception e) {
       e.printStackTrace();
       mException = e;
     }
   }
   return null;
 }
コード例 #2
0
 private List<Photo> getUserPhotos() throws Exception {
   OAuthToken token = mOAuth.getToken();
   Flickr f =
       FlickrHelper.getInstance()
           .getFlickrAuthed(token.getOauthToken(), token.getOauthTokenSecret());
   return f.getPeopleInterface()
       .getPhotos(mUser.getId(), Constants.EXTRAS, Constants.FETCH_PER_PAGE, PAGE);
 }
コード例 #3
0
 private List<Photo> getFavoritePhotos() throws Exception {
   OAuthToken token = mOAuth.getToken();
   Flickr f =
       FlickrHelper.getInstance()
           .getFlickrAuthed(token.getOauthToken(), token.getOauthTokenSecret());
   Date minFavDate = null;
   Date maxFavDate = null;
   return f.getFavoritesInterface()
       .getList(
           mUser.getId(),
           minFavDate,
           maxFavDate,
           Constants.FETCH_PER_PAGE,
           PAGE,
           Constants.EXTRAS);
 }
コード例 #4
0
 private List<Photo> getContactsPhotos() throws Exception {
   OAuthToken token = mOAuth.getToken();
   Flickr f =
       FlickrHelper.getInstance()
           .getFlickrAuthed(token.getOauthToken(), token.getOauthTokenSecret());
   boolean justFriends = false;
   boolean singlePhoto = false;
   boolean includeSelf = false;
   return f.getPhotosInterface()
       .getContactsPhotos(
           Constants.FETCH_PER_PAGE,
           Constants.EXTRAS,
           justFriends,
           singlePhoto,
           includeSelf,
           PAGE,
           Constants.FETCH_PER_PAGE);
 }
コード例 #5
0
 private List<Photo> getExplorePhotos() throws Exception {
   Date day = null;
   return FlickrHelper.getInstance()
       .getInterestingInterface()
       .getList(day, Constants.EXTRAS, Constants.FETCH_PER_PAGE, PAGE);
 }