If you think the Android project photo-picker-plus-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/**
* The MIT License (MIT)/*www.java2s.com*/
Copyright (c) 2013 Chute
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/package com.getchute.android.photopickerplus.util.intent;
import java.util.ArrayList;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Parcelable;
import com.getchute.android.photopickerplus.ui.activity.AssetActivity;
import com.getchute.android.photopickerplus.models.enums.PhotoFilterType;
import com.chute.sdk.v2.model.AccountModel;
import com.chute.sdk.v2.model.AssetModel;
import com.chute.sdk.v2.model.enums.AccountType;
/**
* {@link PhotosIntentWrapper} is a wrapper class that wraps the following
* parameters needed for the intent:
* <ul>
* <li> {@link AccountModel}
* <li>Album ID
* <li>List of {@link AssetModel}s
* <li>{@link com.getchute.android.photopickerplus.models.enums.PhotoFilterType}
* </ul>
*
*/publicclass PhotosIntentWrapper extends IntentWrapper {
publicstaticfinalint ACTIVITY_FOR_RESULT_STREAM_KEY = 113;
// social photos
privatestaticfinal String KEY_ACCOUNT = "account";
privatestaticfinal String KEY_ALBUM_ID = "albumId";
publicstaticfinal String KEY_PHOTO_COLLECTION = "photoCollection";
privatestaticfinal String KEY_FILTER_TYPE = "filter_type";
privatestaticfinal String KEY_ACCOUNT_TYPE = "account_type";
public PhotosIntentWrapper(Context context) {
super(context, AssetActivity.class);
}
public PhotosIntentWrapper(Intent intent) {
super(intent);
}
public AccountModel getAccount() {
return getIntent().getExtras().getParcelable(KEY_ACCOUNT);
}
publicvoid setAccount(AccountModel account) {
getIntent().putExtra(KEY_ACCOUNT, account);
}
public String getAlbumId() {
return getIntent().getExtras().getString(KEY_ALBUM_ID);
}
publicvoid setAlbumId(String albumId) {
getIntent().putExtra(KEY_ALBUM_ID, albumId);
}
@SuppressWarnings("unchecked")
public ArrayList<AssetModel> getMediaCollection() {
return (ArrayList<AssetModel>) getIntent().getExtras().getParcelable(
KEY_PHOTO_COLLECTION);
}
publicvoid setMediaCollection(ArrayList<AssetModel> mediaCollection) {
getIntent()
.putExtra(KEY_PHOTO_COLLECTION, (Parcelable) mediaCollection);
}
public PhotoFilterType getFilterType() {
return (PhotoFilterType) getIntent().getExtras().get(KEY_FILTER_TYPE);
}
publicvoid setFilterType(PhotoFilterType type) {
getIntent().putExtra(KEY_FILTER_TYPE, type);
}
public AccountType getAccountType() {
return (AccountType) getIntent().getExtras().get(KEY_ACCOUNT_TYPE);
}
publicvoid setAccountType(AccountType type) {
getIntent().putExtra(KEY_ACCOUNT_TYPE, type);
}
publicvoid startActivityForResult(Activity context, int code) {
context.startActivityForResult(getIntent(), code);
}
}