-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7eeb21b
commit 33a68f9
Showing
24 changed files
with
171 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.cniao5.cainiaowo | ||
|
||
import com.cniao5.common.BaseApplication | ||
import com.cniao5.common.ktx.application | ||
import com.test.service.assistant.AssistantApp | ||
|
||
class CnApplication : BaseApplication() { | ||
|
||
override fun initConfig() { | ||
super.initConfig() | ||
//doKit的初始化配置 | ||
AssistantApp.initConfig(application) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
<resources xmlns:tools="http://schemas.android.com/tools"> | ||
<resources> | ||
<!-- Base application theme. --> | ||
<style name="Theme.Cainiaowo" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> | ||
<!-- Primary brand color. --> | ||
<item name="colorPrimary">@color/purple_200</item> | ||
<item name="colorPrimaryVariant">@color/purple_700</item> | ||
<item name="colorOnPrimary">@color/black</item> | ||
<!-- Secondary brand color. --> | ||
<item name="colorSecondary">@color/teal_200</item> | ||
<item name="colorSecondaryVariant">@color/teal_200</item> | ||
<item name="colorOnSecondary">@color/black</item> | ||
<!-- Status bar color. --> | ||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> | ||
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
<resources xmlns:tools="http://schemas.android.com/tools"> | ||
<resources> | ||
<!-- Base application theme. --> | ||
<style name="Theme.Cainiaowo" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> | ||
<!-- Primary brand color. --> | ||
<item name="colorPrimary">@color/purple_500</item> | ||
<item name="colorPrimaryVariant">@color/purple_700</item> | ||
<item name="colorOnPrimary">@color/white</item> | ||
<!-- Secondary brand color. --> | ||
<item name="colorSecondary">@color/teal_200</item> | ||
<item name="colorSecondaryVariant">@color/teal_700</item> | ||
<item name="colorOnSecondary">@color/black</item> | ||
<!-- Status bar color. --> | ||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> | ||
<style name="AppTheme" parent="Theme.MaterialComponents.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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,42 @@ | ||
package com.cniao5.common | ||
|
||
import android.app.Application | ||
import com.blankj.utilcode.util.LogUtils | ||
import org.koin.android.ext.koin.androidContext | ||
import org.koin.android.ext.koin.androidLogger | ||
import org.koin.core.context.startKoin | ||
import org.koin.core.logger.Level | ||
|
||
/* | ||
* | ||
* 抽象的公用BaseApplication*/ | ||
class BaseApplication: Application() { | ||
* 抽象Application配置基础通用的设置配置 | ||
* */ | ||
abstract class BaseApplication: Application() { | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
|
||
startKoin { | ||
androidLogger(Level.ERROR) //log level error方法,保证这句话不出错不然不写 | ||
|
||
//context | ||
androidContext(this@BaseApplication) | ||
//依赖注入模块 | ||
//module | ||
} | ||
|
||
initConfig() | ||
initData() | ||
|
||
LogUtils.d("BaseApplication onCreate") | ||
} | ||
|
||
/* | ||
* protected只有类的成员和继承该类的类才能访问 | ||
* 用于必要的配置初始化 | ||
* */ | ||
protected open fun initData() { } | ||
|
||
/* | ||
* 用于子类实现必要的数据初始化 | ||
* */ | ||
protected open fun initConfig() { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.cniao5.common.ktx | ||
|
||
import android.app.Application | ||
|
||
/* | ||
* Application相关的ktx扩展 | ||
* */ | ||
|
||
/* | ||
* Application的扩展字段 参数一致性 | ||
* */ | ||
val Application.application: Application | ||
get() = this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.test.service | ||
|
||
import org.koin.dsl.module | ||
|
||
/* | ||
* Service模块相关的koin的module配置 | ||
* */ | ||
val moduleService = module { } |
16 changes: 16 additions & 0 deletions
16
service/src/main/java/com/test/service/assistant/AssistantApp.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.test.service.assistant | ||
|
||
import android.app.Application | ||
import com.didichuxing.doraemonkit.DoraemonKit | ||
|
||
|
||
/* | ||
* 配置dokit的工具类 | ||
* */ | ||
object AssistantApp { | ||
|
||
fun initConfig(application: Application){ | ||
DoraemonKit.install(application) | ||
} | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="colorPrimary">#FFC107</color> | ||
<color name="colorPrimaryDark">#FFA000</color> | ||
<color name="colorPrimaryLight">#FFECB3</color> | ||
<color name="colorAccent">#FFA000</color> | ||
<color name="color_333333">#333333</color> | ||
<color name="colorPrimaryText">#212121</color> | ||
<color name="colorIcons">#212121</color> | ||
<color name="colorDivider">#BDBDBD</color> | ||
<color name="colorWindowBackGround">#F6F6F6</color> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="str_server_host_dokit">切换Host</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
</resources> |
Oops, something went wrong.