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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations