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

View File

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

View File

@ -71,6 +71,7 @@ data class SessionColors(
val backgroundBubbleReceived: 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 backgroundBubbleSent get() = primary
}

View File

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

View File

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