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 896bd4126e
commit b69cb8175a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
1013 changed files with 1945 additions and 3061 deletions

View file

@ -24,8 +24,6 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.GraphicEq
import androidx.compose.material.icons.outlined.Image
import androidx.compose.material.icons.outlined.VideoCameraBack
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
@ -42,7 +40,6 @@ import io.element.android.libraries.designsystem.components.PinIcon
import io.element.android.libraries.designsystem.preview.ElementPreview
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
import io.element.android.libraries.designsystem.theme.components.Icon
import io.element.android.libraries.designsystem.utils.CommonDrawables
import io.element.android.libraries.matrix.api.media.MediaSource
import io.element.android.libraries.matrix.ui.media.MediaRequestData
import kotlinx.parcelize.Parcelize
@ -82,13 +79,13 @@ fun AttachmentThumbnail(
when (info.type) {
AttachmentThumbnailType.Image -> {
Icon(
imageVector = Icons.Outlined.Image,
imageVector = CompoundIcons.Image(),
contentDescription = info.textContent,
)
}
AttachmentThumbnailType.Video -> {
Icon(
imageVector = Icons.Outlined.VideoCameraBack,
imageVector = CompoundIcons.VideoCall(),
contentDescription = info.textContent,
)
}
@ -100,13 +97,13 @@ fun AttachmentThumbnail(
}
AttachmentThumbnailType.Voice -> {
Icon(
resourceId = CommonDrawables.ic_voice_attachment,
imageVector = CompoundIcons.MicOnSolid(),
contentDescription = info.textContent,
)
}
AttachmentThumbnailType.File -> {
Icon(
resourceId = CommonDrawables.ic_attachment,
imageVector = CompoundIcons.Attachment(),
contentDescription = info.textContent,
modifier = Modifier.rotate(-45f)
)
@ -125,7 +122,7 @@ fun AttachmentThumbnail(
}
AttachmentThumbnailType.Poll -> {
Icon(
imageVector = CompoundIcons.Polls,
imageVector = CompoundIcons.Polls(),
contentDescription = info.textContent,
)
}

View file

@ -34,11 +34,11 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.unit.dp
import io.element.android.compound.tokens.generated.CompoundIcons
import io.element.android.libraries.designsystem.components.avatar.Avatar
import io.element.android.libraries.designsystem.components.avatar.AvatarData
import io.element.android.libraries.designsystem.components.avatar.AvatarSize
import io.element.android.libraries.designsystem.theme.components.Icon
import io.element.android.libraries.designsystem.utils.CommonDrawables
@Composable
fun EditableAvatarView(
@ -86,7 +86,7 @@ fun EditableAvatarView(
) {
Icon(
modifier = Modifier.size(16.dp),
resourceId = CommonDrawables.ic_edit,
imageVector = CompoundIcons.EditSolid(),
contentDescription = null,
tint = MaterialTheme.colorScheme.onPrimary,
)

View file

@ -84,7 +84,7 @@ fun SelectedRoom(
),
) {
Icon(
imageVector = CompoundIcons.Close,
imageVector = CompoundIcons.Close(),
contentDescription = stringResource(id = CommonStrings.action_remove),
tint = MaterialTheme.colorScheme.onPrimary,
modifier = Modifier.padding(2.dp)

View file

@ -83,7 +83,7 @@ fun SelectedUser(
),
) {
Icon(
imageVector = CompoundIcons.Close,
imageVector = CompoundIcons.Close(),
contentDescription = stringResource(id = CommonStrings.action_remove),
tint = MaterialTheme.colorScheme.onPrimary,
modifier = Modifier.padding(2.dp)

View file

@ -78,7 +78,7 @@ fun UnresolvedUserRow(
.padding(top = 3.dp)
) {
Icon(
imageVector = CompoundIcons.Error,
imageVector = CompoundIcons.Error(),
contentDescription = null,
modifier = Modifier
.size(18.dp)

View file

@ -20,7 +20,6 @@ import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import androidx.compose.runtime.Immutable
import io.element.android.libraries.designsystem.icons.CompoundDrawables
import io.element.android.libraries.designsystem.utils.CommonDrawables
import io.element.android.libraries.ui.strings.CommonStrings
@Immutable
@ -31,17 +30,17 @@ sealed class AvatarAction(
) {
data object TakePhoto : AvatarAction(
titleResId = CommonStrings.action_take_photo,
iconResourceId = CommonDrawables.ic_take_photo_camera,
iconResourceId = CompoundDrawables.ic_compound_take_photo,
)
data object ChoosePhoto : AvatarAction(
titleResId = CommonStrings.action_choose_photo,
iconResourceId = CommonDrawables.ic_image,
iconResourceId = CompoundDrawables.ic_compound_image,
)
data object Remove : AvatarAction(
titleResId = CommonStrings.action_remove,
iconResourceId = CompoundDrawables.ic_delete,
iconResourceId = CompoundDrawables.ic_compound_delete,
destructive = true
)
}