当前位置: 首页>>代码示例>>Java>>正文


Java PickerContract.getPhotos方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:25,代码来源:PickImageActivity.java

示例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());
                }
            }
        }
    }
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:28,代码来源:PickerAlbumActivity.java

示例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());
        		}
        	}
        }
    }
}
 
开发者ID:LegendKe,项目名称:MyTravelingDiary,代码行数:29,代码来源:PickerAlbumActivity.java


注:本文中的com.netease.nim.uikit.common.media.picker.model.PickerContract.getPhotos方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。