expo-dev-launcher 6.0.0 → 6.0.1
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 +6 -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,20 +1,24 @@
|
|
|
1
1
|
package expo.modules.devlauncher.compose.ui
|
|
2
2
|
|
|
3
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
3
4
|
import androidx.compose.foundation.layout.Column
|
|
5
|
+
import androidx.compose.foundation.layout.fillMaxWidth
|
|
4
6
|
import androidx.compose.foundation.layout.padding
|
|
7
|
+
import androidx.compose.foundation.layout.size
|
|
5
8
|
import androidx.compose.runtime.Composable
|
|
6
9
|
import androidx.compose.ui.Modifier
|
|
7
|
-
import
|
|
10
|
+
import androidx.compose.ui.graphics.Color
|
|
11
|
+
import androidx.compose.ui.res.painterResource
|
|
12
|
+
import androidx.compose.ui.text.font.FontWeight
|
|
13
|
+
import androidx.compose.ui.text.style.TextAlign
|
|
14
|
+
import androidx.compose.ui.unit.dp
|
|
15
|
+
import androidx.compose.ui.unit.sp
|
|
16
|
+
import com.composeunstyled.Icon
|
|
8
17
|
import expo.modules.devlauncher.R
|
|
9
18
|
import expo.modules.devlauncher.compose.models.Account
|
|
10
|
-
import expo.modules.
|
|
11
|
-
import expo.modules.devmenu.compose.primitives.
|
|
12
|
-
import expo.modules.devmenu.compose.
|
|
13
|
-
import expo.modules.devmenu.compose.primitives.RoundedSurface
|
|
14
|
-
import expo.modules.devmenu.compose.primitives.RowLayout
|
|
15
|
-
import expo.modules.devmenu.compose.primitives.Spacer
|
|
16
|
-
import expo.modules.devmenu.compose.primitives.Text
|
|
17
|
-
import expo.modules.devmenu.compose.theme.Theme
|
|
19
|
+
import expo.modules.devmenu.compose.newtheme.NewAppTheme
|
|
20
|
+
import expo.modules.devmenu.compose.primitives.NewText
|
|
21
|
+
import expo.modules.devmenu.compose.ui.NewMenuButton
|
|
18
22
|
|
|
19
23
|
@Composable
|
|
20
24
|
fun AccountSelector(
|
|
@@ -22,49 +26,62 @@ fun AccountSelector(
|
|
|
22
26
|
onClick: (Account) -> Unit = {},
|
|
23
27
|
onSignOut: () -> Unit = {}
|
|
24
28
|
) {
|
|
25
|
-
Column
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
)
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
RowLayout(
|
|
41
|
-
modifier = Modifier.padding(Theme.spacing.small),
|
|
42
|
-
leftComponent = avatar,
|
|
43
|
-
rightComponent = {
|
|
44
|
-
if (account.isSelected) {
|
|
45
|
-
DayNighIcon(
|
|
46
|
-
id = R.drawable.check_icon,
|
|
47
|
-
contentDescription = "Checked"
|
|
48
|
-
)
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
) {
|
|
52
|
-
Text(account.name)
|
|
53
|
-
}
|
|
54
|
-
}
|
|
29
|
+
Column(
|
|
30
|
+
verticalArrangement = Arrangement.spacedBy(NewAppTheme.spacing.`4`)
|
|
31
|
+
) {
|
|
32
|
+
NewText(
|
|
33
|
+
"Account",
|
|
34
|
+
style = NewAppTheme.font.xxl.merge(
|
|
35
|
+
fontWeight = FontWeight.SemiBold,
|
|
36
|
+
lineHeight = 20.sp,
|
|
37
|
+
textAlign = TextAlign.Center
|
|
38
|
+
),
|
|
39
|
+
modifier = Modifier.fillMaxWidth()
|
|
40
|
+
)
|
|
55
41
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
Column(
|
|
43
|
+
verticalArrangement = Arrangement.spacedBy(NewAppTheme.spacing.`2`)
|
|
44
|
+
) {
|
|
45
|
+
for (account in accounts) {
|
|
46
|
+
NewMenuButton(
|
|
47
|
+
spacedBy = NewAppTheme.spacing.`3`,
|
|
48
|
+
icon = {
|
|
49
|
+
AccountAvatar(
|
|
50
|
+
account.avatar,
|
|
51
|
+
size = 32.dp
|
|
52
|
+
)
|
|
53
|
+
},
|
|
54
|
+
content = {
|
|
55
|
+
NewText(
|
|
56
|
+
text = account.name,
|
|
57
|
+
style = NewAppTheme.font.lg.merge(
|
|
58
|
+
fontWeight = FontWeight.SemiBold
|
|
59
|
+
)
|
|
60
|
+
)
|
|
61
|
+
},
|
|
62
|
+
rightComponent = {
|
|
63
|
+
if (account.isSelected) {
|
|
64
|
+
Icon(
|
|
65
|
+
painterResource(R.drawable.check_circle),
|
|
66
|
+
contentDescription = "Checked",
|
|
67
|
+
tint = Color(0xFF34C759),
|
|
68
|
+
modifier = Modifier.size(20.dp)
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
onClick = {
|
|
73
|
+
onClick(account)
|
|
74
|
+
},
|
|
75
|
+
enabled = !account.isSelected
|
|
76
|
+
)
|
|
60
77
|
}
|
|
61
78
|
}
|
|
62
79
|
|
|
63
|
-
Spacer(Theme.spacing.medium)
|
|
64
|
-
|
|
65
80
|
ActionButton(
|
|
66
81
|
"Log Out",
|
|
67
|
-
|
|
82
|
+
foreground = Color.White,
|
|
83
|
+
background = Color.Black,
|
|
84
|
+
modifier = Modifier.padding(NewAppTheme.spacing.`3`),
|
|
68
85
|
onClick = onSignOut
|
|
69
86
|
)
|
|
70
87
|
}
|
|
@@ -7,8 +7,13 @@ import androidx.compose.foundation.shape.RoundedCornerShape
|
|
|
7
7
|
import androidx.compose.runtime.Composable
|
|
8
8
|
import androidx.compose.ui.Alignment
|
|
9
9
|
import androidx.compose.ui.Modifier
|
|
10
|
+
import androidx.compose.ui.graphics.Color
|
|
11
|
+
import androidx.compose.ui.text.TextStyle
|
|
12
|
+
import androidx.compose.ui.text.font.FontWeight
|
|
13
|
+
import androidx.compose.ui.unit.Dp
|
|
10
14
|
import com.composeunstyled.Button
|
|
11
|
-
import expo.modules.devmenu.compose.
|
|
15
|
+
import expo.modules.devmenu.compose.newtheme.NewAppTheme
|
|
16
|
+
import expo.modules.devmenu.compose.primitives.NewText
|
|
12
17
|
import expo.modules.devmenu.compose.ripple.ripple
|
|
13
18
|
import expo.modules.devmenu.compose.theme.ButtonStyle
|
|
14
19
|
import expo.modules.devmenu.compose.theme.Theme
|
|
@@ -21,7 +26,7 @@ fun ActionButton(
|
|
|
21
26
|
) {
|
|
22
27
|
Button(
|
|
23
28
|
onClick = onClick,
|
|
24
|
-
shape = RoundedCornerShape(
|
|
29
|
+
shape = RoundedCornerShape(NewAppTheme.borderRadius.xl),
|
|
25
30
|
backgroundColor = style.background,
|
|
26
31
|
indication = ripple(color = style.foreground)
|
|
27
32
|
) {
|
|
@@ -31,7 +36,50 @@ fun ActionButton(
|
|
|
31
36
|
.padding(vertical = Theme.spacing.small)
|
|
32
37
|
.fillMaxWidth()
|
|
33
38
|
) {
|
|
34
|
-
|
|
39
|
+
NewText(
|
|
40
|
+
text,
|
|
41
|
+
color = style.foreground
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@Composable
|
|
48
|
+
fun ActionButton(
|
|
49
|
+
text: String,
|
|
50
|
+
foreground: Color,
|
|
51
|
+
background: Color,
|
|
52
|
+
modifier: Modifier = Modifier,
|
|
53
|
+
fill: Boolean = true,
|
|
54
|
+
borderRadius: Dp = NewAppTheme.borderRadius.xl,
|
|
55
|
+
textStyle: TextStyle = NewAppTheme.font.lg.merge(
|
|
56
|
+
fontWeight = FontWeight.SemiBold
|
|
57
|
+
),
|
|
58
|
+
onClick: () -> Unit = {}
|
|
59
|
+
) {
|
|
60
|
+
Button(
|
|
61
|
+
onClick = onClick,
|
|
62
|
+
shape = RoundedCornerShape(borderRadius),
|
|
63
|
+
backgroundColor = background,
|
|
64
|
+
indication = ripple(color = foreground)
|
|
65
|
+
) {
|
|
66
|
+
Box(
|
|
67
|
+
contentAlignment = Alignment.Center,
|
|
68
|
+
modifier = Modifier
|
|
69
|
+
.then(
|
|
70
|
+
if (fill) {
|
|
71
|
+
Modifier.fillMaxWidth()
|
|
72
|
+
} else {
|
|
73
|
+
Modifier
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
.then(modifier)
|
|
77
|
+
) {
|
|
78
|
+
NewText(
|
|
79
|
+
text,
|
|
80
|
+
color = foreground,
|
|
81
|
+
style = textStyle
|
|
82
|
+
)
|
|
35
83
|
}
|
|
36
84
|
}
|
|
37
85
|
}
|
|
@@ -1,31 +1,41 @@
|
|
|
1
1
|
package expo.modules.devlauncher.compose.ui
|
|
2
2
|
|
|
3
|
+
import android.os.Build
|
|
4
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
5
|
+
import androidx.compose.foundation.layout.Box
|
|
3
6
|
import androidx.compose.foundation.layout.Column
|
|
7
|
+
import androidx.compose.foundation.layout.Row
|
|
4
8
|
import androidx.compose.foundation.layout.padding
|
|
5
|
-
import androidx.compose.foundation.
|
|
9
|
+
import androidx.compose.foundation.layout.size
|
|
6
10
|
import androidx.compose.runtime.Composable
|
|
11
|
+
import androidx.compose.ui.Alignment
|
|
7
12
|
import androidx.compose.ui.Modifier
|
|
13
|
+
import androidx.compose.ui.res.painterResource
|
|
14
|
+
import androidx.compose.ui.text.font.FontWeight
|
|
8
15
|
import androidx.compose.ui.tooling.preview.Preview
|
|
16
|
+
import androidx.compose.ui.unit.dp
|
|
9
17
|
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
|
10
18
|
import com.composeunstyled.Button
|
|
19
|
+
import com.composeunstyled.Icon
|
|
11
20
|
import expo.modules.devlauncher.MeQuery
|
|
12
21
|
import expo.modules.devlauncher.R
|
|
22
|
+
import expo.modules.devlauncher.compose.primitives.AsyncImage
|
|
13
23
|
import expo.modules.devlauncher.services.AppService
|
|
14
24
|
import expo.modules.devlauncher.services.SessionService
|
|
15
25
|
import expo.modules.devlauncher.services.UserState
|
|
16
26
|
import expo.modules.devlauncher.services.inject
|
|
27
|
+
import expo.modules.devmenu.compose.newtheme.NewAppTheme
|
|
17
28
|
import expo.modules.devmenu.compose.primitives.AppIcon
|
|
18
|
-
import expo.modules.devmenu.compose.primitives.
|
|
19
|
-
import expo.modules.devmenu.compose.primitives.
|
|
20
|
-
import expo.modules.devmenu.compose.primitives.RowLayout
|
|
29
|
+
import expo.modules.devmenu.compose.primitives.NewText
|
|
30
|
+
import expo.modules.devmenu.compose.primitives.RoundedSurface
|
|
21
31
|
import expo.modules.devmenu.compose.primitives.Spacer
|
|
22
|
-
import expo.modules.devmenu.compose.primitives.Surface
|
|
23
|
-
import expo.modules.devmenu.compose.primitives.Text
|
|
24
|
-
import expo.modules.devmenu.compose.theme.Theme
|
|
25
32
|
|
|
26
33
|
@Composable
|
|
27
|
-
fun AppHeader(
|
|
28
|
-
|
|
34
|
+
fun AppHeader(
|
|
35
|
+
onProfileClick: () -> Unit,
|
|
36
|
+
modifier: Modifier = Modifier
|
|
37
|
+
) {
|
|
38
|
+
val isRunningInPreview = Build.DEVICE == "layoutlib"
|
|
29
39
|
if (isRunningInPreview) {
|
|
30
40
|
// In the preview, we don't have access to the app service or session service.
|
|
31
41
|
// We can use a placeholder app name and current account.
|
|
@@ -44,6 +54,7 @@ fun AppHeader(onProfileClick: () -> Unit) {
|
|
|
44
54
|
val user = currentUser.value
|
|
45
55
|
|
|
46
56
|
AppHeader(
|
|
57
|
+
modifier = modifier,
|
|
47
58
|
appName = appService.applicationInfo.appName,
|
|
48
59
|
currentAccount = when (user) {
|
|
49
60
|
UserState.Fetching, UserState.LoggedOut -> null
|
|
@@ -56,50 +67,64 @@ fun AppHeader(onProfileClick: () -> Unit) {
|
|
|
56
67
|
@Composable
|
|
57
68
|
fun AppHeader(
|
|
58
69
|
appName: String,
|
|
70
|
+
modifier: Modifier = Modifier,
|
|
59
71
|
currentAccount: MeQuery.Account? = null,
|
|
60
72
|
onProfileClick: () -> Unit = {}
|
|
61
73
|
) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
Row(
|
|
75
|
+
horizontalArrangement = Arrangement.spacedBy(NewAppTheme.spacing.`3`),
|
|
76
|
+
verticalAlignment = Alignment.CenterVertically,
|
|
77
|
+
modifier = modifier
|
|
78
|
+
) {
|
|
79
|
+
AppIcon()
|
|
80
|
+
|
|
81
|
+
Column(
|
|
82
|
+
verticalArrangement = Arrangement.spacedBy(NewAppTheme.spacing.`1`)
|
|
83
|
+
) {
|
|
84
|
+
NewText(
|
|
85
|
+
appName,
|
|
86
|
+
style = NewAppTheme.font.lg.merge(
|
|
87
|
+
fontWeight = FontWeight.SemiBold
|
|
88
|
+
)
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
NewText(
|
|
92
|
+
"Development Build",
|
|
93
|
+
color = NewAppTheme.colors.text.secondary
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
Spacer(
|
|
98
|
+
modifier = Modifier.weight(1f)
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
RoundedSurface(
|
|
102
|
+
borderRadius = NewAppTheme.borderRadius.full,
|
|
103
|
+
color = NewAppTheme.colors.background.element
|
|
104
|
+
) {
|
|
105
|
+
Button(onClick = onProfileClick) {
|
|
106
|
+
Box(
|
|
107
|
+
modifier = Modifier.size(44.dp),
|
|
108
|
+
contentAlignment = Alignment.Center
|
|
109
|
+
) {
|
|
110
|
+
val profilePhoto = currentAccount?.ownerUserActor?.profilePhoto
|
|
111
|
+
|
|
112
|
+
if (profilePhoto != null) {
|
|
113
|
+
AsyncImage(
|
|
114
|
+
url = profilePhoto
|
|
73
115
|
)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
DayNighIcon(
|
|
80
|
-
id = R.drawable.user_icon,
|
|
81
|
-
contentDescription = "Expo Logo",
|
|
116
|
+
} else {
|
|
117
|
+
Icon(
|
|
118
|
+
painter = painterResource(R.drawable.user),
|
|
119
|
+
contentDescription = "User Icon",
|
|
120
|
+
tint = NewAppTheme.colors.icon.tertiary,
|
|
82
121
|
modifier = Modifier
|
|
83
|
-
.
|
|
122
|
+
.size(24.dp)
|
|
84
123
|
)
|
|
85
124
|
}
|
|
86
125
|
}
|
|
87
126
|
}
|
|
88
127
|
}
|
|
89
|
-
) {
|
|
90
|
-
Column {
|
|
91
|
-
Heading(
|
|
92
|
-
text = appName
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
Spacer(Theme.spacing.tiny)
|
|
96
|
-
|
|
97
|
-
Text(
|
|
98
|
-
text = "Development Build",
|
|
99
|
-
fontSize = Theme.typography.small,
|
|
100
|
-
color = Theme.colors.text.secondary
|
|
101
|
-
)
|
|
102
|
-
}
|
|
103
128
|
}
|
|
104
129
|
}
|
|
105
130
|
|
|
@@ -108,7 +133,8 @@ fun AppHeader(
|
|
|
108
133
|
fun AppHeaderPreview() {
|
|
109
134
|
ScreenHeaderContainer {
|
|
110
135
|
AppHeader(
|
|
111
|
-
appName = "BareExpo"
|
|
136
|
+
appName = "BareExpo",
|
|
137
|
+
modifier = Modifier.padding(NewAppTheme.spacing.`4`)
|
|
112
138
|
)
|
|
113
139
|
}
|
|
114
140
|
}
|
|
@@ -2,7 +2,20 @@ package expo.modules.devlauncher.compose.ui
|
|
|
2
2
|
|
|
3
3
|
import androidx.compose.animation.core.tween
|
|
4
4
|
import androidx.compose.animation.fadeIn
|
|
5
|
+
import androidx.compose.foundation.background
|
|
6
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
7
|
+
import androidx.compose.foundation.layout.Box
|
|
8
|
+
import androidx.compose.foundation.layout.Column
|
|
9
|
+
import androidx.compose.foundation.layout.Row
|
|
10
|
+
import androidx.compose.foundation.layout.fillMaxWidth
|
|
11
|
+
import androidx.compose.foundation.layout.navigationBarsPadding
|
|
12
|
+
import androidx.compose.foundation.layout.padding
|
|
13
|
+
import androidx.compose.foundation.layout.size
|
|
14
|
+
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
5
15
|
import androidx.compose.runtime.Composable
|
|
16
|
+
import androidx.compose.ui.Modifier
|
|
17
|
+
import androidx.compose.ui.draw.clip
|
|
18
|
+
import androidx.compose.ui.unit.dp
|
|
6
19
|
import com.composables.core.ModalBottomSheet
|
|
7
20
|
import com.composables.core.ModalBottomSheetState
|
|
8
21
|
import com.composables.core.Scrim
|
|
@@ -10,7 +23,7 @@ import com.composables.core.Sheet
|
|
|
10
23
|
import com.composables.core.SheetDetent
|
|
11
24
|
import com.composables.core.SheetDetent.Companion.Hidden
|
|
12
25
|
import com.composables.core.rememberModalBottomSheetState
|
|
13
|
-
import expo.modules.
|
|
26
|
+
import expo.modules.devmenu.compose.newtheme.NewAppTheme
|
|
14
27
|
|
|
15
28
|
val Full = SheetDetent(identifier = "full") { containerHeight, sheetHeight ->
|
|
16
29
|
containerHeight * 0.90f
|
|
@@ -36,7 +49,34 @@ fun BottomSheet(
|
|
|
36
49
|
enter = fadeIn(animationSpec = tween(durationMillis = 300))
|
|
37
50
|
)
|
|
38
51
|
Sheet {
|
|
39
|
-
|
|
52
|
+
Column(
|
|
53
|
+
modifier = Modifier
|
|
54
|
+
.clip(
|
|
55
|
+
RoundedCornerShape(
|
|
56
|
+
topStart = NewAppTheme.borderRadius.xxxl,
|
|
57
|
+
topEnd = NewAppTheme.borderRadius.xxxl
|
|
58
|
+
)
|
|
59
|
+
)
|
|
60
|
+
.background(NewAppTheme.colors.background.default)
|
|
61
|
+
.navigationBarsPadding()
|
|
62
|
+
.padding(horizontal = NewAppTheme.spacing.`4`)
|
|
63
|
+
.padding(bottom = NewAppTheme.spacing.`4`)
|
|
64
|
+
) {
|
|
65
|
+
Row(
|
|
66
|
+
horizontalArrangement = Arrangement.Center,
|
|
67
|
+
modifier = Modifier
|
|
68
|
+
.fillMaxWidth()
|
|
69
|
+
.padding(
|
|
70
|
+
top = NewAppTheme.spacing.`2`,
|
|
71
|
+
bottom = NewAppTheme.spacing.`4`
|
|
72
|
+
)
|
|
73
|
+
) {
|
|
74
|
+
Box(
|
|
75
|
+
modifier = Modifier
|
|
76
|
+
.size(width = 60.dp, height = 5.dp)
|
|
77
|
+
.background(NewAppTheme.colors.border.secondary, shape = RoundedCornerShape(size = 5.dp))
|
|
78
|
+
)
|
|
79
|
+
}
|
|
40
80
|
content()
|
|
41
81
|
}
|
|
42
82
|
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
package expo.modules.devlauncher.compose.ui
|
|
2
2
|
|
|
3
3
|
import androidx.compose.foundation.background
|
|
4
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
4
5
|
import androidx.compose.foundation.layout.Box
|
|
5
6
|
import androidx.compose.foundation.layout.IntrinsicSize
|
|
6
7
|
import androidx.compose.foundation.layout.Row
|
|
7
8
|
import androidx.compose.foundation.layout.fillMaxHeight
|
|
8
9
|
import androidx.compose.foundation.layout.height
|
|
9
10
|
import androidx.compose.foundation.layout.navigationBarsPadding
|
|
11
|
+
import androidx.compose.foundation.layout.padding
|
|
10
12
|
import androidx.compose.runtime.Composable
|
|
13
|
+
import androidx.compose.runtime.getValue
|
|
11
14
|
import androidx.compose.ui.Alignment
|
|
12
15
|
import androidx.compose.ui.Modifier
|
|
13
16
|
import androidx.compose.ui.res.painterResource
|
|
@@ -16,43 +19,44 @@ import androidx.navigation.NavDestination.Companion.hasRoute
|
|
|
16
19
|
import androidx.navigation.compose.currentBackStackEntryAsState
|
|
17
20
|
import expo.modules.devlauncher.R
|
|
18
21
|
import expo.modules.devlauncher.compose.Tab
|
|
19
|
-
import expo.modules.devmenu.compose.theme.Theme
|
|
20
|
-
import androidx.compose.runtime.getValue
|
|
21
22
|
import expo.modules.devlauncher.compose.routes.Routes
|
|
23
|
+
import expo.modules.devmenu.compose.newtheme.NewAppTheme
|
|
22
24
|
|
|
23
25
|
@Composable
|
|
24
26
|
fun BottomTabBar(
|
|
25
27
|
navController: NavController
|
|
26
28
|
) {
|
|
27
29
|
Box(
|
|
28
|
-
contentAlignment = Alignment.
|
|
30
|
+
contentAlignment = Alignment.Center
|
|
29
31
|
) {
|
|
30
32
|
Row(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
horizontalArrangement = Arrangement.spacedBy(NewAppTheme.spacing.`3`),
|
|
34
|
+
modifier = Modifier
|
|
35
|
+
.background(NewAppTheme.colors.background.default)
|
|
33
36
|
.height(IntrinsicSize.Max)
|
|
34
37
|
.navigationBarsPadding()
|
|
38
|
+
.padding(horizontal = NewAppTheme.spacing.`3`)
|
|
35
39
|
) {
|
|
36
40
|
val navBackStackEntry by navController.currentBackStackEntryAsState()
|
|
37
41
|
val currentDestination = navBackStackEntry?.destination
|
|
38
42
|
|
|
39
|
-
val buttonModifier = Modifier
|
|
43
|
+
val buttonModifier = Modifier
|
|
40
44
|
.weight(1f)
|
|
41
45
|
.fillMaxHeight()
|
|
42
46
|
val icons = listOf(
|
|
43
47
|
Tab(
|
|
44
48
|
label = "Home",
|
|
45
|
-
icon = painterResource(id = R.drawable.
|
|
49
|
+
icon = painterResource(id = R.drawable.home),
|
|
46
50
|
screen = Routes.Home
|
|
47
51
|
),
|
|
48
52
|
Tab(
|
|
49
|
-
label = "
|
|
50
|
-
icon = painterResource(id = R.drawable.
|
|
53
|
+
label = "Updates",
|
|
54
|
+
icon = painterResource(id = R.drawable.reload),
|
|
51
55
|
screen = Routes.Updates
|
|
52
56
|
),
|
|
53
57
|
Tab(
|
|
54
58
|
label = "Settings",
|
|
55
|
-
icon = painterResource(id = R.drawable.
|
|
59
|
+
icon = painterResource(id = R.drawable.settings),
|
|
56
60
|
screen = Routes.Settings
|
|
57
61
|
)
|
|
58
62
|
)
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
package expo.modules.devlauncher.compose.ui
|
|
2
2
|
|
|
3
|
+
import androidx.compose.foundation.background
|
|
4
|
+
import androidx.compose.foundation.clickable
|
|
5
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
3
6
|
import androidx.compose.foundation.layout.Column
|
|
4
7
|
import androidx.compose.foundation.layout.padding
|
|
5
8
|
import androidx.compose.foundation.layout.size
|
|
9
|
+
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
6
10
|
import androidx.compose.runtime.Composable
|
|
7
11
|
import androidx.compose.ui.Alignment
|
|
8
12
|
import androidx.compose.ui.Modifier
|
|
13
|
+
import androidx.compose.ui.draw.clip
|
|
14
|
+
import androidx.compose.ui.graphics.Color
|
|
9
15
|
import androidx.compose.ui.graphics.painter.Painter
|
|
16
|
+
import androidx.compose.ui.text.font.FontWeight
|
|
10
17
|
import androidx.compose.ui.unit.dp
|
|
11
|
-
import com.composeunstyled.Button
|
|
12
18
|
import com.composeunstyled.Icon
|
|
13
|
-
import expo.modules.devmenu.compose.
|
|
14
|
-
import expo.modules.devmenu.compose.primitives.
|
|
15
|
-
import expo.modules.devmenu.compose.theme.Theme
|
|
19
|
+
import expo.modules.devmenu.compose.newtheme.NewAppTheme
|
|
20
|
+
import expo.modules.devmenu.compose.primitives.NewText
|
|
16
21
|
|
|
17
22
|
@Composable
|
|
18
23
|
fun BottomTabButton(
|
|
@@ -22,28 +27,46 @@ fun BottomTabButton(
|
|
|
22
27
|
modifier: Modifier = Modifier,
|
|
23
28
|
onClick: () -> Unit
|
|
24
29
|
) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} else {
|
|
32
|
-
Theme.colors.icon.default
|
|
33
|
-
},
|
|
34
|
-
contentDescription = "$label Icon",
|
|
35
|
-
modifier = Modifier.size(18.dp)
|
|
30
|
+
Column(
|
|
31
|
+
horizontalAlignment = Alignment.Companion.CenterHorizontally,
|
|
32
|
+
verticalArrangement = Arrangement.spacedBy(NewAppTheme.spacing.`1`),
|
|
33
|
+
modifier = modifier
|
|
34
|
+
.clip(
|
|
35
|
+
RoundedCornerShape(NewAppTheme.borderRadius.md)
|
|
36
36
|
)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
.clickable(enabled = !isSelected) {
|
|
38
|
+
onClick()
|
|
39
|
+
}
|
|
40
|
+
.background(
|
|
41
|
+
if (isSelected) {
|
|
42
|
+
NewAppTheme.colors.background.info
|
|
43
43
|
} else {
|
|
44
|
-
|
|
44
|
+
Color.Unspecified
|
|
45
45
|
}
|
|
46
46
|
)
|
|
47
|
-
|
|
47
|
+
.padding(vertical = NewAppTheme.spacing.`2`)
|
|
48
|
+
) {
|
|
49
|
+
Icon(
|
|
50
|
+
painter = icon,
|
|
51
|
+
tint = if (isSelected) {
|
|
52
|
+
NewAppTheme.colors.icon.info
|
|
53
|
+
} else {
|
|
54
|
+
NewAppTheme.colors.icon.quaternary
|
|
55
|
+
},
|
|
56
|
+
contentDescription = "$label Icon",
|
|
57
|
+
modifier = Modifier.size(24.dp)
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
NewText(
|
|
61
|
+
label,
|
|
62
|
+
style = NewAppTheme.font.sm.merge(
|
|
63
|
+
fontWeight = FontWeight.Medium
|
|
64
|
+
),
|
|
65
|
+
color = if (isSelected) {
|
|
66
|
+
NewAppTheme.colors.icon.info
|
|
67
|
+
} else {
|
|
68
|
+
NewAppTheme.colors.icon.quaternary
|
|
69
|
+
}
|
|
70
|
+
)
|
|
48
71
|
}
|
|
49
72
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package expo.modules.devlauncher.compose.ui
|
|
2
2
|
|
|
3
3
|
import androidx.compose.foundation.BorderStroke
|
|
4
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
4
5
|
import androidx.compose.foundation.layout.Box
|
|
5
6
|
import androidx.compose.foundation.layout.Column
|
|
6
7
|
import androidx.compose.foundation.layout.fillMaxWidth
|
|
@@ -8,36 +9,42 @@ import androidx.compose.foundation.layout.padding
|
|
|
8
9
|
import androidx.compose.runtime.Composable
|
|
9
10
|
import androidx.compose.ui.Modifier
|
|
10
11
|
import androidx.compose.ui.tooling.preview.Preview
|
|
11
|
-
import
|
|
12
|
+
import androidx.compose.ui.unit.dp
|
|
13
|
+
import expo.modules.devmenu.compose.newtheme.NewAppTheme
|
|
14
|
+
import expo.modules.devmenu.compose.primitives.NewText
|
|
12
15
|
import expo.modules.devmenu.compose.primitives.RoundedSurface
|
|
13
|
-
import expo.modules.devmenu.compose.primitives.Spacer
|
|
14
|
-
import expo.modules.devmenu.compose.primitives.Text
|
|
15
|
-
import expo.modules.devmenu.compose.theme.Theme
|
|
16
16
|
|
|
17
17
|
@Composable
|
|
18
18
|
fun DevelopmentSessionHelper() {
|
|
19
|
-
Column
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
Column(
|
|
20
|
+
verticalArrangement = Arrangement.spacedBy(NewAppTheme.spacing.`3`)
|
|
21
|
+
) {
|
|
22
|
+
NewText(
|
|
23
|
+
"Start a local development server with:"
|
|
24
|
+
)
|
|
23
25
|
|
|
24
26
|
RoundedSurface(
|
|
25
|
-
color =
|
|
27
|
+
color = NewAppTheme.colors.background.subtle,
|
|
26
28
|
border = BorderStroke(
|
|
27
|
-
width =
|
|
28
|
-
color =
|
|
29
|
+
width = 1.dp,
|
|
30
|
+
color = NewAppTheme.colors.border.default
|
|
29
31
|
),
|
|
30
32
|
modifier = Modifier
|
|
31
33
|
.fillMaxWidth()
|
|
32
34
|
) {
|
|
33
|
-
Box(modifier = Modifier.padding(
|
|
34
|
-
|
|
35
|
+
Box(modifier = Modifier.padding(NewAppTheme.spacing.`3`)) {
|
|
36
|
+
NewText(
|
|
37
|
+
"npx expo start",
|
|
38
|
+
style = NewAppTheme.font.md.merge(
|
|
39
|
+
fontFamily = NewAppTheme.font.mono
|
|
40
|
+
)
|
|
41
|
+
)
|
|
35
42
|
}
|
|
36
43
|
}
|
|
37
44
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
NewText(
|
|
46
|
+
"Then, select the local server when it appears here."
|
|
47
|
+
)
|
|
41
48
|
}
|
|
42
49
|
}
|
|
43
50
|
|