ImagePicker
ImagePicker copied to clipboard
关于有些同学遇到查看完图片点击返回列表没有数据问题,我这边给出解决办法,还有是IndexOutOf下标越界问题
ImageDataSource类里面加上if (data.getCount() > 0 && allImages.size() > 0)判断 列表没有数据问题把while(data.moveToNext)判断改为 if (data != null && data.moveToFirst()){ do{ ........... }while(data.moveToNext); }
每次返回后间距变宽解决办法: ImageGridActivity.onImagesLoaded() 方法中的 `mRecyclerAdapter.setOnImageItemClickListener(this);
mRecyclerView.setLayoutManager(new GridLayoutManager(this, 3));
mRecyclerView.addItemDecoration(new GridSpacingItemDecoration(3, Utils.dp2px(this, 2), false));
mRecyclerView.setAdapter(mRecyclerAdapter);`
移至onCreate() 中,adapter初始化后面就行
该给你一朵小红花
index问题可以引用这个库,我发布了一下,顺便改了这个bug
implementation 'com.github.Jimmuy:ImagePicker:v1.0.3'
0.6.1吧