Jelajahi Sumber

Fix reader activity not using preferred language (#5630)

Ivan Iskandar 3 tahun lalu
induk
melakukan
a3090e62f5

+ 6 - 0
app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseRxActivity.kt

@@ -1,9 +1,11 @@
 package eu.kanade.tachiyomi.ui.base.activity
 
+import android.content.Context
 import android.os.Bundle
 import androidx.viewbinding.ViewBinding
 import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter
 import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate
+import eu.kanade.tachiyomi.util.system.LocaleHelper
 import nucleus.view.NucleusAppCompatActivity
 
 abstract class BaseRxActivity<VB : ViewBinding, P : BasePresenter<*>> : NucleusAppCompatActivity<P>() {
@@ -13,6 +15,10 @@ abstract class BaseRxActivity<VB : ViewBinding, P : BasePresenter<*>> : NucleusA
 
     lateinit var binding: VB
 
+    override fun attachBaseContext(newBase: Context) {
+        super.attachBaseContext(LocaleHelper.createLocaleWrapper(newBase))
+    }
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
 

+ 0 - 6
app/src/main/java/eu/kanade/tachiyomi/ui/base/activity/BaseViewBindingActivity.kt

@@ -1,10 +1,8 @@
 package eu.kanade.tachiyomi.ui.base.activity
 
-import android.content.Context
 import android.os.Bundle
 import androidx.viewbinding.ViewBinding
 import eu.kanade.tachiyomi.ui.security.SecureActivityDelegate
-import eu.kanade.tachiyomi.util.system.LocaleHelper
 
 abstract class BaseViewBindingActivity<VB : ViewBinding> : BaseThemedActivity() {
 
@@ -13,10 +11,6 @@ abstract class BaseViewBindingActivity<VB : ViewBinding> : BaseThemedActivity()
     @Suppress("LeakingThis")
     private val secureActivityDelegate = SecureActivityDelegate(this)
 
-    override fun attachBaseContext(newBase: Context) {
-        super.attachBaseContext(LocaleHelper.createLocaleWrapper(newBase))
-    }
-
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)