use of com.chute.sdk.v2.model.AccountAlbumModel in project photo-picker-plus-android by chute.
the class AssetUtil method filterFiles.
/**
* Filters the media items that should be displayed according to the options
* retrieved from the configuration regarding if the application should
* support images, videos or both.
*
* @param accountBaseModel
* {@link AccountBaseModel}
* @param supportImages
* boolean value indicating whether the application supports
* images.
* @param supportVideos
* boolean value indicating whether the application supports
* videos.
* @return {@link AccountBaseModel} containing filtered media files.
*/
public static AccountBaseModel filterFiles(AccountBaseModel accountBaseModel, boolean supportImages, boolean supportVideos) {
AccountBaseModel model = new AccountBaseModel();
List<AccountAlbumModel> folders = accountBaseModel.getFolders();
List<AccountMediaModel> files = new ArrayList<AccountMediaModel>();
List<AccountMediaModel> videos = new ArrayList<AccountMediaModel>();
List<AccountMediaModel> images = new ArrayList<AccountMediaModel>();
if (accountBaseModel.getFiles() != null) {
for (AccountMediaModel file : accountBaseModel.getFiles()) {
if (file.getVideoUrl() != null && supportVideos == true) {
videos.add(file);
}
if (file.getVideoUrl() == null && supportImages == true) {
images.add(file);
}
}
}
files.addAll(images);
files.addAll(videos);
model.setFiles(files);
model.setFolders(folders);
return model;
}
use of com.chute.sdk.v2.model.AccountAlbumModel in project photo-picker-plus-android by chute.
the class FragmentRoot method onFolderClicked.
@Override
public void onFolderClicked(int position) {
AccountAlbumModel album = (AccountAlbumModel) adapterAccounts.getItem(position);
accountListener.onAccountFolderSelect(account, album.getId());
}
use of com.chute.sdk.v2.model.AccountAlbumModel in project photo-picker-plus-android by chute.
the class FragmentSingle method onFolderClicked.
@Override
public void onFolderClicked(int position) {
AccountAlbumModel album = (AccountAlbumModel) accountAssetAdapter.getItem(position);
accountListener.onAccountFolderSelect(account, album.getId());
}
Aggregations