Commit 7ae255cd authored by wanglei's avatar wanglei

...

parent 2f3e1720
......@@ -64,29 +64,29 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
activityTag: String? = null,
activityChangeCallback: ((language: String) -> Unit)? = null
): Boolean {
LogEx.logDebug(
TAG,
"activityTag=$activityTag " +
"appLanguageSp=$appLanguageSp " +
"changeLanguageSp=$changeLanguageSp " +
"activityLanguage=$activityLanguage"
)
var isRecreate = false
if (appLanguageSp != changeLanguageSp || activityLanguage != changeLanguageSp) {
changeAppLanguage(this, changeLanguageSp)
// Restart the app
appLanguageSp = changeLanguageSp
activityChangeCallback?.invoke(changeLanguageSp)
LogEx.logDebug(TAG, "activityTag=$activityTag recreate")
isRecreate = true
//https://stackoverflow.com/questions/63209993/getting-lifecycle-exception-while-recreating-the-activity
//MIUI recreate
this@BaseActivity.recreate()
}
return isRecreate
// LogEx.logDebug(
// TAG,
// "activityTag=$activityTag " +
// "appLanguageSp=$appLanguageSp " +
// "changeLanguageSp=$changeLanguageSp " +
// "activityLanguage=$activityLanguage"
// )
// var isRecreate = false
//
// if (appLanguageSp != changeLanguageSp || activityLanguage != changeLanguageSp) {
//
// changeAppLanguage(this, changeLanguageSp)
// // Restart the app
// appLanguageSp = changeLanguageSp
// activityChangeCallback?.invoke(changeLanguageSp)
// LogEx.logDebug(TAG, "activityTag=$activityTag recreate")
// isRecreate = true
//
// //https://stackoverflow.com/questions/63209993/getting-lifecycle-exception-while-recreating-the-activity
// //MIUI recreate
// this@BaseActivity.recreate()
// }
return false
}
fun isLanguageRecreate(activityLanguage: String): Boolean {
......
......@@ -181,7 +181,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(), SplashView {
private fun firstLauncherJump() {
if (Locale.getDefault().language + "_" + Locale.getDefault().country != Locale.ENGLISH.language + "_" + Locale.ENGLISH.country) {
startActivity(Intent(this, LanguageActivity::class.java).apply {
startActivity(Intent(this, HowUseActivity::class.java).apply {
putExtra("isGuide", true)
})
} else {
......
......@@ -207,7 +207,8 @@
android:layout_height="61dp"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true">
android:focusable="true"
android:visibility="gone">
<ImageView
android:layout_width="wrap_content"
......@@ -243,7 +244,8 @@
android:layout_height="61dp"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true">
android:focusable="true"
android:visibility="gone">
<ImageView
android:layout_width="wrap_content"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment