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,5 +1,6 @@
|
|
|
1
1
|
package expo.modules.devlauncher.compose.screens
|
|
2
2
|
|
|
3
|
+
import androidx.compose.foundation.background
|
|
3
4
|
import androidx.compose.foundation.layout.Arrangement
|
|
4
5
|
import androidx.compose.foundation.layout.Box
|
|
5
6
|
import androidx.compose.foundation.layout.Column
|
|
@@ -11,6 +12,7 @@ import androidx.compose.foundation.layout.size
|
|
|
11
12
|
import androidx.compose.foundation.lazy.LazyColumn
|
|
12
13
|
import androidx.compose.foundation.lazy.itemsIndexed
|
|
13
14
|
import androidx.compose.foundation.lazy.rememberLazyListState
|
|
15
|
+
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
14
16
|
import androidx.compose.runtime.Composable
|
|
15
17
|
import androidx.compose.runtime.LaunchedEffect
|
|
16
18
|
import androidx.compose.runtime.derivedStateOf
|
|
@@ -21,22 +23,24 @@ import androidx.compose.ui.Modifier
|
|
|
21
23
|
import androidx.compose.ui.draw.rotate
|
|
22
24
|
import androidx.compose.ui.graphics.Color
|
|
23
25
|
import androidx.compose.ui.res.painterResource
|
|
26
|
+
import androidx.compose.ui.text.font.FontWeight
|
|
24
27
|
import androidx.compose.ui.text.style.TextAlign
|
|
25
28
|
import androidx.compose.ui.text.style.TextOverflow
|
|
26
29
|
import androidx.compose.ui.tooling.preview.Preview
|
|
30
|
+
import androidx.compose.ui.unit.dp
|
|
27
31
|
import com.composeunstyled.Button
|
|
32
|
+
import com.composeunstyled.Icon
|
|
28
33
|
import expo.modules.devlauncher.R
|
|
34
|
+
import expo.modules.devlauncher.compose.DefaultScreenContainer
|
|
29
35
|
import expo.modules.devlauncher.compose.Update
|
|
30
36
|
import expo.modules.devlauncher.compose.models.BranchAction
|
|
31
37
|
import expo.modules.devlauncher.compose.primitives.CircularProgressBar
|
|
32
|
-
import expo.modules.devlauncher.compose.ui.ScreenHeaderContainer
|
|
33
38
|
import expo.modules.devlauncher.compose.utils.DateFormat
|
|
34
|
-
import expo.modules.devmenu.compose.
|
|
39
|
+
import expo.modules.devmenu.compose.newtheme.NewAppTheme
|
|
35
40
|
import expo.modules.devmenu.compose.primitives.Divider
|
|
36
|
-
import expo.modules.devmenu.compose.primitives.
|
|
41
|
+
import expo.modules.devmenu.compose.primitives.NewText
|
|
37
42
|
import expo.modules.devmenu.compose.primitives.RoundedSurface
|
|
38
43
|
import expo.modules.devmenu.compose.primitives.Spacer
|
|
39
|
-
import expo.modules.devmenu.compose.primitives.Text
|
|
40
44
|
import expo.modules.devmenu.compose.theme.Theme
|
|
41
45
|
|
|
42
46
|
@Composable
|
|
@@ -48,157 +52,176 @@ fun BranchScreen(
|
|
|
48
52
|
onAction: (BranchAction) -> Unit = {}
|
|
49
53
|
) {
|
|
50
54
|
Column(modifier = Modifier.fillMaxSize()) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
Box(
|
|
56
|
+
modifier = Modifier
|
|
57
|
+
.fillMaxWidth()
|
|
58
|
+
.padding(NewAppTheme.spacing.`4`)
|
|
59
|
+
) {
|
|
60
|
+
RoundedSurface(
|
|
61
|
+
color = Color.Transparent,
|
|
62
|
+
modifier = Modifier.align(Alignment.CenterStart)
|
|
56
63
|
) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
modifier = Modifier.align(Alignment.CenterStart)
|
|
64
|
+
Button(
|
|
65
|
+
onClick = goBack
|
|
60
66
|
) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
.size(Theme.sizing.icon.small)
|
|
70
|
-
)
|
|
71
|
-
}
|
|
67
|
+
Icon(
|
|
68
|
+
painter = painterResource(R.drawable.chevron_right_icon),
|
|
69
|
+
contentDescription = "Back icon",
|
|
70
|
+
tint = NewAppTheme.colors.icon.default,
|
|
71
|
+
modifier = Modifier
|
|
72
|
+
.rotate(180f)
|
|
73
|
+
.size(20.dp)
|
|
74
|
+
)
|
|
72
75
|
}
|
|
73
|
-
|
|
74
|
-
Heading(branchName, modifier = Modifier.align(Alignment.Center))
|
|
75
76
|
}
|
|
77
|
+
|
|
78
|
+
NewText(
|
|
79
|
+
branchName,
|
|
80
|
+
style = NewAppTheme.font.xxl.merge(
|
|
81
|
+
fontWeight = FontWeight.Bold
|
|
82
|
+
),
|
|
83
|
+
modifier = Modifier.align(Alignment.Center)
|
|
84
|
+
)
|
|
76
85
|
}
|
|
77
86
|
|
|
78
|
-
Divider(
|
|
87
|
+
Divider(
|
|
88
|
+
thickness = 0.5.dp,
|
|
89
|
+
color = NewAppTheme.colors.border.default
|
|
90
|
+
)
|
|
79
91
|
|
|
80
|
-
Spacer(
|
|
92
|
+
Spacer(NewAppTheme.spacing.`4`)
|
|
81
93
|
|
|
82
|
-
|
|
94
|
+
Column(
|
|
95
|
+
modifier = Modifier.padding(horizontal = NewAppTheme.spacing.`4`)
|
|
96
|
+
) {
|
|
97
|
+
val lazyListState = rememberLazyListState()
|
|
83
98
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
99
|
+
val reachedBottom: Boolean by remember {
|
|
100
|
+
derivedStateOf {
|
|
101
|
+
val lastVisibleItem = lazyListState.layoutInfo.visibleItemsInfo.lastOrNull()
|
|
102
|
+
val index = lastVisibleItem?.index ?: 0
|
|
103
|
+
index != 0 && index > lazyListState.layoutInfo.totalItemsCount - 5
|
|
104
|
+
}
|
|
89
105
|
}
|
|
90
|
-
}
|
|
91
106
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
107
|
+
LaunchedEffect(reachedBottom, isLoading) {
|
|
108
|
+
if (reachedBottom && !isLoading) {
|
|
109
|
+
onAction(BranchAction.LoadMoreUpdates)
|
|
110
|
+
}
|
|
95
111
|
}
|
|
96
|
-
}
|
|
97
112
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
) {
|
|
101
|
-
LazyColumn(
|
|
102
|
-
state = lazyListState
|
|
113
|
+
RoundedSurface(
|
|
114
|
+
color = NewAppTheme.colors.background.subtle
|
|
103
115
|
) {
|
|
104
|
-
|
|
105
|
-
|
|
116
|
+
LazyColumn(
|
|
117
|
+
state = lazyListState
|
|
118
|
+
) {
|
|
119
|
+
itemsIndexed(items = updates) { index, update ->
|
|
120
|
+
val formatedTime = DateFormat.formatUpdateDate(update.createdAt)
|
|
106
121
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
122
|
+
Button(
|
|
123
|
+
modifier = Modifier
|
|
124
|
+
.background(
|
|
125
|
+
NewAppTheme.colors.background.subtle,
|
|
126
|
+
shape = RoundedCornerShape(NewAppTheme.borderRadius.xl)
|
|
127
|
+
),
|
|
128
|
+
onClick = {
|
|
129
|
+
onAction(BranchAction.OpenUpdate(update))
|
|
130
|
+
}
|
|
131
|
+
) {
|
|
111
132
|
Row(
|
|
112
|
-
|
|
133
|
+
horizontalArrangement = Arrangement.spacedBy(NewAppTheme.spacing.`2`),
|
|
134
|
+
verticalAlignment = Alignment.CenterVertically,
|
|
135
|
+
modifier = Modifier
|
|
136
|
+
.fillMaxWidth()
|
|
137
|
+
.padding(NewAppTheme.spacing.`3`)
|
|
113
138
|
) {
|
|
114
|
-
|
|
139
|
+
Icon(
|
|
115
140
|
painter = painterResource(R.drawable.update_icon),
|
|
116
141
|
contentDescription = "Update Icon",
|
|
117
|
-
|
|
142
|
+
tint = NewAppTheme.colors.icon.tertiary,
|
|
143
|
+
modifier = Modifier.size(20.dp)
|
|
118
144
|
)
|
|
119
145
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
Heading(
|
|
123
|
-
"Update: \"${update.name}\"",
|
|
124
|
-
fontSize = Theme.typography.medium,
|
|
125
|
-
maxLines = 1,
|
|
126
|
-
overflow = TextOverflow.Ellipsis,
|
|
146
|
+
Column(
|
|
147
|
+
verticalArrangement = Arrangement.spacedBy(NewAppTheme.spacing.`1`),
|
|
127
148
|
modifier = Modifier.weight(1f)
|
|
128
|
-
)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
)
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
Spacer(Theme.spacing.tiny)
|
|
140
|
-
|
|
141
|
-
Text(
|
|
142
|
-
"Published: $formatedTime",
|
|
143
|
-
color = Theme.colors.text.secondary,
|
|
144
|
-
modifier = Modifier
|
|
145
|
-
.padding(
|
|
146
|
-
start = Theme.sizing.icon.medium + Theme.spacing.small,
|
|
147
|
-
end = Theme.sizing.icon.medium + Theme.spacing.small
|
|
149
|
+
) {
|
|
150
|
+
NewText(
|
|
151
|
+
"Update: \"${update.name}\"",
|
|
152
|
+
style = NewAppTheme.font.md.merge(
|
|
153
|
+
fontWeight = FontWeight.Medium
|
|
154
|
+
),
|
|
155
|
+
maxLines = 1,
|
|
156
|
+
overflow = TextOverflow.Ellipsis
|
|
148
157
|
)
|
|
149
|
-
)
|
|
150
158
|
|
|
151
|
-
|
|
152
|
-
|
|
159
|
+
NewText(
|
|
160
|
+
"Published: $formatedTime",
|
|
161
|
+
style = NewAppTheme.font.sm,
|
|
162
|
+
color = NewAppTheme.colors.text.secondary
|
|
163
|
+
)
|
|
153
164
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
165
|
+
if (!update.isCompatible) {
|
|
166
|
+
NewText(
|
|
167
|
+
"Incompatible update",
|
|
168
|
+
color = NewAppTheme.colors.text.warning,
|
|
169
|
+
style = NewAppTheme.font.sm.merge(
|
|
170
|
+
fontWeight = FontWeight.Medium
|
|
171
|
+
)
|
|
161
172
|
)
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
Icon(
|
|
177
|
+
painter = painterResource(R.drawable.chevron_right),
|
|
178
|
+
contentDescription = "Chevron Icon",
|
|
179
|
+
tint = NewAppTheme.colors.icon.tertiary,
|
|
180
|
+
modifier = Modifier.size(16.dp)
|
|
162
181
|
)
|
|
163
182
|
}
|
|
164
183
|
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
if (index < updates.size - 1) {
|
|
168
|
-
Divider()
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
184
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
.fillMaxWidth()
|
|
177
|
-
.padding(Theme.spacing.medium),
|
|
178
|
-
horizontalArrangement = Arrangement.Center,
|
|
179
|
-
verticalAlignment = Alignment.CenterVertically
|
|
180
|
-
) {
|
|
181
|
-
CircularProgressBar(
|
|
182
|
-
size = Theme.sizing.icon.large
|
|
185
|
+
if (index < updates.size - 1) {
|
|
186
|
+
Divider(
|
|
187
|
+
thickness = 0.5.dp,
|
|
188
|
+
color = NewAppTheme.colors.border.default
|
|
183
189
|
)
|
|
184
190
|
}
|
|
185
191
|
}
|
|
186
|
-
}
|
|
187
192
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
193
|
+
if (isLoading) {
|
|
194
|
+
item {
|
|
195
|
+
Row(
|
|
196
|
+
modifier = Modifier
|
|
197
|
+
.fillMaxWidth()
|
|
198
|
+
.padding(vertical = NewAppTheme.spacing.`2`),
|
|
199
|
+
horizontalArrangement = Arrangement.Center,
|
|
200
|
+
verticalAlignment = Alignment.CenterVertically
|
|
201
|
+
) {
|
|
202
|
+
CircularProgressBar(
|
|
203
|
+
size = Theme.sizing.icon.large
|
|
204
|
+
)
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
} else if (updates.isEmpty()) {
|
|
208
|
+
item {
|
|
209
|
+
Row(
|
|
210
|
+
modifier = Modifier
|
|
211
|
+
.fillMaxWidth()
|
|
212
|
+
.padding(NewAppTheme.spacing.`3`),
|
|
213
|
+
horizontalArrangement = Arrangement.Center,
|
|
214
|
+
verticalAlignment = Alignment.CenterVertically
|
|
215
|
+
) {
|
|
216
|
+
NewText(
|
|
217
|
+
"No updates available.",
|
|
218
|
+
style = NewAppTheme.font.lg.merge(
|
|
219
|
+
textAlign = TextAlign.Center,
|
|
220
|
+
fontWeight = FontWeight.Medium
|
|
221
|
+
),
|
|
222
|
+
color = NewAppTheme.colors.text.secondary
|
|
223
|
+
)
|
|
224
|
+
}
|
|
202
225
|
}
|
|
203
226
|
}
|
|
204
227
|
}
|
|
@@ -210,31 +233,33 @@ fun BranchScreen(
|
|
|
210
233
|
@Preview(showBackground = true)
|
|
211
234
|
@Composable
|
|
212
235
|
fun BranchScreenPreview() {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
236
|
+
DefaultScreenContainer {
|
|
237
|
+
BranchScreen(
|
|
238
|
+
isLoading = true,
|
|
239
|
+
branchName = "main",
|
|
240
|
+
updates = listOf(
|
|
241
|
+
Update(
|
|
242
|
+
id = "1",
|
|
243
|
+
name = "Update 1 with a very long name that should be truncated",
|
|
244
|
+
createdAt = "2023-10-01T12:00:00Z",
|
|
245
|
+
isCompatible = true,
|
|
246
|
+
permalink = ""
|
|
247
|
+
),
|
|
248
|
+
Update(
|
|
249
|
+
id = "2",
|
|
250
|
+
name = "Update 2",
|
|
251
|
+
createdAt = "2023-10-02T12:00:00Z",
|
|
252
|
+
isCompatible = false,
|
|
253
|
+
permalink = ""
|
|
254
|
+
),
|
|
255
|
+
Update(
|
|
256
|
+
id = "3",
|
|
257
|
+
name = "Update 3",
|
|
258
|
+
createdAt = "2023-10-03T12:00:00Z",
|
|
259
|
+
isCompatible = true,
|
|
260
|
+
permalink = ""
|
|
261
|
+
)
|
|
237
262
|
)
|
|
238
263
|
)
|
|
239
|
-
|
|
264
|
+
}
|
|
240
265
|
}
|