@@ -10,34 +10,44 @@ package io.element.android.appicon.element
10
10
import androidx.compose.foundation.Image
11
11
import androidx.compose.foundation.background
12
12
import androidx.compose.foundation.layout.Box
13
- import androidx.compose.foundation.layout.size
14
13
import androidx.compose.foundation.shape.CircleShape
15
- import androidx.compose.foundation.shape.RoundedCornerShape
16
14
import androidx.compose.runtime.Composable
17
- import androidx.compose.ui.Alignment
18
15
import androidx.compose.ui.Modifier
19
16
import androidx.compose.ui.draw.clip
20
17
import androidx.compose.ui.graphics.Color
21
18
import androidx.compose.ui.graphics.ColorFilter
22
19
import androidx.compose.ui.res.painterResource
23
20
import androidx.compose.ui.tooling.preview.Preview
24
- import androidx.compose.ui.unit.dp
25
21
26
22
@Preview
27
23
@Composable
28
24
internal fun IconPreview () {
29
25
Box {
30
- Image (painter = painterResource(id = R .mipmap.ic_launcher_background), contentDescription = null )
31
- Image (painter = painterResource(id = R .mipmap.ic_launcher_foreground), contentDescription = null )
26
+ Image (
27
+ modifier = Modifier .matchParentSize(),
28
+ painter = painterResource(id = R .drawable.ic_launcher_background),
29
+ contentDescription = null ,
30
+ )
31
+ Image (
32
+ painter = painterResource(id = R .mipmap.ic_launcher_foreground),
33
+ contentDescription = null ,
34
+ )
32
35
}
33
36
}
34
37
35
38
@Preview
36
39
@Composable
37
40
internal fun RoundIconPreview () {
38
41
Box (modifier = Modifier .clip(shape = CircleShape )) {
39
- Image (painter = painterResource(id = R .mipmap.ic_launcher_background), contentDescription = null )
40
- Image (painter = painterResource(id = R .mipmap.ic_launcher_foreground), contentDescription = null )
42
+ Image (
43
+ modifier = Modifier .matchParentSize(),
44
+ painter = painterResource(id = R .drawable.ic_launcher_background),
45
+ contentDescription = null ,
46
+ )
47
+ Image (
48
+ painter = painterResource(id = R .mipmap.ic_launcher_foreground),
49
+ contentDescription = null ,
50
+ )
41
51
}
42
52
}
43
53
@@ -46,10 +56,7 @@ internal fun RoundIconPreview() {
46
56
internal fun MonochromeIconPreview () {
47
57
Box (
48
58
modifier = Modifier
49
- .size(108 .dp)
50
- .background(Color (0xFF2F3133 ))
51
- .clip(shape = RoundedCornerShape (32 .dp)),
52
- contentAlignment = Alignment .Center
59
+ .background(Color (0xFF2F3133 )),
53
60
) {
54
61
Image (
55
62
painter = painterResource(id = R .mipmap.ic_launcher_monochrome),
0 commit comments