Android Open Source - photos Photo Source






From Project

Back to project page photos.

License

The source code is released under:

MIT License

If you think the Android project photos listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ericfarraro.sdk.data;
//from w  ww  .java2 s . c  om
import com.ericfarraro.sdk.interfaces.PhotoListRequestCompleted;
import com.ericfarraro.sdk.models.Photo;

import java.util.ArrayList;

/**
 * Created by Eric on 10/7/2014.
 */
public abstract class PhotoSource {

    protected PhotoListRequestCompleted mPhotoListRequestCompletedListener;
    protected int mPhotosPerPage = 50;

    /**
     * A method that returns some 'default' view for the gallery.
     * Caller should implement {@link com.ericfarraro.sdk.interfaces.PhotoListRequestCompleted} to listen for a response
     * @param page The page number to return
     * @return A list of Photos
     */
    public abstract void fetchDefaultPhotos(int page);

    /**
     * Search photos (if applicable)
     * @param query A search query string
     */
    public abstract void searchPhotos(String query, int page);

    /**
     * Gets a {@link com.ericfarraro.sdk.models.Photo} from the {@link com.ericfarraro.sdk.data.PhotoSource}, given some identifier
     * Callers should implement {@link com.ericfarraro.sdk.interfaces.PhotoListRequestCompleted} to listen for a response
     * @param identifier A unique identifier that can be used to retrieve the photo
     */
    public abstract void getLargePhoto(String identifier);

    /**
     * @return A human readable name identifying the PhotoSource (eg: 'Flickr')
     */
    public abstract String getPhotoSourceName();

    public boolean isSearchSupported() { return false; }

    public PhotoListRequestCompleted getPhotoListRequestCompletedListener() {
        return mPhotoListRequestCompletedListener;
    }
    public void setPhotoListRequestCompletedListener(PhotoListRequestCompleted photoListRequestCompletedListener) {
        mPhotoListRequestCompletedListener = photoListRequestCompletedListener;
    }
    public int getPhotosPerPage() {
        return mPhotosPerPage;
    }
    public void setPhotosPerPage(int photosPerPage) {
        mPhotosPerPage = photosPerPage;
    }
}




Java Source Code List

com.ericfarraro.photos.ApplicationTest.java
com.ericfarraro.photos.activities.MainActivity.java
com.ericfarraro.photos.activities.PhotoDetailActivity.java
com.ericfarraro.photos.adapters.PhotoGalleryItemListAdapter.java
com.ericfarraro.photos.core.EndlessScrollListener.java
com.ericfarraro.photos.core.ImageDownloader.java
com.ericfarraro.photos.fragments.MainFragment.java
com.ericfarraro.photos.fragments.PhotoDetailFragment.java
com.ericfarraro.photos.singletons.PhotoCache.java
com.ericfarraro.sdk.core.ImageDownloader.java
com.ericfarraro.sdk.data.FlickrPhotoSource.java
com.ericfarraro.sdk.data.PhotoSource.java
com.ericfarraro.sdk.interfaces.ImageDownloadCompleted.java
com.ericfarraro.sdk.interfaces.PhotoListRequestCompleted.java
com.ericfarraro.sdk.interfaces.UrlContentRetrieved.java
com.ericfarraro.sdk.models.Photo.java
com.ericfarraro.sdk.util.UrlFetchTask.java
com.ericfarraro.sdk.util.Utility.java