@@ -7,8 +7,12 @@ import androidx.compose.foundation.background
7
7
import androidx.compose.foundation.layout.Box
8
8
import androidx.compose.foundation.layout.Column
9
9
import androidx.compose.foundation.layout.fillMaxSize
10
+ import androidx.compose.foundation.layout.navigationBarsPadding
10
11
import androidx.compose.foundation.layout.padding
11
12
import androidx.compose.foundation.layout.size
13
+ import androidx.compose.foundation.layout.statusBarsPadding
14
+ import androidx.compose.foundation.text.InlineTextContent
15
+ import androidx.compose.foundation.text.appendInlineContent
12
16
import androidx.compose.material.icons.Icons
13
17
import androidx.compose.material.icons.outlined.Info
14
18
import androidx.compose.material3.Button
@@ -25,11 +29,17 @@ import androidx.compose.runtime.saveable.rememberSaveable
25
29
import androidx.compose.runtime.setValue
26
30
import androidx.compose.ui.Alignment
27
31
import androidx.compose.ui.Modifier
32
+ import androidx.compose.ui.graphics.vector.ImageVector
28
33
import androidx.compose.ui.res.painterResource
29
34
import androidx.compose.ui.res.stringResource
35
+ import androidx.compose.ui.res.vectorResource
36
+ import androidx.compose.ui.text.Placeholder
37
+ import androidx.compose.ui.text.PlaceholderVerticalAlign
38
+ import androidx.compose.ui.text.buildAnnotatedString
30
39
import androidx.compose.ui.text.font.FontWeight
31
40
import androidx.compose.ui.tooling.preview.Preview
32
41
import androidx.compose.ui.unit.dp
42
+ import androidx.compose.ui.unit.sp
33
43
import com.infbyte.amuze.R
34
44
35
45
@Composable
@@ -38,18 +48,18 @@ fun NoMediaPermissionScreen(
38
48
@StringRes action : Int ,
39
49
onStartAction : () -> Unit ,
40
50
onExit : () -> Unit ,
41
- about : @Composable (() -> Unit ) -> Unit
51
+ aboutApp : @Composable (() -> Unit ) -> Unit
42
52
) {
43
53
Box (
44
54
Modifier
45
55
.background(MaterialTheme .colorScheme.background)
46
- .fillMaxSize(),
56
+ .fillMaxSize().navigationBarsPadding().statusBarsPadding() ,
47
57
contentAlignment = Alignment .Center
48
58
) {
49
59
var showAbout by rememberSaveable { mutableStateOf(false ) }
50
60
51
61
if (showAbout) {
52
- about { showAbout = false }
62
+ aboutApp { showAbout = false }
53
63
return
54
64
}
55
65
@@ -65,26 +75,30 @@ fun NoMediaPermissionScreen(
65
75
Icon (Icons .Outlined .Info , contentDescription = " " )
66
76
}
67
77
Column (horizontalAlignment = Alignment .CenterHorizontally ) {
68
- Box {
69
- Text (
70
- stringResource(R .string.amuze_intro_1),
71
- Modifier .padding(top = 31 .dp),
72
- style = MaterialTheme .typography.titleLarge.copy(fontWeight = FontWeight .Bold )
73
- )
74
- Icon (
75
- painter = painterResource(appIcon),
76
- contentDescription = " " ,
77
- Modifier
78
- .padding(start = 112 .dp)
79
- .size(72 .dp),
80
- tint = MaterialTheme .colorScheme.primary
81
- )
82
- Text (
83
- stringResource(R .string.amuze_intro_2),
84
- Modifier .padding(start = 162 .dp, top = 31 .dp),
85
- style = MaterialTheme .typography.titleLarge.copy(fontWeight = FontWeight .Bold )
86
- )
78
+ val id = " appIcon"
79
+ val inlineContent = mapOf (
80
+ id to InlineTextContent (
81
+ Placeholder (32 .sp, 32 .sp, PlaceholderVerticalAlign .AboveBaseline )
82
+ ) {
83
+ Icon (
84
+ ImageVector .vectorResource(appIcon),
85
+ contentDescription = " " ,
86
+ tint = MaterialTheme .colorScheme.primary
87
+ )
88
+ }
89
+ )
90
+ val text = buildAnnotatedString {
91
+ append(" ${stringResource(R .string.amuze_intro_1)} " )
92
+ appendInlineContent(id, " [icon]" )
93
+ append(stringResource(R .string.amuze_intro_2))
87
94
}
95
+
96
+ Text (
97
+ text,
98
+ Modifier .padding(start = 0 .dp, top = 31 .dp),
99
+ inlineContent = inlineContent,
100
+ style = MaterialTheme .typography.titleLarge.copy(fontWeight = FontWeight .Bold )
101
+ )
88
102
Button (
89
103
onClick = { onStartAction() },
90
104
Modifier .padding(top = 64 .dp),
0 commit comments