mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-19 21:58:25 +00:00
Fix textSelectionColors
This commit is contained in:
parent
f2959073ec
commit
d8f032ff9e
@ -23,6 +23,7 @@ import org.thoughtcrime.securesms.ui.color.LocalColors
|
||||
import org.thoughtcrime.securesms.ui.color.OceanDark
|
||||
import org.thoughtcrime.securesms.ui.color.OceanLight
|
||||
import org.thoughtcrime.securesms.ui.color.colors
|
||||
import org.thoughtcrime.securesms.ui.color.textSelectionColors
|
||||
|
||||
/**
|
||||
* Apply a Material2 compose theme based on user selections in SharedPreferences.
|
||||
@ -47,15 +48,10 @@ fun SessionMaterialTheme(
|
||||
typography = sessionTypography,
|
||||
shapes = sessionShapes,
|
||||
) {
|
||||
val textSelectionColors = TextSelectionColors(
|
||||
handleColor = LocalColors.current.primary,
|
||||
backgroundColor = LocalColors.current.primary.copy(alpha = 0.5f)
|
||||
)
|
||||
|
||||
CompositionLocalProvider(
|
||||
LocalColors provides colors,
|
||||
LocalContentColor provides colors.text,
|
||||
LocalTextSelectionColors provides textSelectionColors,
|
||||
LocalTextSelectionColors provides colors.textSelectionColors,
|
||||
) {
|
||||
content()
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.text.selection.TextSelectionColors
|
||||
import androidx.compose.material.ButtonDefaults
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.RadioButtonDefaults
|
||||
@ -56,6 +57,11 @@ interface Colors {
|
||||
val primaryButtonOutline get() = primaryButtonFill
|
||||
}
|
||||
|
||||
val Colors.textSelectionColors get() = TextSelectionColors(
|
||||
handleColor = primary,
|
||||
backgroundColor = primary.copy(alpha = 0.5f)
|
||||
)
|
||||
|
||||
data class ClassicDark(override val primary: Color = primaryGreen): Colors {
|
||||
override val isLight = false
|
||||
override val danger = dangerDark
|
||||
|
Loading…
x
Reference in New Issue
Block a user