项目
- app -
宿主 应用,组合个业务模块形成 应用 - framework - 项目
框 架 ,引用 各 种库并加入 第 三方依赖形成有业务倾向的框架 - libs - 项目业务
相 关或不 稳定的 的 一 些库- lib1
- lib2
- lib3
- modules - 项目业务
模 块,依 赖framework,各 个模块是互相隔 离无感知 的 - foo
- bar
- zoo
- repo - 项目仓库,
已 经成型 稳定- aar -
功 能 库,单一职责,应该在任 何 项目都 可 以单独 引入使用
- aar -
repositories {
maven { url "https://gitee.com/ezy/repo/raw/cosmo/"}
}
- init - https://github.com/czy1121/init
一 个 Kotlin + Flow 实现的 Android 应用初 始 化 启动库,通 过有向 无环图(DAG)来 调度应用初 始 化 任 务。 - router - https://github.com/czy1121/router
一 个 kotlin + ksp 实现的 路 由 库,通 过 uri 实现页面间跳转 - servicelocator - https://github.com/czy1121/servicelocator
一个简单的服务定位器模式实现,如果觉得Dagger/Koin太 重 ,可 以试试这个。 - flowbus - https://github.com/czy1121/flowbus
一个简单的事件总线实现(基 于SharedFlow) - httpapi - https://github.com/czy1121/httpapi
使用 Coroutine + Retrofit打 造 的 最 简单HTTP请求库,支持 kotlin.Result - base - https://github.com/czy1121/base
页面基 类 BaseActivity/BaseFragment 统一了子类初始化UI(onSetupUI)的 位置 - binding - https://github.com/czy1121/binding
简化 DataBinding/ViewBinding使用 ,提供 生命 周期 感知 能力 ,支持 多 种使用 环境(ComponentActivity/Fragment/CustomDialog/ViewGroup) - argument - https://github.com/czy1121/argument
通 过 Kotlin委 托 属性 获取 Activity/Fragment的 参 数 ,可 配合 router使用 - screenadapt - https://github.com/czy1121/screenadapt
低 成本 屏 幕 适配(今日 头条屏 幕 适配方案 ) - dialog - https://github.com/czy1121/dialog
- AlertDialog扩展(tip/alert/confirm/choose)
自 定 义对话框(CustomDialog) - BottomDialog/DropdownDialog/SideDialog- 一些简单的对话框 - LoadingDialog/InputDialog/ActionSheetDialog/PickerDialog
- loading - https://github.com/czy1121/loading
一 些 loading 动画 - statelayout - https://github.com/czy1121/statelayout
简单实用无侵入 高 扩展的 页面多 状 态布局 (content,loading,empty,error) - tabs - https://github.com/czy1121/tabs
简化 TabLayout使用 ,使用 TabItemView代替 TabLayout.TabView,支持 远程动态加 载图标 - bannerview - https://github.com/czy1121/bannerview
简单好 用 的 水平 轮播控 件 - pickerview - https://github.com/czy1121/pickerview
使用 RecyclerView 实现的 滚轮控 件 ,这个可 以显示 3个以上 元素 (系 统自带的 NumberPicker写 死 了 只 能 显示3个)。 - pullrefresh - https://github.com/czy1121/pullrefresh
实现了 嵌 套滚动机制 的 下 拉 刷新 控 件 。 - scrollinglayout - https://github.com/czy1121/scrollinglayout
垂直 方向 支持 多 个子视图持 续连贯滚动的容器 ,并且支持 吸顶功 能 。 - bk - https://github.com/czy1121/bk
BKDrawable/BKFrameLayout/BKLinearLayout/BKTextView可 自 定 义背景 色 /渐变/圆角/阴影/描边支持 背景 色 [正常 /选中/按下/禁 用 ]支持 渐变[类型/半径 /方向 /中心 点 XY坐 标(0.0~1.0)/颜色(开始-中心 -结束)]支持 圆角[半径 ,位置 ],根 据 宽高自 动计算 圆角半径 min(height,width) / 2支持 阴影[颜色/半径 /边距(容 纳阴影 的 空 间)]- 阴影颜色
默 认自动从背景 或 描边获取,也可以手动设置 - 阴影绘制
算法 取 自 ShadowRenderer
- 阴影颜色
支持 描边[颜色/厚 度 /虚 线长度 /虚 线间隙 ]- BKTextView
支持 图标[图标/尺寸 /边距/着色 /位置 ],类似 MaterialButton的 图标
- tv - https://github.com/czy1121/tv
一些实用的自定义TextView- CamelTextView -
可 额外设置两个文 本 (prefix/suffix),可用 于带单位的 数 值,比 如:¥123.0元 - ThreeTextView
可 额外设置两个文 本 (text2/text3),text2在 text底 下 ,text3在 右 边可 设置左右 两个图标(leftIcon/rightIcon)
- ExpandableTextView -
可 展 开收缩的的 文 本 ,点 击切换状态,右 下角 显示状 态图标(展 开/收 缩) - ReadMoreTextView -
可 展 开收缩的的 文 本 ,点 击切换状态,尾 部 显示状 态文本 (展 开/收 缩)
- CamelTextView -
- rv - https://github.com/czy1121/rv
RecyclerView 扩展:itemtype, loadmore, selection, decoration- rv-itemtype
基 于 ListAdapter内 置 支持 AsyncListDiffer支持 单类型 列 表 (SingleTypeAdapter)和 多 类型列 表 (ItemTypeAdapter)ItemType<Item, Holder>
表示 列 表 里 的 一 个类型 通 过 create 创建 Holder通 过 matches判断 是 否 与 数 据 (Item)关联通 过 bind将 关联的 数 据 (Item)呈 现到 Holder
- ItemSubtype
支持 一个数据类型对应多个子类型布局 内 置 的 ViewItemType可 以方便 地 将 自 定 义视图(View)与 数 据 (Item)关联组成一 个ItemType内 置 的 LayoutItemType可 以方便 地 将 布 局 (layoutResId)与 数 据 (Item)关联组成一 个ItemType内 置 的 bindingType函数 封 装 了 LayoutItemType 以支持 DataBinding
- rv-loadmore,
支持 加 载更多 的 多 类型列 表 (LoadMoreAdapter)在 rv-itemtype, statelayout的 基 础上实现了 加 载更多 支持 显示多 种状态: loading, offline, empty, hasMore, ended, error- 开始
加 载:有 网(loading), 无网(offline) 完成 加 载:无数据 (empty)完成 加 载/加 载下一 页:有数 据 有 下 一 页(hasMore),有数 据 无下一 页(ended)加 载下一 页:出 错(error)
- 开始
- rv-selection,
基 于 recyclerview-selection, ListAdapter和 StringKey的 单选/多 选库- selectionTracker 构造
一 个 SelectionTracker - SelectionViewModel
保存 了 当 前 的 选择状 态
- selectionTracker 构造
- rv-decoration
- DividerDecoration 为列
表 项之间添加 分 隔 线 - SpaceDecoration 为列
表 项之间添加 空白
- DividerDecoration 为列
- rv-itemtype
- deviceid - https://github.com/czy1121/deviceid
获取设备标识(widevineId/instanceId/androidId/oaid),采 集 设备信 息 。 - systembars - https://github.com/czy1121/systembars
系 统栏工具 库 -状 态栏/导航栏/沉浸式 - cipher - https://github.com/czy1121/
工具 类:digest/encoding/hmac/rsa/aes - mmkv - https://github.com/czy1121/mmkv
使用 kotlin委 托 属性 封 装 的 mmkv 库,代替 SharedPreferences,简单好 用 - html - https://github.com/czy1121/html
兼 容 (HTML to Spanned) 7.0(API 24)新 增 的 一些标签和样式,可 以通过自定 义 ElementHandler方便 地 实现自 定 义标签。 - networkstate - https://github.com/czy1121/networkstate
判断 网络是 否 可用 ,判断 网络(wifi/mobile/vpn)是 否 连接,获取网络类型,监听网络可用 事件 。 - utility - https://github.com/czy1121/utility
各 种工具 函数 :context,toast,dimen,file,format,random...
- webcache - https://github.com/czy1121/webcache
Android WebView 缓存管理 ,提 升 网页打 开速度 。 - jsbridge - https://github.com/czy1121/jsbridge
简单易 用 的 Android WebView和 Javascript交互 框 架 。 - update - https://github.com/czy1121/update
清 晰灵活 简单易 用 的 应用更新 库
- ThemeDemo - https://github.com/czy1121/ThemeDemo
Databinding+LiveData轻松实现无重启换肤