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.
Files changed (49) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/android/build.gradle +3 -3
  3. package/android/src/debug/java/expo/modules/devlauncher/compose/BindingView.kt +4 -2
  4. package/android/src/debug/java/expo/modules/devlauncher/compose/DevLauncherBottomTabsNavigator.kt +4 -2
  5. package/android/src/debug/java/expo/modules/devlauncher/compose/models/BranchesViewModel.kt +57 -13
  6. package/android/src/debug/java/expo/modules/devlauncher/compose/primitives/Accordion.kt +40 -45
  7. package/android/src/debug/java/expo/modules/devlauncher/compose/routes/Profile.kt +98 -18
  8. package/android/src/debug/java/expo/modules/devlauncher/compose/routes/Updates.kt +3 -1
  9. package/android/src/debug/java/expo/modules/devlauncher/compose/screens/BranchScreen.kt +171 -146
  10. package/android/src/debug/java/expo/modules/devlauncher/compose/screens/BranchesScreen.kt +248 -150
  11. package/android/src/debug/java/expo/modules/devlauncher/compose/screens/CrashReportScreen.kt +75 -46
  12. package/android/src/debug/java/expo/modules/devlauncher/compose/screens/HomeScreen.kt +234 -238
  13. package/android/src/debug/java/expo/modules/devlauncher/compose/screens/NoUpdatesScreen.kt +52 -35
  14. package/android/src/debug/java/expo/modules/devlauncher/compose/screens/SettingsScreen.kt +246 -107
  15. package/android/src/debug/java/expo/modules/devlauncher/compose/ui/AccountAvatar.kt +17 -9
  16. package/android/src/debug/java/expo/modules/devlauncher/compose/ui/AccountSelector.kt +63 -46
  17. package/android/src/debug/java/expo/modules/devlauncher/compose/ui/ActionButton.kt +51 -3
  18. package/android/src/debug/java/expo/modules/devlauncher/compose/ui/AppHeader.kt +70 -44
  19. package/android/src/debug/java/expo/modules/devlauncher/compose/ui/BottomSheet.kt +42 -2
  20. package/android/src/debug/java/expo/modules/devlauncher/compose/ui/BottomTabBar.kt +14 -10
  21. package/android/src/debug/java/expo/modules/devlauncher/compose/ui/BottomTabButton.kt +46 -23
  22. package/android/src/debug/java/expo/modules/devlauncher/compose/ui/DevelopmentServerHelp.kt +23 -16
  23. package/android/src/debug/java/expo/modules/devlauncher/compose/ui/RunningAppCard.kt +65 -34
  24. package/android/src/debug/java/expo/modules/devlauncher/compose/ui/ScreenHeaderContainer.kt +0 -5
  25. package/android/src/debug/java/expo/modules/devlauncher/compose/ui/ServerUrlInput.kt +56 -17
  26. package/android/src/debug/java/expo/modules/devlauncher/compose/ui/SignUp.kt +20 -27
  27. package/android/src/main/res/drawable/arrow_right.xml +9 -0
  28. package/android/src/main/res/drawable/check_circle.xml +10 -0
  29. package/android/src/main/res/drawable/chevron_right.xml +10 -0
  30. package/android/src/main/res/drawable/copy.xml +13 -0
  31. package/android/src/main/res/drawable/expo_logo.xml +9 -0
  32. package/android/src/main/res/drawable/home.xml +10 -0
  33. package/android/src/main/res/drawable/inspect.xml +10 -0
  34. package/android/src/main/res/drawable/log_in.xml +12 -0
  35. package/android/src/main/res/drawable/pulse.xml +10 -0
  36. package/android/src/main/res/drawable/reload.xml +10 -0
  37. package/android/src/main/res/drawable/scan.xml +42 -0
  38. package/android/src/main/res/drawable/settings.xml +14 -0
  39. package/android/src/main/res/drawable/show_at_launch.xml +12 -0
  40. package/android/src/main/res/drawable/signal.xml +26 -0
  41. package/android/src/main/res/drawable/user.xml +13 -0
  42. package/ios/EXDevLauncherController.m +23 -4
  43. package/ios/SwiftUI/CrashReportView.swift +11 -3
  44. package/ios/SwiftUI/DevLauncherViews.swift +18 -2
  45. package/ios/SwiftUI/DevServersView.swift +2 -2
  46. package/ios/SwiftUI/HomeTabView.swift +4 -0
  47. package/ios/SwiftUI/Navigation/Navigation.swift +3 -0
  48. package/ios/SwiftUI/SettingsTabView.swift +4 -3
  49. 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.primitives.DayNighIcon
39
+ import expo.modules.devmenu.compose.newtheme.NewAppTheme
35
40
  import expo.modules.devmenu.compose.primitives.Divider
