expo-dev-launcher 6.0.0 → 6.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/android/build.gradle +3 -3
- package/android/src/debug/java/expo/modules/devlauncher/compose/BindingView.kt +4 -2
- package/android/src/debug/java/expo/modules/devlauncher/compose/DevLauncherBottomTabsNavigator.kt +4 -2
- package/android/src/debug/java/expo/modules/devlauncher/compose/models/BranchesViewModel.kt +57 -13
- package/android/src/debug/java/expo/modules/devlauncher/compose/primitives/Accordion.kt +40 -45
- package/android/src/debug/java/expo/modules/devlauncher/compose/routes/Profile.kt +98 -18
- package/android/src/debug/java/expo/modules/devlauncher/compose/routes/Updates.kt +3 -1
- package/android/src/debug/java/expo/modules/devlauncher/compose/screens/BranchScreen.kt +171 -146
- package/android/src/debug/java/expo/modules/devlauncher/compose/screens/BranchesScreen.kt +248 -150
- package/android/src/debug/java/expo/modules/devlauncher/compose/screens/CrashReportScreen.kt +75 -46
- package/android/src/debug/java/expo/modules/devlauncher/compose/screens/HomeScreen.kt +234 -238
- package/android/src/debug/java/expo/modules/devlauncher/compose/screens/NoUpdatesScreen.kt +52 -35
- package/android/src/debug/java/expo/modules/devlauncher/compose/screens/SettingsScreen.kt +246 -107
- package/android/src/debug/java/expo/modules/devlauncher/compose/ui/AccountAvatar.kt +17 -9
- package/android/src/debug/java/expo/modules/devlauncher/compose/ui/AccountSelector.kt +63 -46
- package/android/src/debug/java/expo/modules/devlauncher/compose/ui/ActionButton.kt +51 -3
- package/android/src/debug/java/expo/modules/devlauncher/compose/ui/AppHeader.kt +70 -44
- package/android/src/debug/java/expo/modules/devlauncher/compose/ui/BottomSheet.kt +42 -2
- package/android/src/debug/java/expo/modules/devlauncher/compose/ui/BottomTabBar.kt +14 -10
- package/android/src/debug/java/expo/modules/devlauncher/compose/ui/BottomTabButton.kt +46 -23
- package/android/src/debug/java/expo/modules/devlauncher/compose/ui/DevelopmentServerHelp.kt +23 -16
- package/android/src/debug/java/expo/modules/devlauncher/compose/ui/RunningAppCard.kt +65 -34
- package/android/src/debug/java/expo/modules/devlauncher/compose/ui/ScreenHeaderContainer.kt +0 -5
- package/android/src/debug/java/expo/modules/devlauncher/compose/ui/ServerUrlInput.kt +56 -17
- package/android/src/debug/java/expo/modules/devlauncher/compose/ui/SignUp.kt +20 -27
- package/android/src/main/res/drawable/arrow_right.xml +9 -0
- package/android/src/main/res/drawable/check_circle.xml +10 -0
- package/android/src/main/res/drawable/chevron_right.xml +10 -0
- package/android/src/main/res/drawable/copy.xml +13 -0
- package/android/src/main/res/drawable/expo_logo.xml +9 -0
- package/android/src/main/res/drawable/home.xml +10 -0
- package/android/src/main/res/drawable/inspect.xml +10 -0
- package/android/src/main/res/drawable/log_in.xml +12 -0
- package/android/src/main/res/drawable/pulse.xml +10 -0
- package/android/src/main/res/drawable/reload.xml +10 -0
- package/android/src/main/res/drawable/scan.xml +42 -0
- package/android/src/main/res/drawable/settings.xml +14 -0
- package/android/src/main/res/drawable/show_at_launch.xml +12 -0
- package/android/src/main/res/drawable/signal.xml +26 -0
- package/android/src/main/res/drawable/user.xml +13 -0
- package/ios/EXDevLauncherController.m +23 -4
- package/ios/SwiftUI/CrashReportView.swift +11 -3
- package/ios/SwiftUI/DevLauncherViews.swift +18 -2
- package/ios/SwiftUI/DevServersView.swift +2 -2
- package/ios/SwiftUI/HomeTabView.swift +4 -0
- package/ios/SwiftUI/Navigation/Navigation.swift +3 -0
- package/ios/SwiftUI/SettingsTabView.swift +4 -3
- package/package.json +4 -4
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
package expo.modules.devlauncher.compose.screens
|
|
2
2
|
|
|
3
3
|
import androidx.compose.foundation.Image
|
|
4
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
5
|
+
import androidx.compose.foundation.layout.Box
|
|
4
6
|
import androidx.compose.foundation.layout.Column
|
|
5
|
-
import androidx.compose.foundation.layout.Row
|
|
6
7
|
import androidx.compose.foundation.layout.fillMaxSize
|
|
8
|
+
import androidx.compose.foundation.layout.fillMaxWidth
|
|
7
9
|
import androidx.compose.foundation.layout.padding
|
|
10
|
+
import androidx.compose.foundation.layout.size
|
|
8
11
|
import androidx.compose.runtime.Composable
|
|
9
12
|
import androidx.compose.ui.Alignment
|
|
10
13
|
import androidx.compose.ui.Modifier
|
|
@@ -17,50 +20,62 @@ import androidx.compose.ui.text.style.TextAlign
|
|
|
17
20
|
import androidx.compose.ui.text.style.TextDecoration
|
|
18
21
|
import androidx.compose.ui.text.withLink
|
|
19
22
|
import androidx.compose.ui.tooling.preview.Preview
|
|
23
|
+
import androidx.compose.ui.unit.dp
|
|
20
24
|
import expo.modules.devlauncher.R
|
|
25
|
+
import expo.modules.devlauncher.compose.DefaultScreenContainer
|
|
21
26
|
import expo.modules.devlauncher.compose.ui.AppHeader
|
|
22
|
-
import expo.modules.
|
|
23
|
-
import expo.modules.devmenu.compose.primitives.
|
|
24
|
-
import expo.modules.devmenu.compose.primitives.Spacer
|
|
25
|
-
import expo.modules.devmenu.compose.primitives.Text
|
|
26
|
-
import expo.modules.devmenu.compose.theme.Theme
|
|
27
|
+
import expo.modules.devmenu.compose.newtheme.NewAppTheme
|
|
28
|
+
import expo.modules.devmenu.compose.primitives.NewText
|
|
27
29
|
|
|
28
30
|
@Composable
|
|
29
31
|
fun NoUpdatesScreen(onProfileClick: () -> Unit = {}) {
|
|
30
|
-
Column(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
)
|
|
32
|
+
Column(
|
|
33
|
+
modifier = Modifier.padding(horizontal = NewAppTheme.spacing.`4`)
|
|
34
|
+
) {
|
|
35
|
+
Box(modifier = Modifier.padding(vertical = NewAppTheme.spacing.`4`)) {
|
|
36
|
+
AppHeader(onProfileClick = onProfileClick)
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
Box(
|
|
40
|
+
contentAlignment = Alignment.Center,
|
|
41
|
+
modifier = Modifier.fillMaxSize()
|
|
42
|
+
) {
|
|
43
|
+
Column(
|
|
44
|
+
horizontalAlignment = Alignment.CenterHorizontally,
|
|
45
|
+
verticalArrangement = Arrangement.spacedBy(NewAppTheme.spacing.`4`),
|
|
46
|
+
modifier = Modifier.fillMaxWidth()
|
|
47
|
+
) {
|
|
48
|
+
Image(
|
|
49
|
+
painter = painterResource(R.drawable.extensions_icon),
|
|
50
|
+
contentDescription = "Updates Screen",
|
|
51
|
+
modifier = Modifier.size(48.dp)
|
|
52
|
+
)
|
|
44
53
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
val annotatedString = buildAnnotatedString {
|
|
55
|
+
append("Extensions allow you to customize your development build\nwith additional capabilities. ")
|
|
56
|
+
withLink(
|
|
57
|
+
LinkAnnotation.Url(
|
|
58
|
+
"https://docs.expo.dev/develop/development-builds/development-workflows/",
|
|
59
|
+
TextLinkStyles(
|
|
60
|
+
style = SpanStyle(
|
|
61
|
+
textDecoration = TextDecoration.Underline,
|
|
62
|
+
color = NewAppTheme.colors.text.link
|
|
63
|
+
)
|
|
53
64
|
)
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
)
|
|
66
|
+
) {
|
|
67
|
+
append("Learn more.")
|
|
57
68
|
}
|
|
58
|
-
Text(
|
|
59
|
-
annotatedString,
|
|
60
|
-
fontSize = Theme.typography.small,
|
|
61
|
-
textAlign = TextAlign.Center
|
|
62
|
-
)
|
|
63
69
|
}
|
|
70
|
+
|
|
71
|
+
NewText(
|
|
72
|
+
annotatedString,
|
|
73
|
+
style = NewAppTheme.font.sm.merge(
|
|
74
|
+
color = NewAppTheme.colors.text.secondary,
|
|
75
|
+
textAlign = TextAlign.Center
|
|
76
|
+
),
|
|
77
|
+
color = NewAppTheme.colors.text.secondary
|
|
78
|
+
)
|
|
64
79
|
}
|
|
65
80
|
}
|
|
66
81
|
}
|
|
@@ -69,5 +84,7 @@ fun NoUpdatesScreen(onProfileClick: () -> Unit = {}) {
|
|
|
69
84
|
@Preview(showBackground = true)
|
|
70
85
|
@Composable
|
|
71
86
|
fun NoUpdatesScreenPreview() {
|
|
72
|
-
|
|
87
|
+
DefaultScreenContainer {
|
|
88
|
+
NoUpdatesScreen()
|
|
89
|
+
}
|
|
73
90
|
}
|
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
package expo.modules.devlauncher.compose.screens
|
|
2
2
|
|
|
3
|
-
import androidx.compose.foundation.
|
|
4
|
-
import androidx.compose.foundation.layout.Box
|
|
3
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
5
4
|
import androidx.compose.foundation.layout.Column
|
|
5
|
+
import androidx.compose.foundation.layout.Row
|
|
6
|
+
import androidx.compose.foundation.layout.fillMaxWidth
|
|
6
7
|
import androidx.compose.foundation.layout.padding
|
|
8
|
+
import androidx.compose.foundation.layout.size
|
|
9
|
+
import androidx.compose.foundation.layout.statusBarsPadding
|
|
7
10
|
import androidx.compose.runtime.Composable
|
|
11
|
+
import androidx.compose.ui.Alignment
|
|
8
12
|
import androidx.compose.ui.Modifier
|
|
9
13
|
import androidx.compose.ui.platform.LocalContext
|
|
10
14
|
import androidx.compose.ui.res.painterResource
|
|
15
|
+
import androidx.compose.ui.text.TextStyle
|
|
16
|
+
import androidx.compose.ui.text.font.FontWeight
|
|
11
17
|
import androidx.compose.ui.tooling.preview.Preview
|
|
18
|
+
import androidx.compose.ui.unit.dp
|
|
19
|
+
import androidx.compose.ui.unit.sp
|
|
20
|
+
import com.composeunstyled.Button
|
|
21
|
+
import com.composeunstyled.Icon
|
|
12
22
|
import expo.modules.devlauncher.R
|
|
23
|
+
import expo.modules.devlauncher.compose.DefaultScreenContainer
|
|
13
24
|
import expo.modules.devlauncher.compose.models.SettingsAction
|
|
14
25
|
import expo.modules.devlauncher.compose.models.SettingsState
|
|
15
|
-
import expo.modules.devlauncher.compose.ui.ScreenHeaderContainer
|
|
16
|
-
import expo.modules.devlauncher.compose.ui.SectionHeader
|
|
17
|
-
import expo.modules.devmenu.compose.utils.copyToClipboard
|
|
18
26
|
import expo.modules.devlauncher.services.ApplicationInfo
|
|
19
|
-
import expo.modules.devmenu.compose.
|
|
27
|
+
import expo.modules.devmenu.compose.newtheme.NewAppTheme
|
|
20
28
|
import expo.modules.devmenu.compose.primitives.Divider
|
|
21
|
-
import expo.modules.devmenu.compose.primitives.
|
|
29
|
+
import expo.modules.devmenu.compose.primitives.NewText
|
|
22
30
|
import expo.modules.devmenu.compose.primitives.RoundedSurface
|
|
23
31
|
import expo.modules.devmenu.compose.primitives.Spacer
|
|
24
|
-
import expo.modules.devmenu.compose.primitives.
|
|
25
|
-
import expo.modules.devmenu.compose.
|
|
26
|
-
import expo.modules.devmenu.compose.
|
|
27
|
-
import expo.modules.devmenu.compose.ui.MenuInfo
|
|
28
|
-
import expo.modules.devmenu.compose.ui.MenuSwitch
|
|
32
|
+
import expo.modules.devmenu.compose.primitives.ToggleSwitch
|
|
33
|
+
import expo.modules.devmenu.compose.ui.NewMenuButton
|
|
34
|
+
import expo.modules.devmenu.compose.utils.copyToClipboard
|
|
29
35
|
|
|
30
36
|
@Composable
|
|
31
37
|
fun SettingsScreen(
|
|
@@ -34,117 +40,248 @@ fun SettingsScreen(
|
|
|
34
40
|
) {
|
|
35
41
|
val context = LocalContext.current
|
|
36
42
|
|
|
37
|
-
Column(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
Column(
|
|
44
|
+
modifier = Modifier
|
|
45
|
+
.statusBarsPadding()
|
|
46
|
+
.padding(horizontal = NewAppTheme.spacing.`4`)
|
|
47
|
+
) {
|
|
48
|
+
Column(
|
|
49
|
+
horizontalAlignment = Alignment.CenterHorizontally,
|
|
50
|
+
verticalArrangement = Arrangement.spacedBy(NewAppTheme.spacing.`2`),
|
|
51
|
+
modifier = Modifier
|
|
52
|
+
.fillMaxWidth()
|
|
53
|
+
.padding(vertical = NewAppTheme.spacing.`6`)
|
|
54
|
+
) {
|
|
55
|
+
Icon(
|
|
56
|
+
painterResource(R.drawable.settings),
|
|
57
|
+
contentDescription = "Settings icon",
|
|
58
|
+
modifier = Modifier.size(48.dp)
|
|
59
|
+
)
|
|
43
60
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
onToggled = { onAction(SettingsAction.ToggleShowMenuAtLaunch(it)) }
|
|
61
|
+
NewText(
|
|
62
|
+
"Settings",
|
|
63
|
+
style = NewAppTheme.font.xxl.merge(
|
|
64
|
+
fontWeight = FontWeight.Bold
|
|
65
|
+
)
|
|
50
66
|
)
|
|
51
67
|
}
|
|
52
68
|
|
|
53
|
-
|
|
69
|
+
NewMenuButton(
|
|
70
|
+
icon = {
|
|
71
|
+
Icon(
|
|
72
|
+
painter = painterResource(R.drawable.show_at_launch),
|
|
73
|
+
contentDescription = "Show at launch icon",
|
|
74
|
+
tint = NewAppTheme.colors.icon.tertiary,
|
|
75
|
+
modifier = Modifier.size(20.dp)
|
|
76
|
+
)
|
|
77
|
+
},
|
|
78
|
+
content = {
|
|
79
|
+
NewText(
|
|
80
|
+
text = "Show menu at launch"
|
|
81
|
+
)
|
|
82
|
+
},
|
|
83
|
+
rightComponent = {
|
|
84
|
+
ToggleSwitch(
|
|
85
|
+
isToggled = state.showMenuAtLaunch
|
|
86
|
+
)
|
|
87
|
+
},
|
|
88
|
+
onClick = { onAction(SettingsAction.ToggleShowMenuAtLaunch(!state.showMenuAtLaunch)) }
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
Spacer(NewAppTheme.spacing.`6`)
|
|
54
92
|
|
|
55
|
-
|
|
56
|
-
"
|
|
93
|
+
NewText(
|
|
94
|
+
"MENU GESTURES",
|
|
95
|
+
style = NewAppTheme.font.sm.merge(
|
|
96
|
+
fontWeight = FontWeight.Medium,
|
|
97
|
+
fontFamily = NewAppTheme.font.mono
|
|
98
|
+
),
|
|
99
|
+
color = NewAppTheme.colors.text.quaternary
|
|
57
100
|
)
|
|
58
101
|
|
|
59
|
-
Spacer(
|
|
102
|
+
Spacer(NewAppTheme.spacing.`3`)
|
|
60
103
|
|
|
61
104
|
RoundedSurface {
|
|
62
105
|
Column {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
106
|
+
NewMenuButton(
|
|
107
|
+
withSurface = false,
|
|
108
|
+
icon = {
|
|
109
|
+
Icon(
|
|
110
|
+
painter = painterResource(R.drawable.pulse),
|
|
111
|
+
contentDescription = "Shake device icon",
|
|
112
|
+
tint = NewAppTheme.colors.icon.tertiary,
|
|
113
|
+
modifier = Modifier.size(20.dp)
|
|
71
114
|
)
|
|
72
115
|
},
|
|
73
|
-
|
|
74
|
-
|
|
116
|
+
content = {
|
|
117
|
+
NewText(
|
|
118
|
+
text = "Shake device"
|
|
119
|
+
)
|
|
120
|
+
},
|
|
121
|
+
rightComponent = {
|
|
122
|
+
ToggleSwitch(
|
|
123
|
+
isToggled = state.isShakeEnable
|
|
124
|
+
)
|
|
75
125
|
},
|
|
76
|
-
|
|
77
|
-
if (state.isShakeEnable) {
|
|
78
|
-
DayNighIcon(
|
|
79
|
-
id = R.drawable.check_icon,
|
|
80
|
-
contentDescription = "Shake enabled icon"
|
|
81
|
-
)
|
|
82
|
-
} else {
|
|
83
|
-
null
|
|
84
|
-
}
|
|
85
|
-
}
|
|
126
|
+
onClick = { onAction(SettingsAction.ToggleShakeEnable(!state.isShakeEnable)) }
|
|
86
127
|
)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
128
|
+
|
|
129
|
+
Divider(
|
|
130
|
+
thickness = 0.5.dp,
|
|
131
|
+
color = NewAppTheme.colors.border.default
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
NewMenuButton(
|
|
135
|
+
withSurface = false,
|
|
136
|
+
icon = {
|
|
137
|
+
Icon(
|
|
138
|
+
painter = painterResource(R.drawable.inspect),
|
|
139
|
+
contentDescription = "3 fingers long press icon",
|
|
140
|
+
tint = NewAppTheme.colors.icon.tertiary,
|
|
141
|
+
modifier = Modifier.size(20.dp)
|
|
142
|
+
)
|
|
143
|
+
},
|
|
144
|
+
content = {
|
|
145
|
+
NewText(
|
|
146
|
+
text = "3 fingers long press"
|
|
147
|
+
)
|
|
148
|
+
},
|
|
149
|
+
rightComponent = {
|
|
150
|
+
ToggleSwitch(
|
|
151
|
+
isToggled = state.isThreeFingerLongPressEnable
|
|
152
|
+
)
|
|
93
153
|
},
|
|
94
|
-
|
|
95
|
-
painterResource(R.drawable.check_icon)
|
|
96
|
-
} else {
|
|
97
|
-
null
|
|
98
|
-
}
|
|
154
|
+
onClick = { onAction(SettingsAction.ToggleThreeFingerLongPressEnable(!state.isThreeFingerLongPressEnable)) }
|
|
99
155
|
)
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
156
|
+
|
|
157
|
+
Divider(
|
|
158
|
+
thickness = 0.5.dp,
|
|
159
|
+
color = NewAppTheme.colors.border.default
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
NewMenuButton(
|
|
163
|
+
withSurface = false,
|
|
164
|
+
icon = {
|
|
165
|
+
Icon(
|
|
166
|
+
painter = painterResource(R.drawable.dev_menu_fab_icon),
|
|
167
|
+
contentDescription = "Action button icon",
|
|
168
|
+
tint = NewAppTheme.colors.icon.tertiary,
|
|
169
|
+
modifier = Modifier.size(20.dp)
|
|
170
|
+
)
|
|
107
171
|
},
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
172
|
+
content = {
|
|
173
|
+
NewText(
|
|
174
|
+
text = "Action button"
|
|
175
|
+
)
|
|
176
|
+
},
|
|
177
|
+
rightComponent = {
|
|
178
|
+
ToggleSwitch(
|
|
179
|
+
isToggled = state.showFabAtLaunch
|
|
180
|
+
)
|
|
181
|
+
},
|
|
182
|
+
onClick = { onAction(SettingsAction.ToggleShowFabAtLaunch(!state.showFabAtLaunch)) }
|
|
113
183
|
)
|
|
114
184
|
}
|
|
115
185
|
}
|
|
116
186
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
187
|
+
Spacer(NewAppTheme.spacing.`3`)
|
|
188
|
+
|
|
189
|
+
NewText(
|
|
190
|
+
"Selected gestures will toggle the developer menu while inside a preview. The menu allows you to reload or return to home and exposes developer tools.",
|
|
191
|
+
style = NewAppTheme.font.md.merge(
|
|
192
|
+
lineHeight = 21.sp
|
|
193
|
+
),
|
|
194
|
+
color = NewAppTheme.colors.text.quaternary
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
Spacer(NewAppTheme.spacing.`6`)
|
|
198
|
+
|
|
199
|
+
NewText(
|
|
200
|
+
"SYSTEM",
|
|
201
|
+
style = TextStyle(
|
|
202
|
+
fontSize = NewAppTheme.font.sm.fontSize,
|
|
203
|
+
fontFamily = NewAppTheme.font.mono,
|
|
204
|
+
fontWeight = FontWeight.Medium,
|
|
205
|
+
color = NewAppTheme.colors.text.quaternary
|
|
206
|
+
)
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
Spacer(NewAppTheme.spacing.`3`)
|
|
210
|
+
|
|
211
|
+
Divider(
|
|
212
|
+
thickness = 0.5.dp,
|
|
213
|
+
color = NewAppTheme.colors.border.default
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
Row(
|
|
217
|
+
horizontalArrangement = Arrangement.SpaceBetween,
|
|
218
|
+
modifier = Modifier
|
|
219
|
+
.fillMaxWidth()
|
|
220
|
+
.padding(vertical = 12.dp)
|
|
221
|
+
) {
|
|
222
|
+
NewText(
|
|
223
|
+
"Version",
|
|
224
|
+
color = NewAppTheme.colors.text.secondary
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
NewText(
|
|
228
|
+
state.applicationInfo?.appVersion ?: "N/A",
|
|
229
|
+
color = NewAppTheme.colors.text.secondary
|
|
122
230
|
)
|
|
123
231
|
}
|
|
124
232
|
|
|
125
|
-
|
|
233
|
+
Divider(
|
|
234
|
+
thickness = 0.5.dp,
|
|
235
|
+
color = NewAppTheme.colors.border.default
|
|
236
|
+
)
|
|
126
237
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
238
|
+
Row(
|
|
239
|
+
horizontalArrangement = Arrangement.SpaceBetween,
|
|
240
|
+
modifier = Modifier
|
|
241
|
+
.fillMaxWidth()
|
|
242
|
+
.padding(vertical = 12.dp)
|
|
243
|
+
) {
|
|
244
|
+
NewText(
|
|
245
|
+
"Runtime version",
|
|
246
|
+
color = NewAppTheme.colors.text.secondary
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
val runtimeVersion = (state.applicationInfo as? ApplicationInfo.Updates)?.runtimeVersion
|
|
250
|
+
NewText(
|
|
251
|
+
runtimeVersion ?: "N/A",
|
|
252
|
+
color = NewAppTheme.colors.text.secondary
|
|
253
|
+
)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
Divider(
|
|
257
|
+
thickness = 0.5.dp,
|
|
258
|
+
color = NewAppTheme.colors.border.default
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
Button(onClick = {
|
|
262
|
+
copyToClipboard(
|
|
263
|
+
context,
|
|
264
|
+
label = "Copy system info",
|
|
265
|
+
text = state.applicationInfo?.toJson() ?: "No application info available"
|
|
266
|
+
)
|
|
267
|
+
}) {
|
|
268
|
+
Row(
|
|
269
|
+
horizontalArrangement = Arrangement.SpaceBetween,
|
|
270
|
+
modifier = Modifier
|
|
271
|
+
.fillMaxWidth()
|
|
272
|
+
.padding(vertical = 12.dp)
|
|
273
|
+
) {
|
|
274
|
+
NewText(
|
|
275
|
+
"Copy system info",
|
|
276
|
+
color = NewAppTheme.colors.text.link,
|
|
277
|
+
style = NewAppTheme.font.sm
|
|
278
|
+
)
|
|
279
|
+
Icon(
|
|
280
|
+
painter = painterResource(expo.modules.devmenu.R.drawable.copy),
|
|
281
|
+
contentDescription = "Copy system info",
|
|
282
|
+
tint = NewAppTheme.colors.text.link,
|
|
283
|
+
modifier = Modifier
|
|
284
|
+
.size(12.dp)
|
|
148
285
|
)
|
|
149
286
|
}
|
|
150
287
|
}
|
|
@@ -154,15 +291,17 @@ fun SettingsScreen(
|
|
|
154
291
|
@Composable
|
|
155
292
|
@Preview(showBackground = true)
|
|
156
293
|
fun SettingsScreenPreview() {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
294
|
+
DefaultScreenContainer {
|
|
295
|
+
SettingsScreen(
|
|
296
|
+
state = SettingsState(
|
|
297
|
+
applicationInfo = ApplicationInfo.Updates(
|
|
298
|
+
appName = "BareExpo",
|
|
299
|
+
appVersion = "1.0.0",
|
|
300
|
+
appId = "01980973-2cf9-71fb-a891-a53444132a6e",
|
|
301
|
+
runtimeVersion = "1.0.0",
|
|
302
|
+
projectUrl = "https://u.expo.dev/01980973-2cf9-71fb-a891-a53444132a6e"
|
|
303
|
+
)
|
|
165
304
|
)
|
|
166
305
|
)
|
|
167
|
-
|
|
306
|
+
}
|
|
168
307
|
}
|
|
@@ -1,35 +1,43 @@
|
|
|
1
1
|
package expo.modules.devlauncher.compose.ui
|
|
2
2
|
|
|
3
|
+
import androidx.compose.foundation.background
|
|
3
4
|
import androidx.compose.foundation.layout.padding
|
|
4
5
|
import androidx.compose.foundation.layout.size
|
|
5
6
|
import androidx.compose.runtime.Composable
|
|
6
7
|
import androidx.compose.ui.Modifier
|
|
8
|
+
import androidx.compose.ui.res.painterResource
|
|
7
9
|
import androidx.compose.ui.unit.Dp
|
|
10
|
+
import androidx.compose.ui.unit.dp
|
|
11
|
+
import com.composeunstyled.Icon
|
|
8
12
|
import expo.modules.devlauncher.R
|
|
9
13
|
import expo.modules.devlauncher.compose.primitives.AsyncImage
|
|
10
|
-
import expo.modules.devmenu.compose.
|
|
14
|
+
import expo.modules.devmenu.compose.newtheme.NewAppTheme
|
|
11
15
|
import expo.modules.devmenu.compose.primitives.RoundedSurface
|
|
12
|
-
import expo.modules.devmenu.compose.theme.Theme
|
|
13
16
|
|
|
14
17
|
@Composable
|
|
15
18
|
fun AccountAvatar(
|
|
16
19
|
url: String?,
|
|
17
|
-
size: Dp =
|
|
20
|
+
size: Dp = 44.dp,
|
|
18
21
|
modifier: Modifier = Modifier
|
|
19
22
|
) {
|
|
20
23
|
RoundedSurface(
|
|
21
|
-
borderRadius =
|
|
22
|
-
modifier = Modifier
|
|
24
|
+
borderRadius = NewAppTheme.borderRadius.full,
|
|
25
|
+
modifier = Modifier
|
|
26
|
+
.size(size)
|
|
27
|
+
.then(modifier)
|
|
23
28
|
) {
|
|
24
29
|
if (url != null) {
|
|
25
30
|
AsyncImage(
|
|
26
31
|
url = url
|
|
27
32
|
)
|
|
28
33
|
} else {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
contentDescription = "
|
|
32
|
-
|
|
34
|
+
Icon(
|
|
35
|
+
painter = painterResource(R.drawable.user),
|
|
36
|
+
contentDescription = "User Icon",
|
|
37
|
+
tint = NewAppTheme.colors.icon.tertiary,
|
|
38
|
+
modifier = Modifier
|
|
39
|
+
.background(NewAppTheme.colors.background.element)
|
|
40
|
+
.padding(size / 4)
|
|
33
41
|
)
|
|
34
42
|
}
|
|
35
43
|
}
|