Modify: 组件化基本模块实现

This commit is contained in:
Quyunshuo
2020-08-27 16:17:26 +08:00
parent 05e8604eb3
commit 2d04aa7824
37 changed files with 349 additions and 70 deletions

1
Lib_Base/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

72
Lib_Base/build.gradle Normal file
View File

@ -0,0 +1,72 @@
import com.quyunshuo.androidbaseframemvvm.build.*
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
android {
compileSdkVersion BuildConfig.compileSdkVersion
buildToolsVersion BuildConfig.buildToolsVersion
defaultConfig {
minSdkVersion BuildConfig.minSdkVersion
targetSdkVersion BuildConfig.targetSdkVersion
versionCode BuildConfig.versionCode
versionName BuildConfig.versionName
testInstrumentationRunner AndroidX.AndroidJUnitRunner
consumerProguardFiles "consumer-rules.pro"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
api AndroidX.CoreKtx
api AndroidX.AppCompat
api AndroidX.ConstraintLayout
api AndroidX.ActivityKtx
api AndroidX.FragmentKtx
api Kotlin.Kotlin
api Kotlin.CoroutinesCore
api Kotlin.CoroutinesAndroid
api JetPack.LifecycleRuntimeKtx
api JetPack.LifecycleViewModel
api JetPack.LifecycleViewModelKtx
api JetPack.HiltLifecycleViewModel
api JetPack.HiltDaggerAndroid
api GitHub.OkHttp
api GitHub.OkHttpInterceptorLogging
api GitHub.Retrofit
api GitHub.RetrofitConverterGson
api GitHub.Gson
api GitHub.MMKV
api GitHub.AutoSize
api GitHub.Glide
api GitHub.ARoute
api GitHub.RecyclerViewAdapter
kapt JetPack.HiltDaggerCompiler
kapt JetPack.Hilt
kapt GitHub.GlideCompiler
kapt GitHub.ARouteCompiler
}

View File

21
Lib_Base/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@ -0,0 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.quyunshuo.base">
/
</manifest>

View File

@ -0,0 +1,12 @@
package com.quyunshuo.base
import android.app.Application
/**
* @Author: QuYunShuo
* @Time: 2020/8/27
* @Class: BaseApplication
* @Remark: 自定义Application的基类
*/
open class BaseApplication : Application() {
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#6200EE</color>
<color name="colorPrimaryDark">#3700B3</color>
<color name="colorAccent">#03DAC5</color>
</resources>

View File

@ -0,0 +1,11 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>