解决 VididinApp release编译错误
This commit is contained in:
parent
7f21fb10a5
commit
d770804d32
|
|
@ -29,9 +29,8 @@ android {
|
||||||
zipAlignEnabled true
|
zipAlignEnabled true
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
minifyEnabled true
|
minifyEnabled false
|
||||||
zipAlignEnabled true
|
zipAlignEnabled true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,13 @@ import dagger.hilt.android.HiltAndroidApp
|
||||||
@HiltAndroidApp
|
@HiltAndroidApp
|
||||||
class VidiDinApp : BaseApp() {
|
class VidiDinApp : BaseApp() {
|
||||||
|
|
||||||
override fun customOnCreate() {
|
override fun onCreate() {
|
||||||
|
super.onCreate()
|
||||||
|
instance = this
|
||||||
initManagers()
|
initManagers()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun initManagers() {
|
private fun initManagers() {
|
||||||
AccountManager.getAccount()
|
AccountManager.getAccount()
|
||||||
TaskManager.Companion.instance().initNotificationData()
|
TaskManager.Companion.instance().initNotificationData()
|
||||||
|
|
|
||||||
|
|
@ -19,24 +19,11 @@ abstract class BaseApp : Application() {
|
||||||
fun getCurrentActivity(): Activity? {
|
fun getCurrentActivity(): Activity? {
|
||||||
return currentActivity?.get()
|
return currentActivity?.get()
|
||||||
}
|
}
|
||||||
private lateinit var instance: BaseApp
|
lateinit var instance: BaseApp
|
||||||
fun appContext(): Context = instance
|
fun appContext(): Context = instance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
super.onCreate()
|
|
||||||
instance = this
|
|
||||||
customOnCreate();
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract fun customOnCreate()
|
|
||||||
|
|
||||||
override fun onTerminate() {
|
|
||||||
super.onTerminate()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 系统资源配置发生更改回调,例如主题模式,需要重新刷新多语言
|
// 系统资源配置发生更改回调,例如主题模式,需要重新刷新多语言
|
||||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||||
super.onConfigurationChanged(newConfig)
|
super.onConfigurationChanged(newConfig)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue