Skip to content

Commit af08d91

Browse files
authored
Merge pull request #4323 from element-hq/feature/bma/compoundIcons
Replace Material icons with Compound icons wherever it's possible
2 parents 03ed740 + 78c90b7 commit af08d91

File tree

221 files changed

+446
-481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+446
-481
lines changed

features/location/api/src/main/kotlin/io/element/android/features/location/api/internal/StaticMapPlaceholder.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import androidx.compose.foundation.clickable
1212
import androidx.compose.foundation.layout.Box
1313
import androidx.compose.foundation.layout.Column
1414
import androidx.compose.foundation.layout.size
15-
import androidx.compose.material.icons.Icons
16-
import androidx.compose.material.icons.filled.Refresh
1715
import androidx.compose.runtime.Composable
1816
import androidx.compose.ui.Alignment
1917
import androidx.compose.ui.Modifier
@@ -23,6 +21,7 @@ import androidx.compose.ui.res.stringResource
2321
import androidx.compose.ui.tooling.preview.PreviewParameter
2422
import androidx.compose.ui.unit.Dp
2523
import androidx.compose.ui.unit.dp
24+
import io.element.android.compound.tokens.generated.CompoundIcons
2625
import io.element.android.features.location.api.R
2726
import io.element.android.libraries.designsystem.preview.ElementPreview
2827
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
@@ -60,7 +59,7 @@ internal fun StaticMapPlaceholder(
6059
horizontalAlignment = Alignment.CenterHorizontally,
6160
) {
6261
Icon(
63-
imageVector = Icons.Default.Refresh,
62+
imageVector = CompoundIcons.Restart(),
6463
contentDescription = null
6564
)
6665
Text(text = stringResource(id = CommonStrings.action_static_map_load))

features/location/impl/src/main/kotlin/io/element/android/features/location/impl/show/ShowLocationView.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ import androidx.compose.foundation.layout.consumeWindowInsets
1212
import androidx.compose.foundation.layout.fillMaxSize
1313
import androidx.compose.foundation.layout.fillMaxWidth
1414
import androidx.compose.foundation.layout.padding
15-
import androidx.compose.material.icons.Icons
16-
import androidx.compose.material.icons.filled.LocationSearching
17-
import androidx.compose.material.icons.filled.MyLocation
1815
import androidx.compose.material3.ExperimentalMaterial3Api
1916
import androidx.compose.runtime.Composable
2017
import androidx.compose.runtime.LaunchedEffect
@@ -132,8 +129,8 @@ fun ShowLocationView(
132129
onClick = { state.eventSink(ShowLocationEvents.TrackMyLocation(true)) },
133130
) {
134131
when (state.isTrackMyLocation) {
135-
false -> Icon(imageVector = Icons.Default.LocationSearching, contentDescription = null)
136-
true -> Icon(imageVector = Icons.Default.MyLocation, contentDescription = null)
132+
false -> Icon(imageVector = CompoundIcons.LocationNavigator(), contentDescription = null)
133+
true -> Icon(imageVector = CompoundIcons.LocationNavigatorCentred(), contentDescription = null)
137134
}
138135
}
139136
},

features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/setup/pin/SetupPinView.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import androidx.compose.foundation.layout.imePadding
1616
import androidx.compose.foundation.layout.padding
1717
import androidx.compose.foundation.rememberScrollState
1818
import androidx.compose.foundation.verticalScroll
19-
import androidx.compose.material.icons.Icons
20-
import androidx.compose.material.icons.filled.Lock
2119
import androidx.compose.material3.ExperimentalMaterial3Api
2220
import androidx.compose.runtime.Composable
2321
import androidx.compose.runtime.LaunchedEffect
@@ -29,6 +27,7 @@ import androidx.compose.ui.focus.focusRequester
2927
import androidx.compose.ui.res.stringResource
3028
import androidx.compose.ui.tooling.preview.PreviewParameter
3129
import androidx.compose.ui.unit.dp
30+
import io.element.android.compound.tokens.generated.CompoundIcons
3231
import io.element.android.features.lockscreen.impl.R
3332
import io.element.android.features.lockscreen.impl.components.PinEntryTextField
3433
import io.element.android.features.lockscreen.impl.setup.pin.validation.SetupPinFailure
@@ -89,7 +88,7 @@ private fun SetupPinHeader(
8988
stringResource(id = R.string.screen_app_lock_setup_choose_pin)
9089
},
9190
subTitle = stringResource(id = R.string.screen_app_lock_setup_pin_context, appName),
92-
iconStyle = BigIcon.Style.Default(Icons.Filled.Lock),
91+
iconStyle = BigIcon.Style.Default(CompoundIcons.LockSolid()),
9392
)
9493
}
9594
}

