GalleryFinal icon indicating copy to clipboard operation
GalleryFinal copied to clipboard

建议修改多选图片时,选中图片数为0时,点ok(勾)按钮可以返回,简单修改代码如下

Open heweizhang opened this issue 8 years ago • 1 comments

1、修改PhotoSelectActivity 的点击事件中,改为如下:(添加等于0时resultData())

if (id == R.id.fab_ok) {
            if (mSelectPhotoList.size() >= 0) {
                if (!GalleryFinal.getFunctionConfig().isEditPhoto()) {
                    resultData(mSelectPhotoList);
                } else {
                    if (mSelectPhotoList.size() == 0) {
                        return;
                    }
                    toPhotoEdit();
                }
            }
}

2、修改PhotoBaseActivity的resultData()方法

  if (callback != null) {

            if ( photoList != null && photoList.size() >= 0 ) {//默认大于0,这边也需修改 否则回调会走onHanlderFailure()方法
                callback.onHanlderSuccess(requestCode, photoList);
            } else {
                callback.onHanlderFailure(requestCode, getString(R.string.photo_list_empty));
            }
        }

heweizhang avatar Sep 20 '16 03:09 heweizhang

或者加个提示,要选图片

joelan avatar Sep 20 '16 04:09 joelan