This commit is contained in:
Avently committed 2024-10-16 20:35:08 +07:00
1 parent 2cb3e77392
commit fb976e31b2
17 files changed
+218 -154

No files matched your search

@@ -31,6 +31,13 @@ class MainActivity: FragmentActivity() {
val c = CurrentColors.value.colors
platform.androidSetStatusAndNavigationBarAppearance(c.isLight)
applyAppLocale(ChatModel.controller.appPrefs.appLanguage)
// This flag makes status bar and navigation bar fully transparent. But on API level < 30 it breaks insets entirely
// https://issuetracker.google.com/issues/236862874
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q){
window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)
} else {
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
}
super.onCreate(savedInstanceState)
// testJson()
// When call ended and orientation changes, it re-process old intent, it's unneeded.
@@ -7,6 +7,8 @@ import chat.simplex.common.platform.Log
import android.content.Intent
import android.content.pm.ActivityInfo
import android.os.*
import android.view.View
import android.view.WindowManager.LayoutParams
import androidx.compose.animation.core.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
@@ -285,6 +287,13 @@ class SimplexApp: Application(), LifecycleEventObserver {
if (windowInsetController?.isAppearanceLightNavigationBars != CurrentColors.value.colors.isLight) {
windowInsetController?.isAppearanceLightNavigationBars = CurrentColors.value.colors.isLight
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
window.decorView.systemUiVisibility = if (CurrentColors.value.colors.isLight) {
View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR or View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
} else {
0
}
}
}
override fun androidStartCallActivity(acceptCall: Boolean, remoteHostId: Long?, chatId: ChatId?) {