use of com.chute.sdk.v2.model.enums.AccountType in project photo-picker-plus-android by chute.
the class FragmentSingle method onCreateView.
@SuppressLint("NewApi")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
isMultipicker = PhotoPicker.getInstance().isMultiPicker();
accountType = PhotoPickerPreferenceUtil.get().getAccountType();
Map<AccountType, DisplayType> accountMap = PhotoPicker.getInstance().getAccountDisplayType();
displayType = AppUtil.getDisplayType(accountMap, PhotoPicker.getInstance().getDefaultAccountDisplayType(), accountType);
getActionBarActivity().getSupportActionBar().setTitle(UIUtil.getActionBarTitle(getActivity(), accountType, PhotoFilterType.SOCIAL_MEDIA));
View view = inflater.inflate(R.layout.gc_fragment_assets, container, false);
return view;
}
use of com.chute.sdk.v2.model.enums.AccountType in project photo-picker-plus-android by chute.
the class AppUtil method getDisplayType.
public static DisplayType getDisplayType(Map<AccountType, DisplayType> accountMap, DisplayType displayType, AccountType accountType) {
if (accountMap != null) {
Iterator<Entry<AccountType, DisplayType>> iterator = accountMap.entrySet().iterator();
while (iterator.hasNext()) {
Entry<AccountType, DisplayType> pairs = iterator.next();
AccountType type = pairs.getKey();
if (type == accountType) {
displayType = pairs.getValue();
}
}
}
return displayType;
}
use of com.chute.sdk.v2.model.enums.AccountType in project photo-picker-plus-android by chute.
the class ServicesActivity method accountLogin.
@Override
public void accountLogin(AccountType type) {
accountType = type;
PhotoPickerPreferenceUtil.get().setAccountType(accountType);
if (PreferenceUtil.get().hasAccount(type.getLoginMethod())) {
AccountModel account = PreferenceUtil.get().getAccount(type.getLoginMethod());
accountClicked(account, accountType);
} else {
AuthenticationFactory.getInstance().startAuthenticationActivity(ServicesActivity.this, accountType, new AuthenticationOptions.Builder().setClearCookiesForAccount(false).setShouldRetainSession(false).build());
}
}
use of com.chute.sdk.v2.model.enums.AccountType in project photo-picker-plus-android by chute.
the class PhotoPickerPreferenceUtil method getAccountType.
public AccountType getAccountType() {
String accountName = getPreferences().getString(KEY_ACCOUNT_TYPE, null);
AccountType type = null;
for (AccountType accountType : AccountType.values()) {
if (accountName != null && accountName.equalsIgnoreCase(accountType.name())) {
type = accountType;
}
}
return type;
}
use of com.chute.sdk.v2.model.enums.AccountType in project photo-picker-plus-android by chute.
the class PhotoPickerPlusTutorialApp method onCreate.
@Override
public void onCreate() {
super.onCreate();
/**
* Fill in using "app_id" and "app_secret" values from your Chute
* application.
*
* See <a href="https://apps.getchute.com">https://apps.getchute.com</a>
*/
Chute.init(this, new AuthConstants(APP_ID, APP_SECRET));
Map<AccountType, DisplayType> map = new HashMap<AccountType, DisplayType>();
map.put(AccountType.INSTAGRAM, DisplayType.LIST);
PhotoPickerConfiguration config = new PhotoPickerConfiguration.Builder(getApplicationContext()).isMultiPicker(false).defaultAccountDisplayType(DisplayType.LIST).enableLogout(true).accountList(AccountType.FLICKR, AccountType.DROPBOX, AccountType.INSTAGRAM, AccountType.GOOGLE, AccountType.YOUTUBE, AccountType.FACEBOOK, AccountType.CHUTE, AccountType.FOURSQUARE, AccountType.GOOGLEDRIVE, AccountType.PICASA, AccountType.SKYDRIVE, AccountType.TWITTER).localMediaList(LocalServiceType.ALL_MEDIA, LocalServiceType.CAMERA_MEDIA, LocalServiceType.RECORD_VIDEO, LocalServiceType.LAST_VIDEO_CAPTURED, LocalServiceType.TAKE_PHOTO, LocalServiceType.LAST_PHOTO_TAKEN).configUrl(ConfigEndpointURLs.SERVICES_CONFIG_URL).supportImages(true).supportVideos(true).build();
PhotoPicker.getInstance().init(config);
}
Aggregations