AriesHoo / FastLib

一个Android项目级快速开发框架,节约大部分写常用功能时间以实现更多项目业务功能及体验上的优化。使用说明见wiki
https://github.com/AriesHoo/FastLib/wiki
Apache License 2.0
492 stars 95 forks source link
android fast fragment library swipeback

FastLib-一个快捷实现UI搭建及网络请求的Android开发库


因Github图片解析异常可使用Gitee备用仓库查看

简介:

FastLib 是一个整合了常用主流开源项目的 Android 快速搭建UI库, 其中包含 RetrofitRxJavaRxAndroidRxLifecycle等三方库, 并且提供较多的基础ActivityFragment如快速搭建微信类tab+fragmentFastMainActivity、快速搭建包含TitleBar的FastTitleActivityFastTitleFragment、快速搭建列表刷新的FastRefreshLoadActivityFastRefreshLoadFragment;并提供快速配置Retrofit相关功能的FastRetrofit:解决添加统一请求header多url等常见功能。

FastLib 只是一个快速搭建UI及网络请求的库,是常用三方库的一个封装集合,本身不具备框架特性。可在此基础上做MVP、MVVM等框架的扩展

wiki 基于FastLib 2.2.12Android Studio 3.3.1Gradle 4.10.1版本编写,后期重大变更会同步更新。

Demo中使用到的网络请求api来源于readhub 版权及最终解释权归readhub所有,如有侵权请联系删除!

Stargazers over time

主要功能

其它功能请在demo中发现,详细使用请看wiki

Download-蒲公英(安装密码1)

Download-蒲公英

Download-github

关于混淆

1、2.2.13_beta12版本开始自带混淆规则,并且会自动导入,正常情况下无需手动导入。

2、2.2.13_beta12以下版本可参考proguard-rules.pro

关于模板项目template

伴随新版本 2.3.6 发布,项目增加一个模板项目 template 以完成基础配置,开发者可直接在此项目上进行开发方便。

重大更新日志 其它版本参看Release

录屏预览

折叠屏效果一览-无法直接预览点击查看效果

FastRefresh.gif

快速实现页面下拉刷新-全局控制及局部个性化-参考WebActivity、FastRefreshActivity、MineFragment

虚拟导航栏控制-参考AppImpl类 NavigationBarControl接口实现注释说明

模拟器软键盘控制

华为可隐藏软键盘控制

华为全面屏手势控制

DoraemonKit集成效果(一定要手动开启 悬浮窗权限 )-包括沉浸式及UI微调-无法直接显示点击可查看效果

Gradle集成-尽量使用正式版本

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}
dependencies {
      implementation 'com.github.AriesHoo:FastLib:x.y.z'
}

Maven集成

    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>
    <dependency>
        <groupId>com.github.AriesHoo</groupId>
        <artifactId>FastLib</artifactId>
        <version>x.y.z</version>
    </dependency>

Compile集成

implementation project(':fastLib')

包含第三方库

    compileSdkVersion = 28
    minSdkVersion = 19
    minLibSdkVersion = 15
    targetSdkVersion = 28
    supportVersion = "1.1.0"
    widgetVersion = "3.2.25"
    smartRefreshLayoutVersion = "2.0.3"
    BRVAHVersion = "3.0.4"
    agentwebVersion = "4.1.4"
    glideVersion = "4.12.0"
    butterknifeVersion = "10.2.3"
    versionCode = 249
    versionName = "2.4.0"
