mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
improvements on status and nav color set
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ interface PlatformInterface {
|
||||
fun androidIsBackgroundCallAllowed(): Boolean = true
|
||||
fun androidSetNightModeIfSupported() {}
|
||||
fun androidSetStatusAndNavBarColors(isLight: Boolean, backgroundColor: Color, hasTop: Boolean, hasBottom: Boolean) {}
|
||||
fun androidSetStatusBarColor(isLight: Boolean, animatedColor: Animatable<Color, AnimationVector4D>) {}
|
||||
fun androidSetDrawerStatusAndNavBarColor(isLight: Boolean, drawerShadingColor: Animatable<Color, AnimationVector4D>, toolbarOnTop: Boolean, changeNavBarColor: (originalColor: Color) -> Color) {}
|
||||
fun androidStartCallActivity(acceptCall: Boolean, remoteHostId: Long? = null, chatId: ChatId? = null) {}
|
||||
fun androidPictureInPictureAllowed(): Boolean = true
|
||||
fun androidCallEnded() {}
|
||||
|
||||
+13
-8
@@ -379,6 +379,8 @@ fun UserPicker(
|
||||
)
|
||||
}
|
||||
|
||||
val originalNavColor = mutableStateOf<Color?>(null)
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
launch {
|
||||
userPickerState.collect {
|
||||
@@ -387,15 +389,18 @@ fun UserPicker(
|
||||
val toColor = if (colors.isLight) colors.onSurface.copy(alpha = ScrimOpacity) else Color.Black.copy(0.64f)
|
||||
|
||||
animatedColor.animateTo(if (newChat.isVisible()) toColor else Color.Transparent, newChatSheetAnimSpec()) {
|
||||
if (newChat.isVisible()) {
|
||||
platform.androidSetStatusAndNavBarColors(colors.isLight, colors.surface, !appPrefs.oneHandUI.get(), false)
|
||||
} else {
|
||||
platform.androidSetStatusAndNavBarColors(colors.isLight, colors.background, !appPrefs.oneHandUI.get(), appPrefs.oneHandUI.get())
|
||||
}
|
||||
if (newChat.isVisible() || newChat.isHiding()) {
|
||||
platform.androidSetStatusBarColor(
|
||||
CurrentColors.value.colors.isLight,
|
||||
animatedColor
|
||||
platform.androidSetDrawerStatusAndNavBarColor(
|
||||
isLight = CurrentColors.value.colors.isLight,
|
||||
drawerShadingColor = animatedColor,
|
||||
toolbarOnTop = !appPrefs.oneHandUI.get(),
|
||||
changeNavBarColor = { c ->
|
||||
val onc = originalNavColor.value
|
||||
if (onc == null) {
|
||||
originalNavColor.value = c
|
||||
}
|
||||
if (newChat.isVisible()) colors.surface else onc ?: colors.background.mixWith(colors.onBackground, 0.97f)
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user