Search in sources :

Example 11 with PhotoEntity

use of com.ushahidi.android.app.entities.PhotoEntity in project Ushahidi_Android by ushahidi.

the class ListPhotoModel method getPhotosByCheckinId.

public List<PhotoEntity> getPhotosByCheckinId(int checkinId) {
    mPhotoModel = new ArrayList<PhotoEntity>();
    mMedia = Database.mMediaDao.fetchCheckinPhoto(checkinId);
    if (mMedia != null && mMedia.size() > 0) {
        for (MediaEntity item : mMedia) {
            PhotoEntity photo = new PhotoEntity();
            photo.setDbId(item.getDbId());
            photo.setPhoto(item.getLink());
            mPhotoModel.add(photo);
        }
    }
    return mPhotoModel;
}
Also used : PhotoEntity(com.ushahidi.android.app.entities.PhotoEntity) MediaEntity(com.ushahidi.android.app.entities.MediaEntity)

Aggregations

PhotoEntity (com.ushahidi.android.app.entities.PhotoEntity)11 MediaEntity (com.ushahidi.android.app.entities.MediaEntity)6 File (java.io.File)3 ReportCategory (com.ushahidi.android.app.entities.ReportCategory)1 ReportEntity (com.ushahidi.android.app.entities.ReportEntity)1 ListPhotoModel (com.ushahidi.android.app.models.ListPhotoModel)1 Incident (com.ushahidi.java.sdk.api.Incident)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1