Update text colors when the state is disabled.
This commit is contained in:
committed by
Benoit Marty
parent
5d2246569f
commit
91369e9455
@@ -50,6 +50,7 @@ fun CheckableUserRow(
|
||||
avatarData = data.avatarData,
|
||||
name = data.name,
|
||||
subtext = data.subtext,
|
||||
enabled = enabled,
|
||||
)
|
||||
}
|
||||
is CheckableUserRowData.Unresolved -> {
|
||||
@@ -57,11 +58,12 @@ fun CheckableUserRow(
|
||||
modifier = rowModifier,
|
||||
avatarData = data.avatarData,
|
||||
id = data.id,
|
||||
enabled = enabled,
|
||||
)
|
||||
}
|
||||
}
|
||||
SelectedIndicatorAtom(
|
||||
modifier = modifier.padding(end = 24.dp),
|
||||
modifier = Modifier.padding(end = 24.dp),
|
||||
checked = checked,
|
||||
enabled = enabled,
|
||||
)
|
||||
|
||||
@@ -28,7 +28,7 @@ fun MatrixUserRow(
|
||||
name = matrixUser.getBestName(),
|
||||
subtext = if (matrixUser.displayName.isNullOrEmpty()) null else matrixUser.userId.value,
|
||||
modifier = modifier,
|
||||
trailingContent,
|
||||
trailingContent = trailingContent,
|
||||
)
|
||||
|
||||
@PreviewsDayNight
|
||||
|
||||
@@ -39,6 +39,7 @@ fun UnresolvedUserRow(
|
||||
avatarData: AvatarData,
|
||||
id: String,
|
||||
modifier: Modifier = Modifier,
|
||||
enabled: Boolean = true,
|
||||
) {
|
||||
Row(
|
||||
modifier = modifier
|
||||
@@ -61,7 +62,7 @@ fun UnresolvedUserRow(
|
||||
text = id,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
color = ElementTheme.colors.textPrimary,
|
||||
color = if (enabled) ElementTheme.colors.textPrimary else ElementTheme.colors.textDisabled,
|
||||
style = ElementTheme.typography.fontBodyLgMedium,
|
||||
)
|
||||
|
||||
@@ -78,11 +79,11 @@ fun UnresolvedUserRow(
|
||||
.size(18.dp)
|
||||
.align(Alignment.Top)
|
||||
.padding(2.dp),
|
||||
tint = ElementTheme.colors.iconCriticalPrimary,
|
||||
tint = if (enabled) ElementTheme.colors.iconCriticalPrimary else ElementTheme.colors.iconDisabled,
|
||||
)
|
||||
Text(
|
||||
text = stringResource(CommonStrings.common_invite_unknown_profile),
|
||||
color = ElementTheme.colors.textSecondary,
|
||||
color = if (enabled) ElementTheme.colors.textSecondary else ElementTheme.colors.textDisabled,
|
||||
style = ElementTheme.typography.fontBodySmRegular.copy(lineHeight = 16.sp),
|
||||
)
|
||||
}
|
||||
@@ -94,5 +95,8 @@ fun UnresolvedUserRow(
|
||||
@Composable
|
||||
internal fun UnresolvedUserRowPreview() = ElementThemedPreview {
|
||||
val matrixUser = aMatrixUser()
|
||||
UnresolvedUserRow(matrixUser.getAvatarData(size = AvatarSize.UserListItem), matrixUser.userId.value)
|
||||
Column {
|
||||
UnresolvedUserRow(matrixUser.getAvatarData(size = AvatarSize.UserListItem), matrixUser.userId.value)
|
||||
UnresolvedUserRow(matrixUser.getAvatarData(size = AvatarSize.UserListItem), matrixUser.userId.value, enabled = false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ internal fun UserRow(
|
||||
name: String,
|
||||
subtext: String?,
|
||||
modifier: Modifier = Modifier,
|
||||
enabled: Boolean = true,
|
||||
trailingContent: @Composable (() -> Unit)? = null,
|
||||
) {
|
||||
Row(
|
||||
@@ -54,14 +55,14 @@ internal fun UserRow(
|
||||
text = name,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
color = ElementTheme.colors.textPrimary,
|
||||
color = if (enabled) ElementTheme.colors.textPrimary else ElementTheme.colors.textDisabled,
|
||||
style = ElementTheme.typography.fontBodyLgRegular,
|
||||
)
|
||||
// Id
|
||||
subtext?.let {
|
||||
Text(
|
||||
text = subtext,
|
||||
color = ElementTheme.colors.textSecondary,
|
||||
color = if (enabled) ElementTheme.colors.textSecondary else ElementTheme.colors.textDisabled,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
style = ElementTheme.typography.fontBodySmRegular,
|
||||
|
||||
Reference in New Issue
Block a user