Use session colors

This commit is contained in:
Andrew 2024-06-13 09:14:56 +09:30
parent 939999de76
commit f7396503b2
5 changed files with 19 additions and 13 deletions

View File

@ -94,6 +94,7 @@ import org.thoughtcrime.securesms.permissions.Permissions
import org.thoughtcrime.securesms.preferences.SettingsActivity import org.thoughtcrime.securesms.preferences.SettingsActivity
import org.thoughtcrime.securesms.showMuteDialog import org.thoughtcrime.securesms.showMuteDialog
import org.thoughtcrime.securesms.showSessionDialog import org.thoughtcrime.securesms.showSessionDialog
import org.thoughtcrime.securesms.ui.LocalColors
import org.thoughtcrime.securesms.ui.LocalDimensions import org.thoughtcrime.securesms.ui.LocalDimensions
import org.thoughtcrime.securesms.ui.PreviewTheme import org.thoughtcrime.securesms.ui.PreviewTheme
import org.thoughtcrime.securesms.ui.SessionColors import org.thoughtcrime.securesms.ui.SessionColors
@ -438,12 +439,15 @@ class HomeActivity : PassphraseRequiredActionBarActivity(),
Text( Text(
stringResource(R.string.welcome_to_session), stringResource(R.string.welcome_to_session),
style = MaterialTheme.typography.base, style = MaterialTheme.typography.base,
color = MaterialTheme.colors.secondary, color = LocalColors.current.primary,
textAlign = TextAlign.Center textAlign = TextAlign.Center
) )
} }
Divider(modifier = Modifier.padding(vertical = LocalDimensions.current.marginExtraSmall)) Divider(
modifier = Modifier.padding(vertical = LocalDimensions.current.marginExtraSmall),
color = LocalColors.current.borders
)
Text( Text(
stringResource(R.string.conversationsNone), stringResource(R.string.conversationsNone),
style = MaterialTheme.typography.h8, style = MaterialTheme.typography.h8,

View File

@ -321,6 +321,7 @@ fun Modifier.fadingEdges(
fun Divider() { fun Divider() {
androidx.compose.material.Divider( androidx.compose.material.Divider(
modifier = Modifier.padding(horizontal = 16.dp), modifier = Modifier.padding(horizontal = 16.dp),
color = LocalColors.current.divider
) )
} }
@ -362,7 +363,7 @@ fun Arc(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
percentage: Float = 0.25f, percentage: Float = 0.25f,
fillColor: Color = LocalColors.current.primary, fillColor: Color = LocalColors.current.primary,
backgroundColor: Color = classicDarkColors[3], backgroundColor: Color = LocalColors.current.borders,
strokeWidth: Dp = 18.dp, strokeWidth: Dp = 18.dp,
sweepAngle: Float = 310f, sweepAngle: Float = 310f,
startAngle: Float = (360f - sweepAngle) / 2 + 90f startAngle: Float = (360f - sweepAngle) / 2 + 90f

View File

@ -71,6 +71,7 @@ data class SessionColors(
val backgroundBubbleReceived: Color = Color.Unspecified, val backgroundBubbleReceived: Color = Color.Unspecified,
val textBubbleReceived: Color = Color.Unspecified, val textBubbleReceived: Color = Color.Unspecified,
) { ) {
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
} }

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.primary, color: Color = LocalColors.current.text,
enabled: Boolean = true enabled: Boolean = true
) { ) {
Text( Text(
@ -77,7 +77,7 @@ fun SessionButtonText(
fun OutlineButton( fun OutlineButton(
@StringRes textId: Int, @StringRes textId: Int,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
color: Color = LocalColors.current.primary, color: Color = LocalColors.current.button,
onClick: () -> Unit onClick: () -> Unit
) { OutlineButton(stringResource(textId), modifier, color, onClick) } ) { OutlineButton(stringResource(textId), modifier, color, onClick) }
@ -85,7 +85,7 @@ fun OutlineButton(
fun OutlineButton( fun OutlineButton(
text: String, text: String,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
color: Color = LocalColors.current.primary, color: Color = LocalColors.current.button,
onClick: () -> Unit onClick: () -> Unit
) { ) {
OutlineButton( OutlineButton(
@ -102,7 +102,7 @@ fun OutlineButton(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
enabled: Boolean = true, enabled: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
color: Color = LocalColors.current.primary, color: Color = LocalColors.current.button,
onClick: () -> Unit, onClick: () -> Unit,
content: @Composable () -> Unit = {} content: @Composable () -> Unit = {}
) { ) {
@ -124,7 +124,7 @@ fun OutlineButton(
@Composable @Composable
fun OutlineCopyButton( fun OutlineCopyButton(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
color: Color = LocalColors.current.primary, color: Color = LocalColors.current.button,
onClick: () -> Unit = {} onClick: () -> Unit = {}
) { ) {
val interactionSource = remember { MutableInteractionSource() } val interactionSource = remember { MutableInteractionSource() }
@ -215,7 +215,7 @@ fun FilledButton(
@Composable @Composable
fun BorderlessButton( fun BorderlessButton(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
contentColor: Color = MaterialTheme.colors.onBackground, contentColor: Color = LocalColors.current.text,
backgroundColor: Color = Color.Transparent, backgroundColor: Color = Color.Transparent,
onClick: () -> Unit, onClick: () -> Unit,
content: @Composable () -> Unit content: @Composable () -> Unit
@ -235,7 +235,7 @@ fun BorderlessButton(
text: String, text: String,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
contentDescription: GetString = GetString(text), contentDescription: GetString = GetString(text),
contentColor: Color = MaterialTheme.colors.onBackground, contentColor: Color = LocalColors.current.text,
backgroundColor: Color = Color.Transparent, backgroundColor: Color = Color.Transparent,
onClick: () -> Unit onClick: () -> Unit
) { ) {
@ -260,7 +260,7 @@ fun BorderlessButtonWithIcon(
@DrawableRes iconRes: Int, @DrawableRes iconRes: Int,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
style: TextStyle = MaterialTheme.typography.baseBold, style: TextStyle = MaterialTheme.typography.baseBold,
contentColor: Color = MaterialTheme.colors.onBackground, contentColor: Color = LocalColors.current.text,
backgroundColor: Color = Color.Transparent, backgroundColor: Color = Color.Transparent,
onClick: () -> Unit onClick: () -> Unit
) { ) {
@ -278,7 +278,7 @@ fun BorderlessButtonWithIcon(
fun BorderlessHtmlButton( fun BorderlessHtmlButton(
textId: Int, textId: Int,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
contentColor: Color = MaterialTheme.colors.onBackground, contentColor: Color = LocalColors.current.text,
backgroundColor: Color = Color.Transparent, backgroundColor: Color = Color.Transparent,
onClick: () -> Unit onClick: () -> Unit
) { ) {

View File

@ -33,7 +33,7 @@ fun SessionTabRow(pagerState: PagerState, titles: List<Int>) {
TabRow( TabRow(
backgroundColor = Color.Unspecified, backgroundColor = Color.Unspecified,
selectedTabIndex = pagerState.currentPage, selectedTabIndex = pagerState.currentPage,
contentColor = LocalColors.current.primary, contentColor = LocalColors.current.text,
divider = { TabRowDefaults.Divider(color = LocalColors.current.divider) }, divider = { TabRowDefaults.Divider(color = LocalColors.current.divider) },
modifier = Modifier modifier = Modifier
.height(48.dp) .height(48.dp)