mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-20 00:48:26 +00:00
Add text selection colors
This commit is contained in:
parent
c72f37a9ac
commit
eb98ce961c
@ -80,7 +80,7 @@ fun destructiveButtonColors() = ButtonDefaults.buttonColors(backgroundColor = Co
|
|||||||
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
fun Context.PreviewMessageDetails(
|
fun PreviewMessageDetails(
|
||||||
@PreviewParameter(ThemeResPreviewParameterProvider::class) themeResId: Int
|
@PreviewParameter(ThemeResPreviewParameterProvider::class) themeResId: Int
|
||||||
) {
|
) {
|
||||||
PreviewTheme(themeResId) {
|
PreviewTheme(themeResId) {
|
||||||
@ -127,6 +127,5 @@ fun outlinedTextFieldColors(
|
|||||||
textColor = if (isError) colorDestructive else LocalContentColor.current.copy(LocalContentAlpha.current),
|
textColor = if (isError) colorDestructive else LocalContentColor.current.copy(LocalContentAlpha.current),
|
||||||
focusedBorderColor = Color(classicDark3),
|
focusedBorderColor = Color(classicDark3),
|
||||||
unfocusedBorderColor = Color(classicDark3),
|
unfocusedBorderColor = Color(classicDark3),
|
||||||
cursorColor = LocalContentColor.current,
|
|
||||||
placeholderColor = if (isError) colorDestructive else MaterialTheme.colors.onSurface.copy(ContentAlpha.medium)
|
placeholderColor = if (isError) colorDestructive else MaterialTheme.colors.onSurface.copy(ContentAlpha.medium)
|
||||||
)
|
)
|
||||||
|
@ -5,6 +5,8 @@ import androidx.annotation.AttrRes
|
|||||||
import androidx.appcompat.view.ContextThemeWrapper
|
import androidx.appcompat.view.ContextThemeWrapper
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.text.selection.LocalTextSelectionColors
|
||||||
|
import androidx.compose.foundation.text.selection.TextSelectionColors
|
||||||
import androidx.compose.material.LocalContentColor
|
import androidx.compose.material.LocalContentColor
|
||||||
import androidx.compose.material.MaterialTheme
|
import androidx.compose.material.MaterialTheme
|
||||||
import androidx.compose.material.Shapes
|
import androidx.compose.material.Shapes
|
||||||
@ -55,9 +57,15 @@ fun AppTheme(
|
|||||||
|
|
||||||
val surface = context.getColorFromTheme(R.attr.colorSettingsBackground)
|
val surface = context.getColorFromTheme(R.attr.colorSettingsBackground)
|
||||||
|
|
||||||
|
|
||||||
CompositionLocalProvider(LocalExtraColors provides extraColors) {
|
CompositionLocalProvider(LocalExtraColors provides extraColors) {
|
||||||
AppCompatTheme(surface = surface) {
|
AppCompatTheme(surface = surface) {
|
||||||
content()
|
CompositionLocalProvider(LocalTextSelectionColors provides TextSelectionColors(
|
||||||
|
handleColor = MaterialTheme.colors.secondary,
|
||||||
|
backgroundColor = MaterialTheme.colors.secondary.copy(alpha = 0.5f)
|
||||||
|
)) {
|
||||||
|
content()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user