|
|
@@ -5,6 +5,7 @@ import android.os.SystemClock
|
|
|
import androidx.core.app.NotificationManagerCompat
|
|
|
import androidx.lifecycle.lifecycleScope
|
|
|
import com.adealink.frame.aab.AAB
|
|
|
+import com.adealink.frame.base.fastLazy
|
|
|
import com.adealink.frame.coroutine.dispatcher.Dispatcher
|
|
|
import com.adealink.frame.log.Log
|
|
|
import com.adealink.frame.push.manager.pushService
|
|
|
@@ -14,10 +15,12 @@ import com.adealink.weparty.App
|
|
|
import com.adealink.weparty.BuildConfig
|
|
|
import com.adealink.weparty.commonui.BaseActivity
|
|
|
import com.adealink.weparty.commonui.BaseFragment
|
|
|
+import com.adealink.weparty.commonui.ext.isUiValid
|
|
|
import com.adealink.weparty.config.globalConfigManager
|
|
|
import com.adealink.weparty.location.viewmodel.LocationReporter
|
|
|
import com.adealink.weparty.module.account.AccountModule
|
|
|
import com.adealink.weparty.module.profile.ProfileModule
|
|
|
+import com.adealink.weparty.module.setting.SettingModule
|
|
|
import com.adealink.weparty.module.wallet.WalletModule
|
|
|
import com.adealink.weparty.push.PushStatEvent
|
|
|
import com.google.firebase.crashlytics.ktx.crashlytics
|
|
|
@@ -60,6 +63,13 @@ class MainStartUpFragment : BaseFragment() {
|
|
|
// null
|
|
|
// }
|
|
|
// }
|
|
|
+ private val settingViewModel by fastLazy {
|
|
|
+ if (activity?.isUiValid() == true) {
|
|
|
+ SettingModule.getSettingViewModel(requireActivity())
|
|
|
+ } else {
|
|
|
+ null
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
private suspend fun importantTask() {
|
|
|
withContext(Dispatcher.WENEXT_THREAD_POOL) {
|
|
|
@@ -120,8 +130,6 @@ class MainStartUpFragment : BaseFragment() {
|
|
|
WalletModule.fetchCurrency()
|
|
|
WalletModule.queryAndHandleUnDealPurchases()
|
|
|
globalConfigManager.getAllGlobalConfig(true)
|
|
|
-
|
|
|
-
|
|
|
Log.d(TAG, "minorLoad-end, cost:${SystemClock.elapsedRealtime() - startTs}ms")
|
|
|
}
|
|
|
|
|
|
@@ -135,6 +143,7 @@ class MainStartUpFragment : BaseFragment() {
|
|
|
val startTs = SystemClock.elapsedRealtime()
|
|
|
Log.d(TAG, "otherLoad-start")
|
|
|
reportPushSwitch()
|
|
|
+ settingViewModel?.reportLanguage(App.instance.languageManager.getLanguage())
|
|
|
Log.d(TAG, "otherLoad-end, cost:${SystemClock.elapsedRealtime() - startTs}ms")
|
|
|
}
|
|
|
|