mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-09 13:59:48 +01:00
fix to color status-bar with theming
SetStatusBarColor() was called outside of the MaterialTheme() block Also, "surface" has to be used to get the 'light primary color' Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
6fa7b8f177
commit
aeb50c6b68
@ -10,20 +10,18 @@ package com.nextcloud.talk.components
|
||||
|
||||
import android.app.Activity
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.core.view.WindowCompat
|
||||
import com.nextcloud.talk.R
|
||||
|
||||
@Composable
|
||||
fun SetStatusBarColor() {
|
||||
val view = LocalView.current
|
||||
val isDarkMod = isSystemInDarkTheme()
|
||||
val statusBarColor = colorResource(R.color.bg_default).toArgb()
|
||||
val statusBarColor = MaterialTheme.colorScheme.surface.toArgb()
|
||||
|
||||
DisposableEffect(isDarkMod) {
|
||||
val activity = view.context as Activity
|
||||
|
@ -68,12 +68,11 @@ class ContactsActivityCompose : BaseActivity() {
|
||||
contactsViewModel = contactsViewModel,
|
||||
uiState = uiState.value
|
||||
)
|
||||
}
|
||||
|
||||
SetStatusBarColor()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class CompanionClass {
|
||||
companion object {
|
||||
|
@ -117,11 +117,10 @@ class DiagnoseActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
SetStatusBarColor()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
Loading…
Reference in New Issue
Block a user