use of com.chute.sdk.v2.model.enums.AccountType in project photo-picker-plus-android by chute.
the class PhotoPicker method checkIfRemoteServiceIsSupported.
/**
* If the specified list of {@link AccountType} services contains service
* which is not supported by the Chute API, the service is immediately
* removed.
*
* Remote supported services include: Facebook, Flickr, Picasa, Instagram,
* Dropbox, Google, GoogleDrive, SkyDrive and YouTube.
*
* @param remoteServices
* List of {@link AccountType} services.
* @return Filtered {@link AccountType} list.
*/
private List<AccountType> checkIfRemoteServiceIsSupported(List<AccountType> remoteServices) {
List<AccountType> accountList = new ArrayList<AccountType>(remoteServices);
Iterator<AccountType> iterator = accountList.iterator();
while (iterator.hasNext()) {
AccountType accountType = iterator.next();
if (!accountType.equals(AccountType.FACEBOOK) && !accountType.equals(AccountType.FLICKR) && !accountType.equals(AccountType.PICASA) && !accountType.equals(AccountType.INSTAGRAM) && !accountType.equals(AccountType.DROPBOX) && !accountType.equals(AccountType.GOOGLE) && !accountType.equals(AccountType.GOOGLEDRIVE) && !accountType.equals(AccountType.SKYDRIVE) && !accountType.equals(AccountType.YOUTUBE)) {
Log.w(TAG, WARNING_UNSUPPORTED_REMOTE_SERVICES);
iterator.remove();
}
}
if (accountList.isEmpty()) {
return new ArrayList<AccountType>();
} else {
return accountList;
}
}
Aggregations