Android 仿微信发动态九宫格拖拽、删除功能仿微信发动态九宫格拖拽、删除功能
主要介绍了Android 仿微信发动态九宫格拖拽、删除功能,非常不错,具有一定的参考借鉴价值,需要的朋友可以参考下
1、完美、完美1比比1 仿照微信仿微信发动态仿照微信仿微信发动态 九宫格拖拽、删除九宫格拖拽、删除
暴力拖拽ui有点问题,不影响使用,资源文件自己找个+号
2、微信发动态拖拽、微信发动态拖拽bug
当选择完图片,长按图片拖拽过程中按下屏幕home键盘,再次进入这时候就不能点击输入文字,点击输入文字的时候会触发选择相册事件
3、拖拽事件用的、拖拽事件用的basequickadapter
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation "com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50"
implementation "com.github.bumptech.glide:glide:4.9.0"
4、演示、演示
5、快速入手、快速入手
activity
NineGridChooseImage nineGridChooseImage = findViewById(R.id.nineGridChooseImage);
FrameLayout frameLayout= findViewById(R.id.frameLayout);
nineGridChooseImage.init(frameLayout);
int statusBarHeight = 0;
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
statusBarHeight = getResources().getDimensionPixelSize(resourceId);
}
nineGridChooseImage.setFixH(statusBarHeight);//自己对一下高度
nineGridChooseImage.setAddClick(new NineGridChooseImage.AddClick() {
@Override
public void onAdd() {
/* List<String> list = new LinkedList<>();
for(int i = 0;i<5;i++){
list.add("https://xx.jpg");
}*/
nineGridChooseImage.addData("https://xxx.jpg");
}
});
xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"