Search in sources :

Example 1 with ListPhotoModel

use of com.ushahidi.android.app.models.ListPhotoModel in project Ushahidi_Android by ushahidi.

the class UploadPhotoAdapter method refresh.

/**
     * @see com.ushahidi.android.app.adapters.BaseListAdapter#refresh()
     */
@Override
public void refresh() {
    mListPhotoModel = new ListPhotoModel();
    items = mListPhotoModel.getPendingPhotos(context);
    this.setItems(items);
}
Also used : ListPhotoModel(com.ushahidi.android.app.models.ListPhotoModel)

Example 2 with ListPhotoModel

use of com.ushahidi.android.app.models.ListPhotoModel in project Ushahidi_Android by ushahidi.

the class ViewReportView method setListPhotos.

public void setListPhotos(int reportId) {
    if (photo != null) {
        ListPhotoModel mListPhotoModel = new ListPhotoModel();
        final boolean loaded = mListPhotoModel.load(reportId);
        int totalPhotos = mListPhotoModel.totalReportPhoto();
        if (loaded) {
            final List<PhotoEntity> items = mListPhotoModel.getPhotos();
            if (items.size() > 0) {
                getPhoto(items.get(0).getPhoto(), photo);
                total.setText(context.getResources().getQuantityString(R.plurals.no_of_images, totalPhotos, totalPhotos));
            } else {
                photo.setVisibility(View.GONE);
                total.setVisibility(View.GONE);
                listPhotosEmptyView.setVisibility(View.VISIBLE);
            }
        }
    }
}
Also used : ListPhotoModel(com.ushahidi.android.app.models.ListPhotoModel) PhotoEntity(com.ushahidi.android.app.entities.PhotoEntity)

Example 3 with ListPhotoModel

use of com.ushahidi.android.app.models.ListPhotoModel in project Ushahidi_Android by ushahidi.

the class ListPhotoAdapter method refresh.

public void refresh(int reportId) {
    mListPhotoModel = new ListPhotoModel();
    final boolean loaded = mListPhotoModel.load(reportId);
    totalPhotos = mListPhotoModel.totalReportPhoto();
    if (loaded) {
        items = mListPhotoModel.getPhotos();
        this.setItems(items);
    }
}
Also used : ListPhotoModel(com.ushahidi.android.app.models.ListPhotoModel)

Example 4 with ListPhotoModel

use of com.ushahidi.android.app.models.ListPhotoModel in project Ushahidi_Android by ushahidi.

the class UploadPhotoAdapter method refresh.

public void refresh(int reportId) {
    mListPhotoModel = new ListPhotoModel();
    items = mListPhotoModel.getPendingPhotosByReportId(reportId);
    this.setItems(items);
}
Also used : ListPhotoModel(com.ushahidi.android.app.models.ListPhotoModel)

Example 5 with ListPhotoModel

use of com.ushahidi.android.app.models.ListPhotoModel in project Ushahidi_Android by ushahidi.

the class UploadPhotoAdapter method pendingPhotos.

public List<File> pendingPhotos(int reportId) {
    mListPhotoModel = new ListPhotoModel();
    items = mListPhotoModel.getPendingPhotosByReportId(reportId);
    return getPhotos(items);
}
Also used : ListPhotoModel(com.ushahidi.android.app.models.ListPhotoModel)

Aggregations

ListPhotoModel (com.ushahidi.android.app.models.ListPhotoModel)7 PhotoEntity (com.ushahidi.android.app.entities.PhotoEntity)1