Search in sources :

Example 1 with DeliverMediaModel

use of com.getchute.android.photopickerplus.models.DeliverMediaModel in project photo-picker-plus-android by chute.

the class CursorAdapterImages method createMediaResultModel.

private DeliverMediaModel createMediaResultModel(String thumbnail, String path, Uri uri) {
    DeliverMediaModel model = new DeliverMediaModel();
    model.setLocalMediaUri(uri);
    model.setImageUrl(path);
    model.setThumbnail(thumbnail);
    model.setMediaType(MediaType.IMAGE);
    return model;
}
Also used : DeliverMediaModel(com.getchute.android.photopickerplus.models.DeliverMediaModel)

Example 2 with DeliverMediaModel

use of com.getchute.android.photopickerplus.models.DeliverMediaModel in project photo-picker-plus-android by chute.

the class CursorAdapterVideos method createMediaResultModel.

private DeliverMediaModel createMediaResultModel(String thumb, String videoUrl, Uri uri) {
    DeliverMediaModel model = new DeliverMediaModel();
    model.setLocalMediaUri(uri);
    model.setVideoUrl(videoUrl);
    model.setMediaType(MediaType.VIDEO);
    model.setImageUrl(thumb);
    model.setThumbnail(thumb);
    return model;
}
Also used : DeliverMediaModel(com.getchute.android.photopickerplus.models.DeliverMediaModel)

Example 3 with DeliverMediaModel

use of com.getchute.android.photopickerplus.models.DeliverMediaModel in project photo-picker-plus-android by chute.

the class AssetUtil method getPhotoCollection.

/**
	 * Creates a list of {@link AssetModel}s from the given
	 * {@link DeliverMediaModel} list.
	 * 
	 * @param resultList
	 *            List of {@link DeliverMediaModel}s
	 * @return List of {@link AssetModel}s
	 */
public static List<AssetModel> getPhotoCollection(List<DeliverMediaModel> resultList) {
    final List<AssetModel> collection = new ArrayList<AssetModel>();
    for (DeliverMediaModel result : resultList) {
        AssetModel asset = getMediaModel(result);
        collection.add(asset);
    }
    return collection;
}
Also used : DeliverMediaModel(com.getchute.android.photopickerplus.models.DeliverMediaModel) ArrayList(java.util.ArrayList) AssetModel(com.chute.sdk.v2.model.AssetModel)

Example 4 with DeliverMediaModel

use of com.getchute.android.photopickerplus.models.DeliverMediaModel in project photo-picker-plus-android by chute.

the class CursorAdapterImages method getSelectedFilePaths.

public List<DeliverMediaModel> getSelectedFilePaths() {
    final List<DeliverMediaModel> deliverList = new ArrayList<DeliverMediaModel>();
    Iterator<Entry<Integer, String>> iterator = tick.entrySet().iterator();
    while (iterator.hasNext()) {
        Entry<Integer, String> pairs = iterator.next();
        String thumbnail = pairs.getValue();
        int position = pairs.getKey();
        Uri uri = null;
        if (getCursor().moveToPosition(position)) {
            int id = getCursor().getInt(getCursor().getColumnIndex(MediaStore.Images.Media._ID));
            uri = ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, id);
        }
        String path = MediaDAO.getImagePathFromCursor(context, getCursor(), position);
        deliverList.add(createMediaResultModel(thumbnail, path, uri));
    }
    return deliverList;
}
Also used : DeliverMediaModel(com.getchute.android.photopickerplus.models.DeliverMediaModel) Entry(java.util.Map.Entry) ArrayList(java.util.ArrayList) Uri(android.net.Uri)

Example 5 with DeliverMediaModel

use of com.getchute.android.photopickerplus.models.DeliverMediaModel in project photo-picker-plus-android by chute.

the class CursorAdapterVideos method getSelectedFilePaths.

public List<DeliverMediaModel> getSelectedFilePaths() {
    final List<DeliverMediaModel> deliverList = new ArrayList<DeliverMediaModel>();
    Iterator<Entry<Integer, String>> iterator = tick.entrySet().iterator();
    while (iterator.hasNext()) {
        Entry<Integer, String> pairs = iterator.next();
        String path = pairs.getValue();
        int position = pairs.getKey();
        Uri uri = null;
        if (getCursor().moveToPosition(position)) {
            int id = getCursor().getInt(getCursor().getColumnIndex(MediaStore.Video.Media._ID));
            uri = ContentUris.withAppendedId(MediaStore.Video.Thumbnails.EXTERNAL_CONTENT_URI, id);
        }
        String thumbnail = MediaDAO.getVideoThumbnailFromCursor(context, getCursor(), position);
        deliverList.add(createMediaResultModel(thumbnail, path, uri));
    }
    return deliverList;
}
Also used : DeliverMediaModel(com.getchute.android.photopickerplus.models.DeliverMediaModel) Entry(java.util.Map.Entry) ArrayList(java.util.ArrayList) Uri(android.net.Uri)

Aggregations

DeliverMediaModel (com.getchute.android.photopickerplus.models.DeliverMediaModel)5 ArrayList (java.util.ArrayList)3 Uri (android.net.Uri)2 Entry (java.util.Map.Entry)2 AssetModel (com.chute.sdk.v2.model.AssetModel)1