Skip to content

Latest commit

 

History

History
153 lines (136 loc) · 6.68 KB

README-1.4.1.md

File metadata and controls

153 lines (136 loc) · 6.68 KB

MyAndroidFrameWork

安卓常用组件&框架, 懒得每次都搭架子...

1.集成框架包括如下列表, 具体见 build.gradle:

//https://github.com/google/gson converter-gson 已经依赖了Gson2.8.2
//不混淆解析类, 示例: -keep class com.package.xxx.info.** { *; }
//api 'com.google.code.gson:gson:2.8.5'

//https://github.com/square/retrofit
api 'com.squareup.retrofit2:retrofit:2.5.0'
//https://github.com/square/retrofit/tree/master/retrofit-converters/gson
api 'com.squareup.retrofit2:converter-gson:2.5.0'

//https://github.com/bumptech/glide
api 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'

//https://github.com/greenrobot/EventBus
api 'org.greenrobot:eventbus:3.2.0'

//https://github.com/Blankj/AndroidUtilCode 许多工具
api 'com.blankj:utilcode:1.28.4'

//https://github.com/JessYanCoding/AndroidAutoSize 极低成本的 Android 屏幕适配方案
api 'me.jessyan:autosize:1.2.1'

//https://github.com/CymChad/BaseRecyclerViewAdapterHelper
api 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.50'

//https://github.com/anzaizai/EasySwipeMenuLayout 侧滑删除
api 'com.github.anzaizai:EasySwipeMenuLayout:1.1.4'

//https://github.com/yanzhenjie/Album 图片选择
api 'com.yanzhenjie:album:2.1.3'

//https://github.com/laobie/StatusBarUtil 修改状态栏颜色&透明度等
api 'com.jaeger.statusbarutil:library:1.5.1'

//https://github.com/yanzhenjie/AndPermission 严振杰权限
api 'com.yanzhenjie.permission:support:2.0.1'

//https://github.com/Bigkoo/Android-PickerView 时间选择器等等等
api 'com.contrarywind:Android-PickerView:4.1.9'

//https://github.com/H07000223/FlycoDialog_Master 各种Dialog & Popup
api 'com.flyco.dialog:FlycoDialog_Lib:1.3.2@aar'

//https://github.com/square/okhttp
api "com.squareup.okhttp3:okhttp:4.7.2"

//https://github.com/hongyangAndroid/okhttputils 张鸿洋的okhttp
api 'com.zhy:okhttputils:2.6.2'

2.Screenshot


3.Sample

download apk or scan qrcode:

4.minSdkVersion API

如果您项目的minSdkVersion小于16, 集成后可能会报错: Manifest merger failed with multiple errors, see logs

5.How to

To get a Git project into your build:

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }

Step 2. Add the dependency:

android {
  ...
  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }
}

dependencies {
        implementation 'com.github.actor20170211030627.MyAndroidFrameWork:myandroidframework:1.4.1'
}

6.1. 需要在自己项目中集成v7包和constraint, 否则报错

implementation 'com.android.support:appcompat-v7:version xxx' <br/>
implementation 'com.android.support.constraint:constraint-layout:version xxx'//约束布局, 版本version>=1.1.3

6.2. ButterKnife没有集成, 如果使用, 需要自己集成

//https://github.com/JakeWharton/butterknife
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

7.AndroidManifest.xml合并清单文件报错

如果你的清单文件中的 allowBackup = false, 那么需要添加一句: tools:replace="android:allowBackup", 示例:
<application
    android:allowBackup="false"
    tools:replace="android:allowBackup"

8.项目中已经添加了混淆文件, 如果需要混淆, 只需在自己项目中打开混淆配置:

    android {
        ...
        buildTypes {
            release {
                minifyEnabled true
                ...
            }
        }
    }

9.使用步骤

1.写一个 Application extends ActorApplication, 然后重写方法, 可参考: MyApplication  (非必须继承, ActorApplication里有一些配置, 可把配置代码copy到自己Application)
2.写一个 BaseActivity extends ActorBaseActivity, 然后你的Activity 继承 BaseActivity (非必须继承)
3.写一个 BaseFragment extends ActorBaseFragment, 然后你的Fragment 继承 BaseFragment (非必须继承)
4.已经集成了 AndroidAutoSize, 如果你需要使用它, 请在 AndroidManifest.xml 中填写全局设计图尺寸 (单位 dp):
  <application>
    <meta-data
        android:name="design_width_in_dp"
        android:value="(例)360"/>
    <meta-data
        android:name="design_height_in_dp"
        android:value="(例)640"/>
  </application>
5.<style name="AppTheme" parent="AppThemeForMyAndroidFrameWork"> 你的style可继承这个style (非必须继承)
6.已经添加了权限: INTERNET, CAMERA, READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE, ACCESS_NETWORK_STATE,  REQUEST_INSTALL_PACKAGES,
  可以不再添加以上权限(添加也不会报错.)

10.有问题请升级到最新版本: 1.4.1, 或升级到Androidx版本, 或提交 issues, 或发邮箱: email

11.License

License