Color aliases now use ElementTheme
This commit is contained in:
@@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.ripple
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.remember
|
||||
@@ -212,7 +211,7 @@ private fun NameAndTimestampRow(
|
||||
style = ElementTheme.typography.fontBodyLgMedium,
|
||||
text = name ?: stringResource(id = CommonStrings.common_no_room_name),
|
||||
fontStyle = FontStyle.Italic.takeIf { name == null },
|
||||
color = MaterialTheme.roomListRoomName(),
|
||||
color = ElementTheme.roomListRoomName(),
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
@@ -223,7 +222,7 @@ private fun NameAndTimestampRow(
|
||||
color = if (isHighlighted) {
|
||||
ElementTheme.colors.unreadIndicator
|
||||
} else {
|
||||
MaterialTheme.roomListRoomMessageDate()
|
||||
ElementTheme.roomListRoomMessageDate()
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -247,7 +246,7 @@ private fun InviteSubtitle(
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
style = ElementTheme.typography.fontBodyMdRegular,
|
||||
color = MaterialTheme.roomListRoomMessage(),
|
||||
color = ElementTheme.roomListRoomMessage(),
|
||||
modifier = modifier,
|
||||
)
|
||||
}
|
||||
@@ -268,7 +267,7 @@ private fun LastMessageAndIndicatorRow(
|
||||
Text(
|
||||
modifier = Modifier.weight(1f),
|
||||
text = attributedLastMessage,
|
||||
color = MaterialTheme.roomListRoomMessage(),
|
||||
color = ElementTheme.roomListRoomMessage(),
|
||||
style = ElementTheme.typography.fontBodyMdRegular,
|
||||
minLines = 2,
|
||||
maxLines = 2,
|
||||
@@ -315,7 +314,7 @@ private fun InviteNameAndIndicatorRow(
|
||||
style = ElementTheme.typography.fontBodyLgMedium,
|
||||
text = name ?: stringResource(id = CommonStrings.common_no_room_name),
|
||||
fontStyle = FontStyle.Italic.takeIf { name == null },
|
||||
color = MaterialTheme.roomListRoomName(),
|
||||
color = ElementTheme.roomListRoomName(),
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package io.element.android.libraries.designsystem.theme
|
||||
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import io.element.android.compound.annotations.CoreColorToken
|
||||
@@ -24,13 +23,13 @@ import kotlinx.collections.immutable.persistentMapOf
|
||||
* Room list.
|
||||
*/
|
||||
@Composable
|
||||
fun MaterialTheme.roomListRoomName() = colorScheme.primary
|
||||
fun ElementTheme.roomListRoomName() = colors.textPrimary
|
||||
|
||||
@Composable
|
||||
fun MaterialTheme.roomListRoomMessage() = colorScheme.secondary
|
||||
fun ElementTheme.roomListRoomMessage() = colors.textSecondary
|
||||
|
||||
@Composable
|
||||
fun MaterialTheme.roomListRoomMessageDate() = colorScheme.secondary
|
||||
fun ElementTheme.roomListRoomMessageDate() = colors.textSecondary
|
||||
|
||||
val SemanticColors.unreadIndicator
|
||||
get() = iconAccentTertiary
|
||||
@@ -181,9 +180,9 @@ internal fun ColorAliasesPreview() = ElementPreview {
|
||||
backgroundColor = Color.Black,
|
||||
foregroundColor = Color.White,
|
||||
colors = persistentMapOf(
|
||||
"roomListRoomName" to MaterialTheme.roomListRoomName(),
|
||||
"roomListRoomMessage" to MaterialTheme.roomListRoomMessage(),
|
||||
"roomListRoomMessageDate" to MaterialTheme.roomListRoomMessageDate(),
|
||||
"roomListRoomName" to ElementTheme.roomListRoomName(),
|
||||
"roomListRoomMessage" to ElementTheme.roomListRoomMessage(),
|
||||
"roomListRoomMessageDate" to ElementTheme.roomListRoomMessageDate(),
|
||||
"unreadIndicator" to ElementTheme.colors.unreadIndicator,
|
||||
"placeholderBackground" to ElementTheme.colors.placeholderBackground,
|
||||
"messageFromMeBackground" to ElementTheme.colors.messageFromMeBackground,
|
||||
|
||||
Reference in New Issue
Block a user