features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/unlock/PinUnlockView.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ import androidx.compose.foundation.layout.padding
2525
import androidx.compose.foundation.layout.size
2626
import androidx.compose.foundation.layout.systemBarsPadding
2727
import androidx.compose.foundation.shape.CircleShape
28-
import androidx.compose.material.icons.Icons
29-
import androidx.compose.material.icons.filled.Lock
3028
import androidx.compose.runtime.Composable
3129
import androidx.compose.runtime.LaunchedEffect
3230
import androidx.compose.runtime.remember
@@ -41,6 +39,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameter
4139
import androidx.compose.ui.unit.dp
4240
import androidx.lifecycle.Lifecycle
4341
import io.element.android.compound.theme.ElementTheme
42+
import io.element.android.compound.tokens.generated.CompoundIcons
4443
import io.element.android.features.lockscreen.impl.R
4544
import io.element.android.features.lockscreen.impl.components.PinEntryTextField
4645
import io.element.android.features.lockscreen.impl.pin.model.PinDigit
@@ -290,13 +289,13 @@ private fun PinUnlockHeader(
290289
horizontalAlignment = Alignment.CenterHorizontally,
291290
) {
292291
if (isInAppUnlock) {
293-
BigIcon(style = BigIcon.Style.Default(Icons.Filled.Lock))
292+
BigIcon(style = BigIcon.Style.Default(CompoundIcons.LockSolid()))
294293
} else {
295294
Icon(
296295
modifier = Modifier
297296
.size(32.dp),
298297
tint = ElementTheme.colors.iconPrimary,
299-
imageVector = Icons.Filled.Lock,
298+
imageVector = CompoundIcons.LockSolid(),
300299
contentDescription = null,
301300
)
302301
}

features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/changeaccountprovider/ChangeAccountProviderView.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ import androidx.compose.foundation.layout.imePadding
1919
import androidx.compose.foundation.layout.padding
2020
import androidx.compose.foundation.rememberScrollState
2121
import androidx.compose.foundation.verticalScroll
22-
import androidx.compose.material.icons.Icons
23-
import androidx.compose.material.icons.filled.Home
2422
import androidx.compose.material3.ExperimentalMaterial3Api
2523
import androidx.compose.runtime.Composable
2624
import androidx.compose.ui.Modifier
2725
import androidx.compose.ui.res.stringResource
2826
import androidx.compose.ui.tooling.preview.PreviewParameter
2927
import androidx.compose.ui.unit.dp
28+
import io.element.android.compound.tokens.generated.CompoundIcons
3029
import io.element.android.features.login.impl.R
3130
import io.element.android.features.login.impl.accountprovider.AccountProvider
3231
import io.element.android.features.login.impl.accountprovider.AccountProviderView
@@ -74,7 +73,7 @@ fun ChangeAccountProviderView(
7473
) {
7574
IconTitleSubtitleMolecule(
7675
modifier = Modifier.padding(top = 16.dp, bottom = 32.dp, start = 16.dp, end = 16.dp),
77-
iconStyle = BigIcon.Style.Default(Icons.Filled.Home),
76+
iconStyle = BigIcon.Style.Default(CompoundIcons.HomeSolid()),
7877
title = stringResource(id = R.string.screen_change_account_provider_title),
7978
subTitle = stringResource(id = R.string.screen_change_account_provider_subtitle),
8079
)

features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/confirmaccountprovider/ConfirmAccountProviderView.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ package io.element.android.features.login.impl.screens.confirmaccountprovider
99

1010
import androidx.compose.foundation.layout.fillMaxWidth
1111
import androidx.compose.foundation.layout.padding
12-
import androidx.compose.material.icons.Icons
13-
import androidx.compose.material.icons.filled.AccountCircle
1412
import androidx.compose.runtime.Composable
1513
import androidx.compose.runtime.derivedStateOf
1614
import androidx.compose.runtime.getValue
@@ -19,6 +17,7 @@ import androidx.compose.ui.Modifier
1917
import androidx.compose.ui.res.stringResource
2018
import androidx.compose.ui.tooling.preview.PreviewParameter
2119
import androidx.compose.ui.unit.dp
20+
import io.element.android.compound.tokens.generated.CompoundIcons
2221
import io.element.android.features.login.impl.R
2322
import io.element.android.features.login.impl.dialogs.SlidingSyncNotSupportedDialog
2423
import io.element.android.features.login.impl.error.ChangeServerError
@@ -60,7 +59,7 @@ fun ConfirmAccountProviderView(
6059
header = {
6160
IconTitleSubtitleMolecule(
6261
modifier = Modifier.padding(top = 60.dp),
63-
iconStyle = BigIcon.Style.Default(Icons.Filled.AccountCircle),
62+
iconStyle = BigIcon.Style.Default(CompoundIcons.UserProfileSolid()),
6463
title = stringResource(
6564
id = if (state.isAccountCreation) {
6665
R.string.screen_account_provider_signup_title

features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/loginpassword/LoginPasswordView.kt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import androidx.compose.foundation.rememberScrollState
2121
import androidx.compose.foundation.text.KeyboardActions
2222
import androidx.compose.foundation.text.KeyboardOptions
2323
import androidx.compose.foundation.verticalScroll
24-
import androidx.compose.material.icons.Icons
25-
import androidx.compose.material.icons.filled.AccountCircle
2624
import androidx.compose.material3.ExperimentalMaterial3Api
2725
import androidx.compose.runtime.Composable
2826
import androidx.compose.runtime.derivedStateOf
@@ -100,17 +98,17 @@ fun LoginPasswordView(
10098

10199
Column(
102100
modifier = Modifier
103-
.fillMaxSize()
104-
.imePadding()
105-
.padding(padding)
106-
.consumeWindowInsets(padding)
107-
.verticalScroll(state = scrollState)
108-
.padding(start = 20.dp, end = 20.dp, bottom = 20.dp),
101+
.fillMaxSize()
102+
.imePadding()
103+
.padding(padding)
104+
.consumeWindowInsets(padding)
105+
.verticalScroll(state = scrollState)
106+
.padding(start = 20.dp, end = 20.dp, bottom = 20.dp),
109107
) {
110108
// Title
111109
IconTitleSubtitleMolecule(
112110
modifier = Modifier.padding(top = 20.dp, start = 16.dp, end = 16.dp),
113-
iconStyle = BigIcon.Style.Default(Icons.Filled.AccountCircle),
111+
iconStyle = BigIcon.Style.Default(CompoundIcons.UserProfileSolid()),
114112
title = stringResource(
115113
id = R.string.screen_account_provider_signin_title,
116114
state.accountProvider.title
@@ -139,8 +137,8 @@ fun LoginPasswordView(
139137
onClick = ::submit,
140138
enabled = state.submitEnabled || isLoading,
141139
modifier = Modifier
142-
.fillMaxWidth()
143-
.testTag(TestTags.loginContinue)
140+
.fillMaxWidth()
141+
.testTag(TestTags.loginContinue)
144142
)
145143
Spacer(modifier = Modifier.height(48.dp))
146144
}

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemAudioView.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
package io.element.android.features.messages.impl.timeline.components.event
99

1010
import androidx.compose.foundation.layout.size
11-
import androidx.compose.material.icons.Icons
12-
import androidx.compose.material.icons.outlined.GraphicEq
1311
import androidx.compose.runtime.Composable
1412
import androidx.compose.ui.Modifier
1513
import androidx.compose.ui.tooling.preview.PreviewParameter
1614
import androidx.compose.ui.unit.dp
1715
import io.element.android.compound.theme.ElementTheme
16+
import io.element.android.compound.tokens.generated.CompoundIcons
1817
import io.element.android.features.messages.impl.timeline.components.layout.ContentAvoidingLayoutData
1918
import io.element.android.features.messages.impl.timeline.model.event.TimelineItemAudioContent
2019
import io.element.android.features.messages.impl.timeline.model.event.TimelineItemAudioContentProvider
@@ -36,7 +35,7 @@ fun TimelineItemAudioView(
3635
modifier = modifier,
3736
icon = {
3837
Icon(
39-
imageVector = Icons.Outlined.GraphicEq,
38+
imageVector = CompoundIcons.Audio(),
4039
contentDescription = null,
4140
tint = ElementTheme.colors.iconPrimary,
4241
modifier = Modifier

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemVideoView.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import androidx.compose.foundation.layout.height
2020
import androidx.compose.foundation.layout.padding
2121
import androidx.compose.foundation.layout.widthIn
2222
import androidx.compose.foundation.shape.RoundedCornerShape
23-
import androidx.compose.material.icons.Icons
24-
import androidx.compose.material.icons.filled.PlayArrow
2523
import androidx.compose.material3.LocalContentColor
2624
import androidx.compose.material3.LocalTextStyle
2725
import androidx.compose.runtime.Composable
@@ -45,6 +43,7 @@ import androidx.compose.ui.unit.dp
4543
import coil.compose.AsyncImage
4644
import coil.compose.AsyncImagePainter
4745
import io.element.android.compound.theme.ElementTheme
46+
import io.element.android.compound.tokens.generated.CompoundIcons
4847
import io.element.android.features.messages.impl.timeline.aTimelineItemEvent
4948
import io.element.android.features.messages.impl.timeline.components.ATimelineItemEventRow
5049
import io.element.android.features.messages.impl.timeline.components.layout.ContentAvoidingLayout
@@ -122,7 +121,7 @@ fun TimelineItemVideoView(
122121
contentAlignment = Alignment.Center,
123122
) {
124123
Image(
125-
Icons.Default.PlayArrow,
124+
imageVector = CompoundIcons.PlaySolid(),
126125
contentDescription = stringResource(id = CommonStrings.a11y_play),
127126
colorFilter = ColorFilter.tint(Color.White),
128127
)

features/onboarding/impl/src/main/kotlin/io/element/android/features/onboarding/impl/OnBoardingView.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import androidx.compose.foundation.layout.fillMaxSize
1515
import androidx.compose.foundation.layout.fillMaxWidth
1616
import androidx.compose.foundation.layout.height
1717
import androidx.compose.foundation.layout.padding
18-
import androidx.compose.material.icons.Icons
19-
import androidx.compose.material.icons.filled.QrCode
2018
import androidx.compose.runtime.Composable
2119
import androidx.compose.ui.Alignment.Companion.CenterHorizontally
2220
import androidx.compose.ui.BiasAlignment
@@ -27,6 +25,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameter
2725
import androidx.compose.ui.unit.dp
2826
import androidx.compose.ui.unit.sp
2927
import io.element.android.compound.theme.ElementTheme
28+
import io.element.android.compound.tokens.generated.CompoundIcons
3029
import io.element.android.libraries.designsystem.atomic.atoms.ElementLogoAtom
3130
import io.element.android.libraries.designsystem.atomic.atoms.ElementLogoAtomSize
3231
import io.element.android.libraries.designsystem.atomic.molecules.ButtonColumnMolecule
@@ -136,7 +135,7 @@ private fun OnBoardingButtons(
136135
if (state.canLoginWithQrCode) {
137136
Button(
138137
text = stringResource(id = R.string.screen_onboarding_sign_in_with_qr_code),
139-
leadingIcon = IconSource.Vector(Icons.Default.QrCode),
138+
leadingIcon = IconSource.Vector(CompoundIcons.QrCode()),
140139
onClick = onSignInWithQrCode,
141140
modifier = Modifier.fillMaxWidth()
142141
)

0 commit comments

Comments
 (0)