工程包括common、library、app三个module,启动common、library为android moudle基础类库。app为项目的主工程目录。
- common是基础类库,提供工具、服务、自定义控件、网络请求封装等基础服务。任何项目可直接依赖。移植时内容基本保持不变。
- library依赖common,是根据当前项目普遍需要所封装或提供的一些基础的功能,会根据不同项目进行轻微调整。
- app为项目的主工程目录,主要用于业务实现。
- compile 'com.jakewharton:butterknife:8.5.1' Butterknife注入框架
- compile 'com.yanzhenjie:permission:1.1.0' AndPermission权限框架
- compile 'com.liwy.easyhttp:easyhttp:1.0.8' EasyHttp 网络请求框架
- compile 'com.orhanobut:logger:1.15' Logger 日志框架
- compile 'org.greenrobot:eventbus:3.0.0' EventBus 事件总线
- compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.27' 万能RecyclerView Adapter
- testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5' 内存泄漏检测框架
- compile 'io.reactivex.rxjava2:rxjava:2.1.3' Rxjava
- Utils工具类
ActivityUtils 页面管理工具类
DateUtils 时间工具类
FileUtils 文件工具类
PhoneUtils 手机信息工具类
ScreenUtils 尺寸单位计算工具类
ToastUtils toast工具类
*BaseUtils 基础工具类,需提前初始化。
- 自定义控件
Indicator导航栏+底部菜单栏
- Base基类
- MVP模式基类
在app目录下有library专用.rar的文件,解压文件。
- 将MVPActivity2放至:C:\Program Files\Android\Android Studio\plugins\android\lib\templates\activities
- 将MVPFragment2放至:C:\Program Files\Android\Android Studio\plugins\android\lib\templates\other 放至对应的androidstudio安装目录里。
- 采用JDK1.8编译,支持lambda表达式
- 原网络请求模式retrofit+okhttp改为EasyHttp
- 取消MVP模式中presenter对activity或fragment的代理功能,优化模板及创建方式。
- 原RxBus更改为EventBus
- 列表控件采用RecycleView + BaseRecyclerViewAdapterHelper进行拓展实现
- 项目里用的第三方库均在github