Update Compound to v0.0.5 and update icons (#2380)

Update Compound to `v0.0.5`:

- Make sure we fix all the breaking changes.
- Update some icons to use the compound version instead.
-Replace icons with their Compound counterparts when possible.
- Clean up unused icons.
- Fix issues with incorrect icons or sizes being used after replacing the temporary icons with the Compound ones.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
Jorge Martin Espinosa 2024-02-12 17:41:58 +01:00 committed by GitHub
parent 274147ccd9
commit 973c57d401
1013 changed files with 1945 additions and 3061 deletions

View file

@ -248,7 +248,7 @@ private fun MainActionsSection(
if (roomNotificationSettings.mode == RoomNotificationMode.MUTE) {
MainActionButton(
title = stringResource(CommonStrings.common_unmute),
imageVector = CompoundIcons.NotificationsOff,
imageVector = CompoundIcons.NotificationsOff(),
onClick = {
state.eventSink(RoomDetailsEvent.UnmuteNotification)
},
@ -256,7 +256,7 @@ private fun MainActionsSection(
} else {
MainActionButton(
title = stringResource(CommonStrings.common_mute),
imageVector = CompoundIcons.Notifications,
imageVector = CompoundIcons.Notifications(),
onClick = {
state.eventSink(RoomDetailsEvent.MuteNotification)
},
@ -266,7 +266,7 @@ private fun MainActionsSection(
Spacer(modifier = Modifier.width(20.dp))
MainActionButton(
title = stringResource(R.string.screen_room_details_share_room_title),
imageVector = CompoundIcons.ShareAndroid,
imageVector = CompoundIcons.ShareAndroid(),
onClick = onShareRoom
)
}
@ -350,7 +350,7 @@ private fun NotificationSection(
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_room_details_notification_title)) },
supportingContent = { Text(text = subtitle) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Notifications)),
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Notifications())),
onClick = openRoomNotificationSettings,
)
}
@ -364,7 +364,7 @@ private fun MembersSection(
PreferenceCategory {
ListItem(
headlineContent = { Text(stringResource(CommonStrings.common_people)) },
leadingContent = ListItemContent.Icon(IconSource.Resource(CommonDrawables.ic_user)),
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.User())),
trailingContent = ListItemContent.Text(memberCount.toString()),
onClick = openRoomMemberList,
)
@ -378,7 +378,7 @@ private fun InviteSection(
PreferenceCategory {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_room_details_invite_people_title)) },
leadingContent = ListItemContent.Icon(IconSource.Resource(CommonDrawables.ic_user_add)),
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.UserAdd())),
onClick = invitePeople,
)
}
@ -391,7 +391,7 @@ private fun PollsSection(
PreferenceCategory {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_polls_history_title)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Polls)),
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Polls())),
onClick = openPollHistory,
)
}
@ -422,7 +422,7 @@ private fun OtherActionsSection(isDm: Boolean, onLeaveRoom: () -> Unit) {
)
Text(leaveText)
},
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Leave)),
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Leave())),
style = ListItemStyle.Destructive,
onClick = onLeaveRoom,
)

View file

@ -82,7 +82,7 @@ private fun PreferenceBlockUser(
if (isBlocked.orFalse()) {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_dm_details_unblock_user)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Block)),
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Block())),
onClick = { if (!isLoading) eventSink(RoomMemberDetailsEvents.UnblockUser(needsConfirmation = true)) },
trailingContent = if (isLoading) ListItemContent.Custom(loadingCurrentValue) else null,
style = ListItemStyle.Primary,
@ -90,7 +90,7 @@ private fun PreferenceBlockUser(
} else {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_dm_details_block_user)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Block)),
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Block())),
style = ListItemStyle.Destructive,
onClick = { if (!isLoading) eventSink(RoomMemberDetailsEvents.BlockUser(needsConfirmation = true)) },
trailingContent = if (isLoading) ListItemContent.Custom(loadingCurrentValue) else null,

View file

@ -111,7 +111,7 @@ private fun StartDMSection(
) {
ListItem(
headlineContent = { Text(stringResource(CommonStrings.common_direct_chat)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Chat)),
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Chat())),
style = ListItemStyle.Primary,
onClick = onStartDMClicked,
)

View file

@ -31,7 +31,7 @@ fun RoomMemberMainActionsSection(onShareUser: () -> Unit, modifier: Modifier = M
Row(modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center) {
MainActionButton(
title = stringResource(CommonStrings.action_share),
imageVector = CompoundIcons.ShareAndroid,
imageVector = CompoundIcons.ShareAndroid(),
onClick = onShareUser
)
}