mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 01:39:18 +01:00
parent
83a831371e
commit
f6ebd98f50
@ -1,16 +1,21 @@
|
||||
package eu.kanade.tachiyomi.ui.base.activity
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.Resources
|
||||
import android.os.Bundle
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter
|
||||
import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate
|
||||
import eu.kanade.tachiyomi.util.system.LocaleHelper
|
||||
import eu.kanade.tachiyomi.util.system.getThemeWithExtras
|
||||
import nucleus.view.NucleusAppCompatActivity
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
||||
abstract class BaseRxActivity<P : BasePresenter<*>> : NucleusAppCompatActivity<P>() {
|
||||
|
||||
val scope = lifecycleScope
|
||||
private val preferences by injectLazy<PreferencesHelper>()
|
||||
|
||||
override fun attachBaseContext(newBase: Context) {
|
||||
super.attachBaseContext(LocaleHelper.createLocaleWrapper(newBase))
|
||||
@ -25,4 +30,8 @@ abstract class BaseRxActivity<P : BasePresenter<*>> : NucleusAppCompatActivity<P
|
||||
super.onResume()
|
||||
SecureActivityDelegate.promptLockIfNeeded(this)
|
||||
}
|
||||
|
||||
override fun getTheme(): Resources.Theme {
|
||||
return getThemeWithExtras(super.getTheme(), preferences)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user