Commit 6578e535 authored by wanglei's avatar wanglei

...

parent b4fdaf26
...@@ -75,7 +75,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() { ...@@ -75,7 +75,7 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
} }
fun changeLanguage(currentActivity: Activity): Boolean { fun changeLanguage(currentActivity: Activity, bundle: Bundle = Bundle()): Boolean {
val spLanguage = Locale(appLanguageSp, appLanguageCountrySp) val spLanguage = Locale(appLanguageSp, appLanguageCountrySp)
val flag = currentLocale != spLanguage val flag = currentLocale != spLanguage
val restart = MultiLanguages.setAppLanguage(this, spLanguage) val restart = MultiLanguages.setAppLanguage(this, spLanguage)
...@@ -104,14 +104,15 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() { ...@@ -104,14 +104,15 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
LogEx.logDebug(TAG, "changeLanguage recreate") LogEx.logDebug(TAG, "changeLanguage recreate")
recreate() recreate()
} else { } else {
startActivity(Intent(this, currentActivity::class.java)) startActivity(Intent(this, currentActivity::class.java).apply {
putExtras(bundle)
})
overridePendingTransition(R.anim.activity_alpha_in, R.anim.activity_alpha_out) overridePendingTransition(R.anim.activity_alpha_in, R.anim.activity_alpha_out)
finish() finish()
} }
return true return true
} }
return false return false
} }
/** /**
......
...@@ -2,6 +2,7 @@ package com.base.locationsharewhite.ui.howuse ...@@ -2,6 +2,7 @@ package com.base.locationsharewhite.ui.howuse
import android.content.Intent import android.content.Intent
import android.graphics.Color import android.graphics.Color
import android.os.Bundle
import androidx.activity.addCallback import androidx.activity.addCallback
import androidx.core.view.updatePadding import androidx.core.view.updatePadding
import com.base.locationsharewhite.R import com.base.locationsharewhite.R
...@@ -19,16 +20,17 @@ class HowUseActivity : BaseActivity<ActivityHowUseBinding>() { ...@@ -19,16 +20,17 @@ class HowUseActivity : BaseActivity<ActivityHowUseBinding>() {
} }
var isGuide: Boolean = false private var isGuide: Boolean = false
override fun initView() { override fun initView() {
BarUtils.setStatusBarLightMode(this, true) BarUtils.setStatusBarLightMode(this, true)
BarUtils.setStatusBarColor(this, Color.WHITE) BarUtils.setStatusBarColor(this, Color.WHITE)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight()) binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
val recreated = changeLanguage(this) val recreated = changeLanguage(this, intent.extras ?: Bundle())
if (recreated) return if (recreated) return
isGuide = intent.extras?.getBoolean("isGuide", false) ?: false isGuide = intent.extras?.getBoolean("isGuide", false) ?: false
LogEx.logDebug(TAG, "isGuide=$isGuide")
if (AdsMgr.adsConfigBean.functionInShowAd && !isGuide) { if (AdsMgr.adsConfigBean.functionInShowAd && !isGuide) {
AdsMgr.showInsert(this, showCallBack = object : AdsShowCallBack() { AdsMgr.showInsert(this, showCallBack = object : AdsShowCallBack() {
...@@ -44,9 +46,8 @@ class HowUseActivity : BaseActivity<ActivityHowUseBinding>() { ...@@ -44,9 +46,8 @@ class HowUseActivity : BaseActivity<ActivityHowUseBinding>() {
LogEx.logDebug(TAG, "where=$where") LogEx.logDebug(TAG, "where=$where")
} }
}) })
AdsMgr.showNative(binding.flAd, R.layout.layout_admob_app_exit)
} }
AdsMgr.showNative(binding.flAd, R.layout.layout_admob_app_exit)
} }
override fun onResumeOneShoot() { override fun onResumeOneShoot() {
...@@ -87,5 +88,4 @@ class HowUseActivity : BaseActivity<ActivityHowUseBinding>() { ...@@ -87,5 +88,4 @@ class HowUseActivity : BaseActivity<ActivityHowUseBinding>() {
} }
} }
} }
\ No newline at end of file
...@@ -8,7 +8,6 @@ import android.text.style.ForegroundColorSpan ...@@ -8,7 +8,6 @@ import android.text.style.ForegroundColorSpan
import android.view.Gravity import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
import android.widget.LinearLayout import android.widget.LinearLayout
import com.base.locationsharewhite.R
import com.base.locationsharewhite.databinding.DialogAllowAllTimeLocationBinding import com.base.locationsharewhite.databinding.DialogAllowAllTimeLocationBinding
object LocationPermissionDialog { object LocationPermissionDialog {
......
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