Skip to content

Commit 041b655

Browse files
committed
Use ElementLogoAtom instead of png. Fixes #894
1 parent f12dc56 commit 041b655

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

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

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@
1616

1717
package io.element.android.features.onboarding.impl
1818

19-
import androidx.compose.foundation.Image
2019
import androidx.compose.foundation.layout.Box
2120
import androidx.compose.foundation.layout.Column
2221
import androidx.compose.foundation.layout.Spacer
2322
import androidx.compose.foundation.layout.fillMaxSize
2423
import androidx.compose.foundation.layout.fillMaxWidth
2524
import androidx.compose.foundation.layout.height
2625
import androidx.compose.foundation.layout.padding
27-
import androidx.compose.foundation.layout.size
2826
import androidx.compose.foundation.layout.width
2927
import androidx.compose.material.icons.Icons
3028
import androidx.compose.material.icons.filled.QrCode
@@ -33,12 +31,13 @@ import androidx.compose.runtime.Composable
3331
import androidx.compose.ui.Alignment.Companion.CenterHorizontally
3432
import androidx.compose.ui.BiasAlignment
3533
import androidx.compose.ui.Modifier
36-
import androidx.compose.ui.res.painterResource
3734
import androidx.compose.ui.res.stringResource
3835
import androidx.compose.ui.text.style.TextAlign
3936
import androidx.compose.ui.tooling.preview.PreviewParameter
4037
import androidx.compose.ui.unit.dp
4138
import androidx.compose.ui.unit.sp
39+
import io.element.android.libraries.designsystem.atomic.atoms.ElementLogoAtom
40+
import io.element.android.libraries.designsystem.atomic.atoms.ElementLogoAtomSize
4241
import io.element.android.libraries.designsystem.atomic.molecules.ButtonColumnMolecule
4342
import io.element.android.libraries.designsystem.atomic.pages.OnBoardingPage
4443
import io.element.android.libraries.designsystem.preview.DayNightPreviews
@@ -84,10 +83,6 @@ fun OnBoardingView(
8483

8584
@Composable
8685
private fun OnBoardingContent(modifier: Modifier = Modifier) {
87-
// Note: having a night variant of R.drawable.onboarding_icon in the folder `drawable-night` is working
88-
// at runtime, but is not in Android Studio Preview. So I prefer to handle this manually.
89-
val isLight = ElementTheme.colors.isLight
90-
val iconDrawableRes = if (isLight) R.drawable.onboarding_icon_light else R.drawable.onboarding_icon_dark
9186
Box(
9287
modifier = modifier.fillMaxSize(),
9388
) {
@@ -98,14 +93,9 @@ private fun OnBoardingContent(modifier: Modifier = Modifier) {
9893
verticalBias = -0.4f
9994
)
10095
) {
101-
// Dark and light icon does not have the same size, add padding to the smaller one
102-
val imagePadding = if (isLight) 28.dp else 0.dp
103-
Image(
104-
modifier = Modifier
105-
.size(278.dp)
106-
.padding(imagePadding),
107-
painter = painterResource(id = iconDrawableRes),
108-
contentDescription = null,
96+
ElementLogoAtom(
97+
size = ElementLogoAtomSize.Huge,
98+
modifier = Modifier.padding(top = ElementLogoAtomSize.Huge.shadowRadius / 2)
10999
)
110100
}
111101
Box(
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)