# sanduAndroid **Repository Path**: caicai13/sanduAndroid ## Basic Information - **Project Name**: sanduAndroid - **Description**: sanduAndroid框架 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2024-11-01 - **Last Updated**: 2025-01-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # sanduAndroid ![软件架构](https://gitee.com/caicai13/sanduAndroid/raw/master/screenshot/screen1.png "gitee.png") #### 介绍 mirror框架 #### 软件架构 软件架构说明 1. 语言kotlin、java 2. 架构模式MVVM 3. 视图绑定viewBinding 数据绑定dataBinding 都支持 4. kotlin版本为1.9.10 对应的compose版本为1.5.3 https://developer.android.google.cn/jetpack/androidx/releases/compose-compiler?hl=en#1.5.10 #### 模块说明 1. lib_opensource 外部依赖库,几乎全部依赖走这里 2. lib_ui 三度组件库,除了material组件之外的,自定义组件库,自定义组件原则是复用性强,基本属性少,扩展属性多。 3. lib_network 基础网络库,这里只有网络库的基础,仓库以及自定义的interceptor,每个app自己注入。 4. lib_common 基础库,包括Base,Entities,Utils等 5. module_***为业务单元BU 6. module_mall为商城中心 7. module_product为商品中心 8. module_user为用户中心 9. module_wardrobe为衣橱 10. module_analyses为AI数据分析中心 11. voice_assistant为语音助手APP,语音助手独立存在,各个app应用通过binder方式调用语音服务并接收回调。具体使用方式见voice_assistant README。 12. mirror_family为家用端App 13. mirror_business为商用端App 14. lib_mvvm为基于jetpack的mvvm架构 #### 安装教程 1. gradle 8.7 2. gradle-plugin 8.6.0 3. JDK JBR17.0.11 #### 使用说明 1. module支持单独调试。将gradle.properties的isModule=false,即可开启单独调试模式。 2. 路由跳转采用ARouter方式,通过反射的方式访问对用的类。 3. xxxx ##### 切换baseUrl, 注意切换之后业务结束的时候或者恢复正常业务之前 将地址复位 ApiService.SERVER_URL = "https://wanandroid.com/" NetworkApi.INSTANCE.resetApi() ##### 状态栏 ImmersionBar 1. 统一在BaseVmActivity设置沉浸式状态栏,支持状态栏,底部导航隐藏与显示 2. 在不需要沉浸的地方覆写状态栏设置,同时设置状态栏颜色,修改xml顶层布局 android:fitsSystemWindows=" true" 才会有效。 ### 开发 1. Fork 本仓库 2. 新建 Feat_xxx 本地分支,推送(新建)同名远程分支 3. 提交代码 4. 合并代码-处理冲突 5. 请勿直接提交dev,test,master分支 ### 分支说明 1. master分支 版本号,版本Tag,节点或者迭代分支 2. test 分支,提测分支 3. dev分支,开发合并自测分支, 4. feat_***或者dev_*** 本人开发分支,请及时反合dev分支 5. 开发人员请勿直接在test,dev,master修改代码,提交代码请复查代码改动文件,禁止将无关文件(build,idea配置等)提交。 ### `git 代码提交规范 添加ignore后,部分修改的文件仍然提示跟踪,需要从缓存中清除这些文件id git rm -f --cached chore:杂物 日常事务 更新文档、调整代码格式、优化构建过程 feat:添加新功能 fix:修复问题 docs:更新文档 style:修改样式文件 refactor:重构代码 (即不是新增功能,也不是修改bug的代码变动) test:增加单元测试或者测试代码 revert: 撤销,版本回退 perf: (performance optimization)性能优化 improvement: 改进 build: 打包 ci: (continuous integration)持续集成 delete:删除功能或文件 modify:修改功能 #### 特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) #### 优秀的第三方框架 1. loadSir https://github.com/KingJA/LoadSir 扩展性良好的加载反馈页管理框架 2. mmkv https://github.com/Tencent/MMKV MMKV 是基于 mmap 内存映射的 key-value 组件,底层序列化/反序列化使用 protobuf 实现,性能高,稳定性强 3. BannerViewPager https://github.com/zhpanvip/BannerViewPager 4. BaseAdapter https://github.com/CymChad/BaseRecyclerViewAdapterHelper 5. customactivityoncrash https://github.com/Ereza/CustomActivityOnCrash 防崩溃 6. autoSize https://github.com/JessYanCoding/AndroidAutoSize 今日头条屏幕适配方案 web页面会有异常 看issue 7. ARouter 阿里路由框架 https://github.com/alibaba/ARouter 8. 状态栏 https://github.com/gyf-dev/ImmersionBar 9. SmartRefreshLayout 上拉加载 下拉刷新 https://github.com/scwang90/SmartRefreshLayout #### 问题说明 处理流程 1. 已完成 模块内frament 通过nav 切换 2. 已完成 tab页面通过应用传递进行切换 nav fragment activity 3. 已完成 tab页面内部单容器 从容器可以直接跳转到某一个fragment,不会有视觉差异,module之间的fragment跳转可以直接从容器到容器实现 4. 已完成 tab页面容器内层页面切换 ARouter跳转,传参都没有问题 5. 已完成 网络兼容性处理 6. 已完成 屏幕适配处理 刘海屏适配 折叠屏适配 7. 已完成 状态栏,标题栏 8. 未完成 ui组件库完善 9. 已完成 ViewModel处理 状态管理器增加 10. 已完成 加载反馈,上拉下滑处理 https://github.com/CymChad/BaseRecyclerViewAdapterHelper/wiki 推荐4.*版本 11. 已完成状态栏 https://github.com/gyf-dev/ImmersionBar 12. webView https://github.com/Justson/AgentWeb ### 命名规范 1. 产品名称 名称_端侧 示例: mirror_family 2. lib名称 lib_功能 示例:lib_ui 3. 包名 com.sandu.module_功能<模块> 4. Activity 名称 <功能>Activity 示例:ErrorActivity 5. Fragment 名称 <功能>Fragment 示例:ErrorFragment 6. ViewModel 名称 <功能>ViewModel 示例:MainViewModel 7. Adapter 名称 <功能>Adapter 示例:MainBannerAdapter 8. Bean 名称 <功能>Response(Request) 9. util 工具类名称 <功能>utils 10. 自定义组件 <功能>View 11. 资源文件命名 资源文件要加module或者app名称 12. drawable _ic_描述 图标、 _bg_描述 背景、 _img_描述 图片 示例 :mall_ic_launcher 13. xml 名称 _fragment_描述 _activity_描述 _item_描述 _类别_描述 14. color 名称 示例 #FF018786 15. strings名称 示例 OK ### AIDL 发送语音消息 1. 跨应用启动service,11 之后有改动。必须增加 才会生效。 ### Material组件 https://m3.material.io/components | 编号 | 组件名称 | component name | 描述 | 来源地址 | | 1 | 底部bar | Bottom app bar | Top app bars display navigation, actions, and text at the top of a screen | https://m3.material.io/components/bottom-app-bar/overview | | 2 | 顶部bar | Top app bars | Bottom app bars display navigation and key actions at the bottom of mobile and tablet screens | | | 3 | 角标 | Badges | Badges show notifications, counts, or status information on navigation items and icons | | | 4 | 按钮 | All buttons | Buttons let people take action and make choices with one tap | | | 5 | 按钮 | Common Buttons | Buttons prompt most actions in a UI | | | 6 | 悬浮按钮 | Floating action buttons | Floating action buttons (FABs) help people take primary actions | | | 7 | 拓展悬浮按钮 | Extended FAB | Extended floating action buttons (extended FABs) help people take primary actions | | | 8 | 带图标的按钮 | Icon buttons | Icon buttons help people take minor actions with one tap | | | 9 | 分割按钮 | Segmented buttons | Segmented buttons help people select options, switch views, or sort elements | | | 10 | 卡片 | Cards | Cards display content and actions about a single subject | | | 11 | 轮播 | Carouse | Carousels show a collection of items that can be scrolled on and off the screen | | | 12 | 多选框 | Checkbox | Checkboxes let users select one or more items from a list, or turn an item on or off | | | 13 | 标签 | Chips | Chips help people enter information, make selections, filter content, or trigger actions | | | 14 | 日期选择器 | Date pickers | Date pickers let people select a date, or a range of dates | | | 15 | 弹窗 | Dialogs | Dialogs provide important prompts in a user flow | | | 16 | 分割线 | Divider | Dividers are thin lines that group content in lists or other containers | | | 17 | 列表 | Lists | Lists are continuous, vertical indexes of text and images | | | 18 | 菜单 | Menus | Menus display a list of choices on a temporary surface | | | 19 | 导航条 | Navigation bar | Navigation bars let people switch between UI views on smaller devices | | | 20 | 导航抽屉 | Navigation drawer | Navigation drawers let people switch between UI views on larger devices | | | 21 | 导航轨 | Navigation rail | Navigation rails let people switch between UI views on mid-sized devices | | | 22 | 进度指示器 | Progress indicators | Progress indicators show the status of a process in real time | | | 23 | 单选按钮 | Radio button | Radio buttons let people select one option from a set of options | | | 24 | 搜索框 | Search | Search lets people enter a keyword or phrase to get relevant information | | | 25 | 底部表 | Bottom sheets | Bottom sheets show secondary content anchored to the bottom of the screen | | | 26 | 侧边表 | Side sheets | Side sheets show secondary content anchored to the side of the screen | | | 27 | 滑块 | Sliders | Sliders let users make selections from a range of values | | | 28 | 应用内消息类 | SnackBar | Snackbars show short updates about app processes at the bottom of the screen | | | 29 | 开关 | Switch | Switches toggle the selection of an item on or off | | | 30 | 标签 | Tabs | Tabs organize content across different screens and views | | | 31 | 输入框 | Text fields | Text fields let users enter text into a UI | | | 32 | 日期选择器 | Time pickers | Time pickers help users select and set a specific time | | | 33 | 提示 | Tooltips | Tooltips display brief labels or messages | | | | | | | | ### 过渡动画 1、fragment 之间的过渡 login_to_register 2、Activity 之间的过渡