前言
随着使用AndroidX,哪些我常用的库有些已经不能用了,所以就重新记录以下AndroidX下常用的库。
Android官方
1  | implementation 'androidx.appcompat:appcompat:1.1.0'  | 
我的常用组件
Kotlin
Kotlin & anko
project - build.gradle
1  | buildscript {  | 
app - build.gradle
1  | apply plugin: 'kotlin-android'  | 
UI
下拉刷新
1  | implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0'  | 
UI框架
QMUI https://qmuiteam.com/android
1  | implementation 'com.qmuiteam:qmui:2.0.0-alpha10'  | 
图片圆角&背景圆角
图片圆角RoundedImageView 
背景圆角FlycoRoundView
1  | //图片圆角  | 
消息提示
1  | implementation 'com.github.GrenderG:Toasty:1.2.8'  | 
初始化样式
1  | private fun initToast() {  | 
弹出窗口
1  | implementation 'com.afollestad.material-dialogs:core:0.9.6.0'  | 
 设置主题
1  | MaterialDialog.Builder(this)  | 
不设置主题的话,在不同的系统下有的是亮色有的是暗色
设置自定义View
1  | dialog = MaterialDialog.Builder(this)  | 
Banner
Github:https://github.com/youth5201314/banner
1  | implementation 'com.youth.banner:banner:2.0.11'  | 
1  | //Banner  | 
仿iOS Segment
1  | implementation 'com.7heaven.widgets:segmentcontrol:1.17'  | 
加载HTML的TextView
1  | dependencies {  | 
视频播放器
DKPlayer
1  | //# 必选,内部默认使用系统mediaplayer进行解码  | 
功能
权限
https://github.com/yanzhenjie/AndPermission
1  | implementation 'com.yanzhenjie:permission:2.0.3'  | 
Adapter
1  | implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4'  | 
网络请求
Retrofit+RX
1  | //网络请求  | 
OkGo+FastJson
- 
1
2
3
4
5//网络请求
implementation 'com.lzy.net:okgo:3.0.4'
implementation 'com.lzy.net:okrx2:2.0.2'
//JSON
implementation 'com.alibaba:fastjson:1.2.46' 
数据库
1  | 引用Jar包  | 
事件总线
1  | implementation 'org.greenrobot:eventbus:3.1.1'  | 
图片加载
Glide
1  | //Glide  | 
Gif加载
1  | implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.+'  | 
事件视图绑定
1  | implementation 'com.jakewharton:butterknife:8.8.1'  | 
  如果编程语言为Kotlin, 替换 annotationProcessor 为 kapt
Kotlin项目不建议再使用
1  | implementation "org.jetbrains.anko:anko:$anko_version"  | 
可以使用Anko代替
应用崩溃检测服务
1  | implementation 'com.tencent.bugly:crashreport_upgrade:1.4.5'  |