dependencies {
    compileOnly "com.google.android.material:material:".concat(supportVersion)
    compileOnly 'androidx.appcompat:appcompat:'.concat(supportVersion)
    compileOnly "androidx.recyclerview:recyclerview:".concat(supportVersion)
    //万能适配器
    compileOnly 'com.github.CymChad:BaseRecyclerViewAdapterHelper:'.concat(BRVAHVersion)
    //webView库
    compileOnly 'com.just.agentweb:agentweb:'.concat(agentwebVersion)
    //下拉刷新库
//    compileOnly 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-andx-14'
    compileOnly 'com.scwang.smart:refresh-layout-kernel:'.concat(smartRefreshLayoutVersion)
    //图片加载
    compileOnly 'com.github.bumptech.glide:glide:'.concat(glideVersion)
    //常用UI控件(TitleBarView、RadiusView等)
    api "com.github.AriesHoo.UIWidget:widget-core:".concat(widgetVersion)
    //快速Tab库
    compileOnly "com.github.AriesHoo.UIWidget:tab-layout:".concat(widgetVersion)
    //日志打印
    api 'com.orhanobut:logger:2.2.0'
    //注解
    api 'com.jakewharton:butterknife:'.concat(butterknifeVersion)
    //retrofit+rxjava 网络请求及数据解析相关
    api "io.reactivex.rxjava2:rxjava:2.2.20"
    api 'io.reactivex.rxjava2:rxandroid:2.1.1'
    api 'com.squareup.retrofit2:retrofit:2.9.0'
    api 'com.squareup.retrofit2:converter-gson:2.9.0'
    api 'com.squareup.retrofit2:adapter-rxjava2:2.9.0'
    //3.12.x是支持Android 4.4的
    api 'com.squareup.okhttp3:logging-interceptor:3.12.2'
    api 'com.google.code.gson:gson:2.8.5'
    //处理rxjava内存泄漏-生命周期绑定
    api 'com.trello.rxlifecycle3:rxlifecycle-components:3.1.0'
    //滑动返回Activity
    compileOnly 'cn.bingoogolapple:bga-swipebacklayout:2.0.1@aar'
    //页面事件交互-androideventbus-停止维护
    compileOnly 'org.simple:androideventbus:1.0.5.1'
    //页面事件交互-eventbus
    compileOnly 'org.greenrobot:eventbus:3.1.1'
    //多状态视图切换
    api 'com.github.Bakumon:StatusLayoutManager:1.0.4'
}

鸣谢

  1. RetrofitSquare出品的网络请求库,极大的减少了 Http 请求的代码和步骤
  2. RxJava 提供优雅的响应式 API 解决异步请求以及事件处理
  3. RxAndroid 为 Android 提供响应式 API
  4. Rxlifecycle,在 Android 上使用 RxJava 都知道的一个坑,就是生命周期的解除订阅,这个框架通过绑定 Activity 和 Fragment 的生命周期完美解决该问题
  5. Okhttp 同样 Square 出品,不多介绍,做 Android 的都应该知道
  6. GsonGoogle 官方的 Json Convert 框架
  7. ButterknifeJakeWharton 大神出品的 View 注入框架
  8. AndroidEventBus 是一个轻量级的 EventBus,提供TAG支持
  9. Loggerorhanobut 出品的 Log 框架,FastLib提供相关封装类LoggerManager
  10. GlideGoogle推荐的图片加载库,FastLib提供相关封装类GlideManager
  11. BaseRecyclerViewAdapterHelper陈宇明封装的RecyclerView 适配器帮助类
  12. SmartRefreshLayoutscwang90封装的刷新库,扩展性很强
  13. AgentWebJustson封装的原生WebView库,使用方便扩展性很强
  14. BGASwipeBackLayoutbingoogolapple-王浩封装的微信效果的Activity滑动返回库
  15. StatusLayoutManagerBakumon封装的多状态控制管理工具,方便实现加载中、加载失败、网络错误等状态
  16. TabLayoutAriesHoo forked from FlycoTabLayout并加以优化调整的主界面tab、滑动tab、分段选择器tab功能库
  17. UIWidgetAriesHoo 封装的常用UI库(TitleBarView、RadiusView、StatusViewHelper、NavigationViewHelper等)

License

Copyright 2017-2021Aries Hoo

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.