Java Code Examples for me.iwf.photopicker.entity.PhotoDirectory#setCoverPath()
The following examples show how to use
me.iwf.photopicker.entity.PhotoDirectory#setCoverPath() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MediaStoreHelper.java From PhotoPicker with Apache License 2.0 | 4 votes |
@Override public void onLoadFinished(Loader<Cursor> loader, Cursor data) { if (data == null) return; List<PhotoDirectory> directories = new ArrayList<>(); PhotoDirectory photoDirectoryAll = new PhotoDirectory(); photoDirectoryAll.setName(context.getString(R.string.__picker_all_image)); photoDirectoryAll.setId("ALL"); while (data.moveToNext()) { int imageId = data.getInt(data.getColumnIndexOrThrow(_ID)); String bucketId = data.getString(data.getColumnIndexOrThrow(BUCKET_ID)); String name = data.getString(data.getColumnIndexOrThrow(BUCKET_DISPLAY_NAME)); String path = data.getString(data.getColumnIndexOrThrow(DATA)); long size = data.getInt(data.getColumnIndexOrThrow(SIZE)); if (size < 1) continue; PhotoDirectory photoDirectory = new PhotoDirectory(); photoDirectory.setId(bucketId); photoDirectory.setName(name); if (!directories.contains(photoDirectory)) { photoDirectory.setCoverPath(path); photoDirectory.addPhoto(imageId, path); photoDirectory.setDateAdded(data.getLong(data.getColumnIndexOrThrow(DATE_ADDED))); directories.add(photoDirectory); } else { directories.get(directories.indexOf(photoDirectory)).addPhoto(imageId, path); } photoDirectoryAll.addPhoto(imageId, path); } if (photoDirectoryAll.getPhotoPaths().size() > 0) { photoDirectoryAll.setCoverPath(photoDirectoryAll.getPhotoPaths().get(0)); } directories.add(INDEX_ALL_PHOTOS, photoDirectoryAll); if (resultCallback != null) { resultCallback.onResultCallback(directories); } }
Example 2
Source File: MediaStoreHelper.java From PhotoPicker with Apache License 2.0 | 4 votes |
@Override public void onLoadFinished(Loader<Cursor> loader, Cursor data) { if (data == null) return; List<PhotoDirectory> directories = new ArrayList<>(); PhotoDirectory photoDirectoryAll = new PhotoDirectory(); photoDirectoryAll.setName(context.getString(R.string.__picker_all_image)); photoDirectoryAll.setId("ALL"); while (data.moveToNext()) { int imageId = data.getInt(data.getColumnIndexOrThrow(_ID)); String bucketId = data.getString(data.getColumnIndexOrThrow(BUCKET_ID)); String name = data.getString(data.getColumnIndexOrThrow(BUCKET_DISPLAY_NAME)); String path = data.getString(data.getColumnIndexOrThrow(DATA)); long size = data.getInt(data.getColumnIndexOrThrow(SIZE)); if (size < 1) continue; PhotoDirectory photoDirectory = new PhotoDirectory(); photoDirectory.setId(bucketId); photoDirectory.setName(name); if (!directories.contains(photoDirectory)) { photoDirectory.setCoverPath(path); photoDirectory.addPhoto(imageId, path); photoDirectory.setDateAdded(data.getLong(data.getColumnIndexOrThrow(DATE_ADDED))); directories.add(photoDirectory); } else { directories.get(directories.indexOf(photoDirectory)).addPhoto(imageId, path); } photoDirectoryAll.addPhoto(imageId, path); } if (photoDirectoryAll.getPhotoPaths().size() > 0) { photoDirectoryAll.setCoverPath(photoDirectoryAll.getPhotoPaths().get(0)); } directories.add(INDEX_ALL_PHOTOS, photoDirectoryAll); if (resultCallback != null) { resultCallback.onResultCallback(directories); } }
Example 3
Source File: MediaStoreHelper.java From PhotoPicker with Apache License 2.0 | 4 votes |
@Override public void onLoadFinished(Loader<Cursor> loader, Cursor data) { if (data == null) return; List<PhotoDirectory> directories = new ArrayList<>(); PhotoDirectory photoDirectoryAll = new PhotoDirectory(); photoDirectoryAll.setName(context.getString(R.string.__picker_all_image)); photoDirectoryAll.setId("ALL"); data.moveToFirst(); while (data.moveToNext()) { int imageId = data.getInt(data.getColumnIndexOrThrow(_ID)); String bucketId = data.getString(data.getColumnIndexOrThrow(BUCKET_ID)); String name = data.getString(data.getColumnIndexOrThrow(BUCKET_DISPLAY_NAME)); String path = data.getString(data.getColumnIndexOrThrow(DATA)); long size = data.getInt(data.getColumnIndexOrThrow(SIZE)); if (size < 1) continue; PhotoDirectory photoDirectory = new PhotoDirectory(); photoDirectory.setId(bucketId); photoDirectory.setName(name); if (!directories.contains(photoDirectory)) { photoDirectory.setCoverPath(path); photoDirectory.addPhoto(imageId, path); photoDirectory.setDateAdded(data.getLong(data.getColumnIndexOrThrow(DATE_ADDED))); directories.add(photoDirectory); } else { directories.get(directories.indexOf(photoDirectory)).addPhoto(imageId, path); } photoDirectoryAll.addPhoto(imageId, path); } if (photoDirectoryAll.getPhotoPaths().size() > 0) { photoDirectoryAll.setCoverPath(photoDirectoryAll.getPhotoPaths().get(0)); } directories.add(INDEX_ALL_PHOTOS, photoDirectoryAll); if (resultCallback != null) { resultCallback.onResultCallback(directories); } }