36
- import expo.modules.devmenu.compose.primitives.Heading
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
- ScreenHeaderContainer {
52
- Box(
53
- modifier = Modifier
54
- .fillMaxWidth()
55
- .padding(Theme.spacing.small)
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
- RoundedSurface(
58
- color = Color.Transparent,
59
- modifier = Modifier.align(Alignment.CenterStart)
64
+ Button(
65
+ onClick = goBack
60
66
  ) {
61
- Button(
62
- onClick = goBack
63
- ) {
64
- DayNighIcon(
65
- R.drawable.chevron_right_icon,
66
- contentDescription = "Back icon",
67
- modifier = Modifier
68
- .rotate(180f)
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(Theme.spacing.small)
92
+ Spacer(NewAppTheme.spacing.`4`)
81
93
 
82
- val lazyListState = rememberLazyListState()
94
+ Column(
95
+ modifier = Modifier.padding(horizontal = NewAppTheme.spacing.`4`)
96
+ ) {
97
+ val lazyListState = rememberLazyListState()
83
98
 
84
- val reachedBottom: Boolean by remember {
85
- derivedStateOf {
86
- val lastVisibleItem = lazyListState.layoutInfo.visibleItemsInfo.lastOrNull()
87
- val index = lastVisibleItem?.index ?: 0
88
- index != 0 && index > lazyListState.layoutInfo.totalItemsCount - 5
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
- LaunchedEffect(reachedBottom, isLoading) {
93
- if (reachedBottom && !isLoading) {
94
- onAction(BranchAction.LoadMoreUpdates)
107
+ LaunchedEffect(reachedBottom, isLoading) {
108
+ if (reachedBottom && !isLoading) {
109
+ onAction(BranchAction.LoadMoreUpdates)
110
+ }
95
111
  }
96
- }
97
112
 
98
- RoundedSurface(
99
- modifier = Modifier.padding(Theme.spacing.small)
100
- ) {
101
- LazyColumn(
102
- state = lazyListState
113
+ RoundedSurface(
114
+ color = NewAppTheme.colors.background.subtle
103
115
  ) {
104
- itemsIndexed(items = updates) { index, update ->
105
- val formatedTime = DateFormat.formatUpdateDate(update.createdAt)
116
+ LazyColumn(
117
+ state = lazyListState
118
+ ) {
119
+ itemsIndexed(items = updates) { index, update ->
120
+ val formatedTime = DateFormat.formatUpdateDate(update.createdAt)
106
121
 
107
- Button(onClick = {
108
- onAction(BranchAction.OpenUpdate(update))
109
- }) {
110
- Column(modifier = Modifier.padding(Theme.spacing.small)) {
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
- verticalAlignment = Alignment.CenterVertically
133
+ horizontalArrangement = Arrangement.spacedBy(NewAppTheme.spacing.`2`),
134
+ verticalAlignment = Alignment.CenterVertically,
135
+ modifier = Modifier
136
+ .fillMaxWidth()
137
+ .padding(NewAppTheme.spacing.`3`)
113
138
  ) {
114
- DayNighIcon(
139
+ Icon(
115
140
  painter = painterResource(R.drawable.update_icon),
116
141
  contentDescription = "Update Icon",
117
- modifier = Modifier.size(Theme.sizing.icon.medium)
142
+ tint = NewAppTheme.colors.icon.tertiary,
143
+ modifier = Modifier.size(20.dp)
118
144
  )
119
145
 
120
- Spacer(Theme.spacing.small)
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
- Spacer(Theme.spacing.small)
131
-
132
- DayNighIcon(
133
- painter = painterResource(R.drawable.chevron_right_icon),
134
- contentDescription = "Chevron Right Icon",
135
- modifier = Modifier.size(Theme.sizing.icon.extraSmall)
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
- if (!update.isCompatible) {
152
- Spacer(Theme.spacing.tiny)
159
+ NewText(
160
+ "Published: $formatedTime",
161
+ style = NewAppTheme.font.sm,
162
+ color = NewAppTheme.colors.text.secondary
163
+ )
153
164
 
154
- Text(
155
- "Incompatible update",
156
- color = Theme.colors.text.warning,
157
- modifier = Modifier
158
- .padding(
159
- start = Theme.sizing.icon.medium + Theme.spacing.small,
160
- end = Theme.sizing.icon.medium + Theme.spacing.small
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
- if (isLoading) {
173
- item {
174
- Row(
175
- modifier = Modifier
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
- if (!isLoading && updates.isEmpty()) {
189
- item {
190
- Row(
191
- modifier = Modifier
192
- .fillMaxWidth()
193
- .padding(Theme.spacing.medium),
194
- horizontalArrangement = Arrangement.Center,
195
- verticalAlignment = Alignment.CenterVertically
196
- ) {
197
- Text(
198
- "No updates available.",
199
- color = Theme.colors.text.secondary,
200
- textAlign = TextAlign.Center
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
- BranchScreen(
214
- isLoading = true,
215
- branchName = "main",
216
- updates = listOf(
217
- Update(
218
- id = "1",
219
- name = "Update 1 with a very long name that should be truncated",
220
- createdAt = "2023-10-01T12:00:00Z",
221
- isCompatible = true,
222
- permalink = ""
223
- ),
224
- Update(
225
- id = "2",
226
- name = "Update 2",
227
- createdAt = "2023-10-02T12:00:00Z",
228
- isCompatible = false,
229
- permalink = ""
230
- ),
231
- Update(
232
- id = "3",
233
- name = "Update 3",
234
- createdAt = "2023-10-03T12:00:00Z",
235
- isCompatible = true,
236
- permalink = ""
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
  }