使用前请务必通读此篇README文档
git clone https://github.com/Taonce/MVVM-T
剥离出mvvm模块即可,可以根据自己的需求剔除无关封装类和工具类,以此来缩减此Module的体积
以Module的形式依赖到自己的项目中,同时在项目的build.gradle中添加以下代码
android {
viewBinding {
enabled = true
}
}
MainActivity类中包含了许多示例,阅读之后可轻松掌握项目的精髓!
- BaseActivity
- BaseFragment
- BaseDialogFragment
- BasePopupWindow
- BaseRecyclerViewAdapter
- BaseFragmentPagerAdapter
- BaseListActivity
- BaseListFragment
- BaseDiffUtil
@Deprecated
RecyclerView
的点击事件和长按事件,新增监听滑动到底部的事件,可用于滑到底部自动加载EditText
的文本改变事件WebView
的加载url
事件ViewPager
的transform
属性ImageView
的ImageUrl
属性
- Retrofit中设置下
BASE_URL
- 请求推荐使用协程:
safeLaunch(Dispatchers.IO) { RetrofitManager.getApi.xxx() }
CoroutineUtils
:统一处理协程中抛出的异常,增加了多种协程调用DensityUtils
:屏幕相关DialogUtils
:弹框FileUtils
:文件IntentUtils
:界面跳转LogUtils
:日志,增加类名,行数等信息打印NetUtils
:手机网络PackageUtils
:apk信息PhoneUtils
:手机信息SpUtils
:SPStringUtils
:字符串ToastUtils
:吐司