Fix ocean dark

This commit is contained in:
Andrew 2024-06-13 09:43:30 +09:30
parent f7396503b2
commit f97630e38a
4 changed files with 14 additions and 8 deletions

View File

@ -20,6 +20,7 @@ import androidx.compose.ui.unit.dp
import network.loki.messenger.R import network.loki.messenger.R
import network.loki.messenger.libsession_util.util.ExpiryMode import network.loki.messenger.libsession_util.util.ExpiryMode
import org.thoughtcrime.securesms.ui.Callbacks import org.thoughtcrime.securesms.ui.Callbacks
import org.thoughtcrime.securesms.ui.LocalColors
import org.thoughtcrime.securesms.ui.NoOpCallbacks import org.thoughtcrime.securesms.ui.NoOpCallbacks
import org.thoughtcrime.securesms.ui.OptionsCard import org.thoughtcrime.securesms.ui.OptionsCard
import org.thoughtcrime.securesms.ui.RadioOption import org.thoughtcrime.securesms.ui.RadioOption
@ -56,7 +57,7 @@ fun DisappearingMessages(
text = stringResource(R.string.activity_disappearing_messages_group_footer), text = stringResource(R.string.activity_disappearing_messages_group_footer),
style = MaterialTheme.typography.extraSmall, style = MaterialTheme.typography.extraSmall,
fontWeight = FontWeight(400), fontWeight = FontWeight(400),
color = Color(0xFFA1A2A1), color = LocalColors.current.textSecondary,
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth()) modifier = Modifier.fillMaxWidth())
} }

View File

@ -32,6 +32,7 @@ import androidx.compose.material.Icon
import androidx.compose.material.LocalContentColor import androidx.compose.material.LocalContentColor
import androidx.compose.material.MaterialTheme import androidx.compose.material.MaterialTheme
import androidx.compose.material.RadioButton import androidx.compose.material.RadioButton
import androidx.compose.material.RadioButtonDefaults
import androidx.compose.material.Text import androidx.compose.material.Text
import androidx.compose.material.TextButton import androidx.compose.material.TextButton
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
@ -223,6 +224,7 @@ fun CellWithPaddingAndMargin(
@Composable @Composable
fun <T> TitledRadioButton(option: RadioOption<T>, onClick: () -> Unit) { fun <T> TitledRadioButton(option: RadioOption<T>, onClick: () -> Unit) {
val color = if (option.enabled) LocalColors.current.text else LocalColors.current.disabled
Row( Row(
horizontalArrangement = Arrangement.spacedBy(16.dp), horizontalArrangement = Arrangement.spacedBy(16.dp),
modifier = Modifier modifier = Modifier
@ -238,13 +240,13 @@ fun <T> TitledRadioButton(option: RadioOption<T>, onClick: () -> Unit) {
Text( Text(
text = option.title(), text = option.title(),
style = MaterialTheme.typography.large, style = MaterialTheme.typography.large,
modifier = Modifier.alpha(if (option.enabled) 1f else 0.5f) color = color
) )
option.subtitle?.let { option.subtitle?.let {
Text( Text(
text = it(), text = it(),
style = MaterialTheme.typography.extraSmall, style = MaterialTheme.typography.extraSmall,
modifier = Modifier.alpha(if (option.enabled) 1f else 0.5f) color = color
) )
} }
} }
@ -252,10 +254,11 @@ fun <T> TitledRadioButton(option: RadioOption<T>, onClick: () -> Unit) {
RadioButton( RadioButton(
selected = option.selected, selected = option.selected,
onClick = null, onClick = null,
enabled = option.enabled,
modifier = Modifier modifier = Modifier
.height(26.dp) .height(26.dp)
.align(Alignment.CenterVertically) .align(Alignment.CenterVertically),
enabled = option.enabled,
colors = LocalColors.current.radioButtonColors()
) )
} }
} }

View File

@ -11,6 +11,7 @@ import androidx.compose.foundation.text.selection.TextSelectionColors
import androidx.compose.material.Colors import androidx.compose.material.Colors
import androidx.compose.material.LocalContentColor import androidx.compose.material.LocalContentColor
import androidx.compose.material.MaterialTheme import androidx.compose.material.MaterialTheme
import androidx.compose.material.RadioButtonDefaults
import androidx.compose.material.Shapes import androidx.compose.material.Shapes
import androidx.compose.material.TabRowDefaults import androidx.compose.material.TabRowDefaults
import androidx.compose.material.Typography import androidx.compose.material.Typography
@ -74,6 +75,7 @@ data class SessionColors(
val button get() = if (isLight) text else primary val button get() = if (isLight) text else primary
val divider get() = text.copy(alpha = TabRowDefaults.DividerOpacity) val divider get() = text.copy(alpha = TabRowDefaults.DividerOpacity)
val backgroundBubbleSent get() = primary val backgroundBubbleSent get() = primary
@Composable fun radioButtonColors() = RadioButtonDefaults.colors(selectedColor = primary, unselectedColor = text, disabledColor = disabled)
} }
val primaryGreen = Color(0xFF31F196) val primaryGreen = Color(0xFF31F196)
@ -119,7 +121,7 @@ private fun sessionColors(
disabled = if (isLight) disabledLioht else disabledDark, disabled = if (isLight) disabledLioht else disabledDark,
background = listOf(Color.Black, Color.White, oceanDarkColors[2], oceanLightColors[7])[index], background = listOf(Color.Black, Color.White, oceanDarkColors[2], oceanLightColors[7])[index],
backgroundSecondary = listOf(classicDarkColors[1], classicLightColors[5], oceanDarkColors[1], oceanLightColors[6])[index], backgroundSecondary = listOf(classicDarkColors[1], classicLightColors[5], oceanDarkColors[1], oceanLightColors[6])[index],
text = listOf(Color.White, Color.Black, oceanDarkColors[1], oceanLightColors[1])[index], text = listOf(Color.White, Color.Black, Color.White, oceanLightColors[1])[index],
textSecondary = listOf(classicDarkColors[5], classicLightColors[1], oceanDarkColors[5], oceanLightColors[2])[index], textSecondary = listOf(classicDarkColors[5], classicLightColors[1], oceanDarkColors[5], oceanLightColors[2])[index],
borders = listOf(classicDarkColors[3], classicLightColors[3], oceanDarkColors[4], oceanLightColors[3])[index], borders = listOf(classicDarkColors[3], classicLightColors[3], oceanDarkColors[4], oceanLightColors[3])[index],
textBubbleSent = listOf(Color.Black, Color.Black, Color.Black, oceanLightColors[1])[index], textBubbleSent = listOf(Color.Black, Color.Black, Color.Black, oceanLightColors[1])[index],

View File

@ -62,7 +62,7 @@ val smallButton = Modifier.wrapContentHeight()
fun SessionButtonText( fun SessionButtonText(
text: String, text: String,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
color: Color = LocalColors.current.text, color: Color = LocalColors.current.button,
enabled: Boolean = true enabled: Boolean = true
) { ) {
Text( Text(
@ -113,7 +113,7 @@ fun OutlineButton(
onClick = onClick, onClick = onClick,
border = BorderStroke(1.dp, if (enabled) color else LocalColors.current.disabled), border = BorderStroke(1.dp, if (enabled) color else LocalColors.current.disabled),
colors = ButtonDefaults.outlinedButtonColors( colors = ButtonDefaults.outlinedButtonColors(
contentColor = if (enabled) color else Color.Unspecified, contentColor = if (enabled) color else LocalColors.current.disabled,
backgroundColor = Color.Unspecified backgroundColor = Color.Unspecified
) )
) { ) {