mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 04:13:39 +00:00
Support light dark system setting
This commit is contained in:
parent
f00d2ff06d
commit
deea6c722b
@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.ui
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.annotation.AttrRes
|
import androidx.annotation.AttrRes
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.text.selection.LocalTextSelectionColors
|
import androidx.compose.foundation.text.selection.LocalTextSelectionColors
|
||||||
@ -71,13 +72,13 @@ private fun SessionColors.toMaterialColors() = Colors(
|
|||||||
onPrimary = text,
|
onPrimary = text,
|
||||||
onSecondary = text,
|
onSecondary = text,
|
||||||
onBackground = text,
|
onBackground = text,
|
||||||
onSurface = background,
|
onSurface = text,
|
||||||
onError = text,
|
onError = text,
|
||||||
isLight = isLight
|
isLight = isLight
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun Context.sessionColors() = AppTextSecurePreferences(this).themeState().sessionColors()
|
@Composable private fun Context.sessionColors() = AppTextSecurePreferences(this).themeState().sessionColors()
|
||||||
private fun ThemeState.sessionColors() = sessionColors(isLight, isClassic, accent)
|
@Composable private fun ThemeState.sessionColors() = sessionColors(if (followSystem) !isSystemInDarkTheme() else isLight, isClassic, accent)
|
||||||
|
|
||||||
val sessionShapes = Shapes(
|
val sessionShapes = Shapes(
|
||||||
small = RoundedCornerShape(50)
|
small = RoundedCornerShape(50)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user