mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Update icon and text when a room is a favorite.
This commit is contained in:
+7
-2
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user