在Android开发当中使用正确的依赖库可以达到快速开发,减少开发成本,这里记录一下本人开发当中常用的依赖库。
组件视图绑定依赖——ButterKnife(强烈推荐)
ButterKnife是一个专注于Android系统的View注入框架,以前总是要写很多findViewById来找到View对象,有了ButterKnife可以很轻松的省去这些步骤。
添加依赖
implementation 'com.jakewharton:butterknife:10.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
GitHub地址:https://github.com/JakeWharton/butterknife
万能适配器——BaseRecyclerViewAdapterHelper(强烈推荐)
一款强大的适配器,优化Adapter,使用它可以减少70%的代码
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.34'
GitHub地址:https://github.com/CymChad/BaseRecyclerViewAdapterHelper
图片加载框架——Glide(强烈推荐)
一行代码解决图片加载
implementation 'com.github.bumptech.glide:glide:4.9.0'
GitHub地址:https://github.com/bumptech/glide
事件通知——Eventbus
在App内部实现事件通知(类似于广播)
implementation 'org.greenrobot:eventbus:3.1.1'
GitHub地址:https://github.com/greenrobot/EventBus
沉浸式——Immersionbar
可Activity、Fragment进行状态栏隐藏,使界面更加美化
implementation 'com.gyf.immersionbar:immersionbar:3.0.0-beta05'
GitHub地址:https://github.com/gyf-dev/ImmersionBar
网络请求——RxHttp
链式请求,几行代码即可完成一个请求操作
implementation 'com.rxjava.rxhttp:rxhttp:1.1.5'
annotationProcessor 'com.rxjava.rxhttp:rxhttp-compiler:1.1.5'
GitHub地址:https://github.com/liujingxing/RxHttp
下拉刷新、上拉加载——Smartrefresh
结合RecyclerView使用,超好用的下拉刷新、上拉加载
implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-andx-16'
implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0-andx-16'
GitHub地址:https://github.com/scwang90/SmartRefreshLayout
以上是几个非常好用的框架,有其他好用的框架欢迎在评论区留言,我再进行整理,谢谢大家啦!