# Android-ZBLibrary **Repository Path**: xwcoding/Android-ZBLibrary ## Basic Information - **Project Name**: Android-ZBLibrary - **Description**: Android MVP 快速开发框架,做国内 「示例最全面」「注释最详细」「使用最简单」「代码最严谨」的 Android 开源 UI 框架 - **Primary Language**: Android - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 625 - **Created**: 2021-03-09 - **Last Updated**: 2021-03-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ZBLibrary-Android快速开发框架 [![](https://jitpack.io/v/TommyLemon/Android-ZBLibrary.svg)](https://jitpack.io/#TommyLemon/Android-ZBLibrary) [![Android](https://img.shields.io/badge/Android-4.0.3%2B-brightgreen.svg?style=flat)](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) [![Gradle Version](https://img.shields.io/badge/gradle-2.10%2B-green.svg)](https://docs.gradle.org/current/release-notes) [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) MVP 架构,提供一套开发标准(View, Data, Event)以及模板和工具类并规范代码。封装层级少,简单高效兼容性好。 OKHttp 网络请求、Glide 图片加载、ZXing 二维码、沉浸状态栏、下载安装、自动缓存以及各种 Base、Demo、UI、Util 直接用。 全新的手势,侧滑返回、全局右滑返回都 OUT 啦! 用 [BaseView](https://github.com/TommyLemon/Android-ZBLibrary/blob/master/ZBLibrary/src/main/java/zuo/biao/library/base/BaseView.java),自定义 View 竟然如此简单; 用 [Entry](https://github.com/TommyLemon/Android-ZBLibrary/blob/master/ZBLibrary/src/main/java/zuo/biao/library/model/Entry.java),两个变量的 Model/JavaBean 再也不用写了; 用 [BaseHttpListActivity](https://github.com/TommyLemon/Android-ZBLibrary/blob/master/ZBLibrary/src/main/java/zuo/biao/library/base/BaseHttpListActivity.java),几行代码搞定 HTTP 请求列表 加载和缓存; 还有 100 多个常用 [Style](https://github.com/TommyLemon/Android-ZBLibrary/blob/master/ZBLibrary/src/main/res/values/styles.xml),一行搞定 View 属性,一键统一配置UI... 点击右边链接查看如何使用 [http://my.oschina.net/u/2437072/blog/665241](http://my.oschina.net/u/2437072/blog/665241) ![](https://raw.githubusercontent.com/TommyLemon/StaticResources/master/ZBLibrary_AllPages.jpg) [以下 Gif 图看起来比较卡,实际在手机上 App 运行很流畅] ZBLibraryDemoApp
![](https://raw.githubusercontent.com/TommyLemon/StaticResources/master/ZBLibrary_Cache.gif) ![](https://raw.githubusercontent.com/TommyLemon/StaticResources/master/ZBLibrary_PlacePicker.gif) ![](https://raw.githubusercontent.com/TommyLemon/StaticResources/master/ZBLibrary_DatePicker.gif)
APIJSONApp
![](https://raw.githubusercontent.com/TommyLemon/StaticResources/master/APIJSON_App_MomentList_Circle.gif) ![](https://raw.githubusercontent.com/TommyLemon/StaticResources/master/APIJSON_App_Moment_Name.gif) ![](https://raw.githubusercontent.com/TommyLemon/StaticResources/master/APIJSON_App_Moment_Comment.gif) ### 下载试用 [ZBLibraryDemoApp.apk(ZBLibrary)](http://files.cnblogs.com/files/tommylemon/ZBLibraryDemoApp.apk) [APIJSONApp.apk(APIJSON+ZBLibrary)](http://files.cnblogs.com/files/tommylemon/APIJSONApp.apk) ### 感谢开源 [Glide](https://github.com/bumptech/glide) Google 官方推荐的一个强大易用的图片加载库。 [OKHttp](https://github.com/square/okhttp) 很火很强大的 HTTP/HTTPS 传输框架。ZBLibrary 中的 HttpManager 对它做了封装(支持自签名Https),Demo 中的 HttpRequest 是使用示例。 注:okio.jar 是 OKHttp 的一部分,不能删除。删除后不会在代码中报错,但运行会出错。 [FastJson](https://github.com/alibaba/fastjson) 阿里巴巴的 JSON 封装和解析库。ZBLibrary 中的 JSON 是对 fastjson 的简单封装,防止解析异常。 [SmartRefreshLayout](https://github.com/scwang90/SmartRefreshLayout) 下拉刷新、上拉加载的组件库,已在 [BaseHttpRecyclerActivity](https://github.com/TommyLemon/Android-ZBLibrary/blob/master/ZBLibrary/src/main/java/zuo/biao/library/base/BaseHttpRecyclerActivity.java) 等类内置支持。 [SystemBarTint](https://github.com/jgilfelt/SystemBarTint) 系统栏管理器,我把它用在 ZBLibrary 的 BaseActivity 中实现了状态栏沉浸。 [ZXingLib](https://github.com/xuyisheng/ZXingLib) 这是该作者对官方 ZXing 二维码库的精简版。我做了修改,作为 ZBLibrary 的 QRCodeLibrary。 ### 初始化 假设你工程中的 Application 为 zblibrary.demo.application.DemoApplication,并且已在 AndroidManifest.xml 中注册 ``` ``` 可以用 DemoApplication 继承 BaseApplication ``` public class DemoApplication extends BaseApplication { ... } ``` 或 在 DemoApplication 的 onCreate 函数 中调用 BaseApplication.init(this); ``` public class DemoApplication extends Application { @Override public void onCreate() { super.onCreate(); BaseApplication.init(this); } ... } ``` 注册 权限和 Activity 等代码可复制 ZBLibrary 中 AndroidManifest.xml 里的 \, \ 等相关代码。 ### 生成代码 可使用 APIAuto 自动化接口管理工具来生成接口相关代码: * 自动生成封装请求 JSON 的代码 * 自动生成解析结果 JSON 的代码 * 自动生成 Modle/JavaBean [https://github.com/TommyLemon/APIAuto](https://github.com/TommyLemon/APIAuto) ### 编程思想 * 能复制就复制,节约时间避免出错 * 保留原本结构,简单上手容易调试 * 增加必要注释,说明功能和使用方法 * 说明随手可得,不用上网或打开文档 * 命名必须规范,容易查找一看就懂 * 重载尽量转发,减少代码容易修改 * 最先校验参数,任意调用不会崩溃 * 代码模块分区,方便浏览容易查找 * 封装常用代码,方便使用降低耦合 * 回收多余占用,优化内存提高性能 * 分包结构合理,模块清晰浏览方便 * 多用工具和快捷键,增删改查快捷高效 ### 相关推荐 [Android快速开发框架-ZBLibrary介绍](http://my.oschina.net/u/2437072/blog/662017) [如何使用ZBLibrary-Android快速开发框架](http://my.oschina.net/u/2437072/blog/665241) [仿QQ空间和微信朋友圈,高解耦高复用高灵活](https://my.oschina.net/tommylemon/blog/885787) [全新的手势,侧滑返回、全局右滑返回都OUT啦!](http://www.cnblogs.com/tommylemon/p/5576337.html) [不一样的Android选择器,简单方便,地址日期时间都好用!](https://my.oschina.net/u/2437072/blog/756271) [自定义ZXing二维码扫描界面并解决取景框拉伸等问题](http://my.oschina.net/u/2437072/blog/687986) [零门槛!ZBLibrary仿微信朋友圈自定义View,就是这么简单!](http://my.oschina.net/u/2437072/blog/666625) [BaseHttpListActivity,几行代码搞定Http列表请求、加载和缓存](http://my.oschina.net/u/2437072/blog/726229) [ListView滑动不爽,滚动一页得滑几次?该用分页列表啦!](http://my.oschina.net/u/2437072/blog/700674) [高灵活低耦合Adapter快速开发攻略](http://my.oschina.net/u/2437072/blog/701165) [万能的Entry,两个变量的Model/JavaBean再也不用写了!](http://my.oschina.net/u/2437072/blog/671895) [Android HTTPS如何10分钟实现自签名SSL证书](http://my.oschina.net/u/2437072/blog/669041) [100多个Styles快速开发布局XML,一行搞定View属性,一键统一配置UI...](http://my.oschina.net/u/2437072/blog/716573) ### 开发规范 [Wiki-Norm](https://github.com/TommyLemon/Android-ZBLibrary/wiki/%E5%BC%80%E5%8F%91%E8%A7%84%E8%8C%83) ### 架构、模式、技术 [Wiki-Architecture,Pattern,Technology](https://github.com/TommyLemon/Android-ZBLibrary/wiki/%E6%9E%B6%E6%9E%84%E3%80%81%E6%A8%A1%E5%BC%8F%E3%80%81%E6%8A%80%E6%9C%AF) ### 问题及解决方法 [Wiki-FAQ](https://github.com/TommyLemon/Android-ZBLibrary/wiki/%E9%97%AE%E9%A2%98%E5%8F%8A%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95) ### 使用登记

[您在使用 ZBLibrary 吗?](https://github.com/TommyLemon/Android-ZBLibrary/issues/18) ### 关于作者

感谢其它作者的贡献。 #### QQ技术交流群 1050166440(新)ZBLibrary3 421793905(满) ZBLibrary2 595514898(满)ZBLibrary1 如果有什么问题或建议可以 [提 ISSUE ](https://github.com/TommyLemon/Android-ZBLibrary/issues) 或 加群,交流技术,分享经验。
如果你解决了某些 Bug,或者新增了一些功能,欢迎 [贡献代码](https://github.com/TommyLemon/Android-ZBLibrary/pulls),感激不尽^_^ ### 其它项目 [APIJSON](https://github.com/TommyLemon/APIJSON) 后端接口和文档自动化,前端(客户端) 定制返回 JSON 的数据和结构 [APIAuto](https://github.com/TommyLemon/APIAuto) 机器学习测试、自动生成代码、自动静态检查、自动生成文档与注释等,做最先进的接口管理工具 [UnitAuto](https://github.com/TommyLemon/UnitAuto) 机器学习自动化单元测试平台,零代码、全方位、自动化 测试 方法/函数 的正确性和可用性 [APIJSON-Android-RxJava](https://github.com/TommyLemon/APIJSON-Android-RxJava) ZBLibrary(UI) + APIJSON(HTTP) + RxJava(Data) [AbsGrade](https://github.com/APIJSON/AbsGrade) 列表级联算法,支持微信朋友圈单层评论、QQ空间双层评论、百度网盘多层(无限层)文件夹等 [PagedListView](https://github.com/TommyLemon/PagedListView) 分页滑动列表工具,优化 ListView/GridView 的滑动和滚动体验 ### 持续更新 [https://github.com/TommyLemon/Android-ZBLibrary/commits/master](https://github.com/TommyLemon/Android-ZBLibrary/commits/master) ### 我要赞赏 创作不易,右上角点 ⭐Star 支持下吧,谢谢 ^_^
[https://github.com/TommyLemon/Android-ZBLibrary](https://github.com/TommyLemon/Android-ZBLibrary)