DevUtils
Android開發(fā)工具類,常用的文件操作,bitmap操作,數(shù)據(jù)庫操作,Toast顯示,Dialog,反射、大圖查看、權(quán)限管理等
如何使用:
implementation 'com.jzw.dev:devutils:3.3'
Androidx支持
implementation 'com.jzw.dev:devutils:4.0'
- 支持數(shù)據(jù)庫操作,繼承BaseDao,實現(xiàn)對應(yīng)的方法即可
- Bitmap相關(guān)操作,使用BitmapUtil
- 文件相關(guān)操作,使用FileUtil
- APP 緩存管理,使用DataCleanManager
- 顯示圖片,使用GlideUtils
- 權(quán)限操作,使用PermissionUtil
- SharedPreference操作使用SharedPrefUtils類
- Toast顯示使用ToastUtil
- 簡單的dialog顯示,使用DialogUtil
- 日期和時間有CalendarUtil,DateUtil
- 反射操作 ReflectUtil
- 漢字拼音轉(zhuǎn)換類 Trans2PinYinUtil FirstLetterUtil
- 下拉刷新控件 JSwipeRefreshLayout
- 地理位置信息轉(zhuǎn)換 LocationUtil
- 支持方京東地址選擇view
- 支持縮放的 PhotoView
- 支持Androidx
大圖查看器
1、查看網(wǎng)絡(luò)圖片,帶有下載功能
PictureView.with(this)
.setUrls(urls, 0)
.enableDownload(true)
.create();
2、開啟關(guān)閉 刪除 和下載功能
PictureView.enableDelete(true)
PictureView.enableDownload(true)
仿京東多級列表選擇器
1、設(shè)置容器view
content = findViewById(R.id.content);
2、初始化數(shù)據(jù)
具體的實體實現(xiàn)ISelectorEntry接口,并實現(xiàn)對應(yīng)方法
public class DicTestInfo implements ISelectorEntry<DicTestInfo> {
private String id;
private String value;
private String type;
private String orgName;
private List<DicTestInfo> list;
@Override
public String getSelectorName() {
return getValue();
}
@Override
public String getSelectorId() {
return getId();
}
@Override
public List<DicTestInfo> getSelectorChildreen() {
return getList();
}
}
3、初始化選擇器
SelectorProvider provider = new SelectorProvider(this, 3);
provider.setData(list);
//其他設(shè)置的方法省略
provider.setOnSelectListener(new SelectorProvider.OnSelectorListener() {
@Override
public void onSelected(List<ISelectorEntry> datas) {
DicTestInfo dic5 = (DicTestInfo) datas.get(0);
}
});
provider.setOnDialogCloseListener(new SelectorProvider.OnDialogCloseListener() {
@Override
public void dialogclose() {
//關(guān)閉回調(diào)
}
});
4、添加選擇器到viewGroup
View view = provider.getSelectorView();
content.addView(view, 0);
想體驗MVP + MVVM開發(fā)的點這里
https://blog.csdn.net/qq_19979101/article/details/105989200
http://www.itdecent.cn/p/f52a5fce6a4e
一個包含拍照 錄制 高度定制的多媒體庫
https://github.com/jingzhanwu/MediaLibrary
Retrofit+Rxjava的一個請求庫
https://github.com/jingzhanwu/RetrofitRxjavaClient