FinalTeam / RxGalleryFinal

图片选择库,单选/多选、拍照、裁剪、压缩,自定义。包括视频选择和录制。
https://github.com/FinalTeam/RxGalleryFinal
2.83k stars 513 forks source link

确认按钮连续点击问题 #237

Open Linnnnnn opened 6 years ago

Linnnnnn commented 6 years ago

选中多张图片后,连续点击确认按钮,返回张数等于选中张数*点击次数

Linnnnnn commented 6 years ago

RxGalleryFinal.with(mContext).image().multiple().maxSize(max) .imageLoader(ImageLoaderType.PICASSO) .hideCamera() .subscribe(new RxBusResultDisposable() { @Override protected void onEvent(ImageMultipleResultEvent imageMultipleResultEvent) throws Exception {

                                    for (int i = 0; i < imageMultipleResultEvent.getResult().size(); i++) {
                                        PhotoBean photoBean = new PhotoBean();
                                        MediaBean mediaBean = imageMultipleResultEvent.getResult().get(i);
                                        String temp = "LmCity" + System.currentTimeMillis();
                                        photoBean.setFileName(temp);
                                        Bitmap bitmap = FileUtil.OpenSDCardPhoto(mediaBean.getThumbnailBigPath());
                                        photoBean.setBitmap(BitmapUtil.compressImage(bitmap));
                                        photoBean.setCompressionFile(BitmapUtil.compressImage(bitmap), temp);
                                        photoBean.setLayoutId(R.layout.item_selected_photo);
                                        photoBean.setUrl();
                                        photoBean.setNeedUpload(true);
                                        bean.getUploadPhotoes().add(0, photoBean);
                                        max--;
                                    }
                                    mAdapter.notifyDataSetChanged();

                                    if (bean.getUploadPhotoes().size() > 1) {
                                        mGoodPhotosPromptView.setVisibility(GONE);
                                    }
                                }
                            }).openGallery();
sheep0704 commented 6 years ago

GET