本文整理汇总了Java中com.netease.nim.uikit.common.media.picker.model.PickerContract.getPhotos方法的典型用法代码示例。如果您正苦于以下问题:Java PickerContract.getPhotos方法的具体用法?Java PickerContract.getPhotos怎么用?Java PickerContract.getPhotos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.netease.nim.uikit.common.media.picker.model.PickerContract
的用法示例。
在下文中一共展示了PickerContract.getPhotos方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPickedLocal
import com.netease.nim.uikit.common.media.picker.model.PickerContract; //导入方法依赖的package包/类
private void onPickedLocal(Intent data, int code) {
boolean mutiSelect = getIntent().getBooleanExtra(Extras.EXTRA_MUTI_SELECT_MODE, false);
try {
List<PhotoInfo> photos = PickerContract.getPhotos(data);
if (photos != null && photos.size() >= 1) {
PhotoInfo select = photos.get(0);
String photoPath = select.getAbsolutePath();
boolean crop = getIntent().getBooleanExtra(Extras.EXTRA_NEED_CROP, false);
if (crop) {
crop(photoPath);
} else {
if (data != null) {
Intent result = new Intent(data);
result.putExtra(Extras.EXTRA_FROM_LOCAL, true);
setResult(RESULT_OK, result);
finish();
}
}
}
} catch (Exception e) {
Toast.makeText(this, R.string.picker_image_error, Toast.LENGTH_LONG).show();
finish();
}
}
示例2: onActivityResult
import com.netease.nim.uikit.common.media.picker.model.PickerContract; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == RequestCode.PICKER_IMAGE_PREVIEW) {
if (resultCode == RESULT_OK) {
if (data != null) {
setResult(RESULT_OK, new Intent(data));
finish();
}
} else if (resultCode == PickerAlbumPreviewActivity.RESULT_FROM_USER) {
if (data != null) {
// update photo fragment
isSendOriginalImage = data.getBooleanExtra(Extras.EXTRA_IS_ORIGINAL, false);
List<PhotoInfo> list = PickerContract.getPhotos(data);
if (photoFragment != null && list != null) {
photoFragment.updateGridview(list);
}
// update select photo list
List<PhotoInfo> selectList = PickerContract.getSelectPhotos(data);
resetSelectPhotos(selectList);
updateSelectBtnStatus();
if (photoFragment != null && hasSelectList != null) {
photoFragment.updateSelectedForAdapter(hasSelectList.size());
}
}
}
}
}
示例3: onActivityResult
import com.netease.nim.uikit.common.media.picker.model.PickerContract; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == RequestCode.PICKER_IMAGE_PREVIEW) {
if (resultCode == RESULT_OK) {
if(data != null){
setResult(RESULT_OK, new Intent(data));
finish();
}
}
else if(resultCode == PickerAlbumPreviewActivity.RESULT_FROM_USER){
if(data != null){
// update photo fragment
isSendOriginalImage = data.getBooleanExtra(Extras.EXTRA_IS_ORIGINAL, false);
List<PhotoInfo> list = PickerContract.getPhotos(data);
if(photoFragment != null && list != null){
photoFragment.updateGridview(list);
}
// update select photo list
List<PhotoInfo> selectList = PickerContract.getSelectPhotos(data);
resetSelectPhotos(selectList);
updateSelectBtnStatus();
if(photoFragment != null && hasSelectList != null){
photoFragment.updateSelectedForAdapter(hasSelectList.size());
}
}
}
}
}