Update icon and text when a room is a favorite.
This commit is contained in:
parent
fd9cc15763
commit
020484f605
3 changed files with 15 additions and 5 deletions
|
|
@ -589,9 +589,14 @@ private fun FavoriteItem(
|
|||
isFavorite: Boolean,
|
||||
onFavoriteChanges: (Boolean) -> Unit,
|
||||
) {
|
||||
val (textResId, icon) = if (isFavorite) {
|
||||
CommonStrings.common_favourited to CompoundIcons.FavouriteSolid()
|
||||
} else {
|
||||
CommonStrings.common_favourite to CompoundIcons.Favourite()
|
||||
}
|
||||
PreferenceSwitch(
|
||||
icon = CompoundIcons.Favourite(),
|
||||
title = stringResource(id = CommonStrings.common_favourite),
|
||||
icon = icon,
|
||||
title = stringResource(id = textResId),
|
||||
isChecked = isFavorite,
|
||||
onCheckedChange = onFavoriteChanges
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue