Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,21 @@ jobs:
env:
MAESTRO_CLI_NO_ANALYTICS: 1
timeout-minutes: 40
- name: 📦 Prepare testing artifacts
if: always()
run: |
# Rename .maestro to maestroArtifacts so it's not a hidden folder when downloaded locally
mv ~/.maestro ~/maestroArtifacts
- name: 📸 Store testing artifacts
if: always()
uses: actions/upload-artifact@v4
id: upload-artifacts
with:
name: bare-expo-artifacts-ios
path: |
~/.maestro/tests/**/*
~/maestroArtifacts/tests/**/*
~/Library/Logs/maestro/**/*
overwrite: true
include-hidden-files: true # .maestro is skipped otherwise
- name: 🔗 Artifacts download URL
if: always()
run: |
Expand Down Expand Up @@ -342,14 +346,19 @@ jobs:
# Run the actual tests
./scripts/start-android-e2e-test.ts --test
working-directory: ./apps/bare-expo
- name: 📦 Prepare testing artifacts
if: always()
run: |
# Rename .maestro to maestroArtifacts so it's not a hidden folder when downloaded locally
mv ~/.maestro ~/maestroArtifacts
- name: 📸 Store testing artifacts
if: always()
id: upload-artifacts
uses: actions/upload-artifact@v4
with:
name: bare-expo-artifacts-android
path: |
~/.maestro/tests/**/*
~/maestroArtifacts/tests/**/*
overwrite: true
- name: 🔗 Artifacts download URL
if: always()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import expo.modules.devmenu.compose.primitives.Spacer

Expand All @@ -18,6 +19,8 @@ typealias ComposableFunction = @Composable () -> Unit
fun ClickableItemRow(
text: String? = null,
icon: ComposableFunction? = null,
paddingVertical: Dp = 16.dp,
paddingHorizontal: Dp = 16.dp,
onClick: () -> Unit,
action: ComposableFunction? = null,
content: ComposableFunction? = null
Expand All @@ -26,7 +29,10 @@ fun ClickableItemRow(
modifier = Modifier
.fillMaxWidth()
.clickable(onClick = onClick)
.padding(16.dp),
.padding(
vertical = paddingVertical,
horizontal = paddingHorizontal
),
verticalAlignment = Alignment.CenterVertically
) {
if (icon != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.google.mlkit.vision.codescanner.GmsBarcodeScannerOptions
import com.google.mlkit.vision.codescanner.GmsBarcodeScanning
import host.exp.exponent.analytics.EXL
import host.exp.exponent.apollo.Paginator
import host.exp.exponent.experience.DevMenuSharedPreferencesAdapter
import host.exp.exponent.graphql.BranchDetailsQuery
import host.exp.exponent.graphql.BranchesForProjectQuery
import host.exp.exponent.graphql.Home_AccountAppsQuery
Expand Down Expand Up @@ -140,14 +141,18 @@ class HomeAppViewModel(
homeActivityEvents: MutableSharedFlow<HomeActivityEvent>,
private val authLauncher: ActivityResultLauncher<AuthRequestType>
) : AndroidViewModel(application) {

val userReviewState = MutableStateFlow(UserReviewState())

private val userReviewPrefs = application.getSharedPreferences(
USER_REVIEW_INFO_PREFS_KEY,
Context.MODE_PRIVATE
)

val devMenuPreferencesAdapter = DevMenuSharedPreferencesAdapter(
application,
exponentHistoryService.exponentSharedPreferences
)

private val gson = Gson()

private var lastCrashDate: Long? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,25 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.RadioButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Switch
import androidx.compose.material3.SwitchDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.core.net.toUri
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import expo.modules.devmenu.DevMenuPreferences
import host.exp.exponent.generated.ExponentBuildConstants
import host.exp.exponent.services.ThemeSetting
import host.exp.expoview.R
Expand Down Expand Up @@ -69,6 +75,8 @@ fun SettingsScreen(
onThemeSelected = { viewModel.selectedTheme.value = it }
)

DeveloperMenuSection(viewModel.devMenuPreferencesAdapter)

AppInfoSection(
clientVersion = viewModel.expoVersion ?: "unknown",
supportedSdk = getMajorVersion(ExponentBuildConstants.TEMPORARY_SDK_VERSION)
Expand Down Expand Up @@ -187,6 +195,125 @@ fun AppInfoSection(
}
}

@Composable
fun DeveloperMenuSection(
devMenuPreference: DevMenuPreferences
) {
var launchAtStart by remember { mutableStateOf(devMenuPreference.showsAtLaunch) }
var enableShake by remember { mutableStateOf(devMenuPreference.motionGestureEnabled) }
var enableThreeFingerLongPress by remember { mutableStateOf(devMenuPreference.touchGestureEnabled) }
var showFab by remember { mutableStateOf(devMenuPreference.showFab) }

DisposableEffect(true) {
val onNewPreferences = {
launchAtStart = devMenuPreference.showsAtLaunch
enableShake = devMenuPreference.motionGestureEnabled
enableThreeFingerLongPress = devMenuPreference.touchGestureEnabled
showFab = devMenuPreference.showFab
}

devMenuPreference.addOnChangeListener(onNewPreferences)
onDispose {
devMenuPreference.removeOnChangeListener(onNewPreferences)
}
}

@Composable
fun Switch(
checked: Boolean,
onCheckedChange: (Boolean) -> Unit
) {
Switch(
checked = checked,
onCheckedChange = onCheckedChange,
colors = SwitchDefaults.colors(
checkedThumbColor = MaterialTheme.colorScheme.primary,
checkedTrackColor = MaterialTheme.colorScheme.primaryContainer,
uncheckedThumbColor = MaterialTheme.colorScheme.outline,
uncheckedTrackColor = MaterialTheme.colorScheme.surfaceVariant,
checkedBorderColor = Color.Transparent,
uncheckedBorderColor = Color.Transparent
)
)
}

@Composable
fun SwitchRow(
text: String,
checked: Boolean,
onCheckedChange: (Boolean) -> Unit,
iconPainter: Painter
) {
ClickableItemRow(
text = text,
paddingVertical = 6.dp,
icon = {
Icon(
painter = iconPainter,
contentDescription = "$text icon",
tint = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.size(20.dp)
)
},
onClick = { onCheckedChange(!checked) },
action = {
Switch(
checked = checked,
onCheckedChange = onCheckedChange
)
}
)
}

LabeledGroup(label = "Developer Menu") {
SwitchRow(
text = "Show at launch",
checked = launchAtStart,
onCheckedChange = { newValue ->
launchAtStart = newValue
devMenuPreference.showsAtLaunch = newValue
},
iconPainter = painterResource(R.drawable.launch_at_start)
)

HorizontalDivider()

SwitchRow(
text = "Shake device",
checked = enableShake,
onCheckedChange = { newValue ->
enableShake = newValue
devMenuPreference.motionGestureEnabled = newValue
},
iconPainter = painterResource(R.drawable.shake)
)

HorizontalDivider()

SwitchRow(
text = "3 fingers long press",
checked = enableThreeFingerLongPress,
onCheckedChange = { newValue ->
enableThreeFingerLongPress = newValue
devMenuPreference.touchGestureEnabled = newValue
},
iconPainter = painterResource(R.drawable.three_finger_long_press)
)

HorizontalDivider()

SwitchRow(
text = "Action button",
checked = showFab,
onCheckedChange = { newValue ->
showFab = newValue
devMenuPreference.showFab = newValue
},
iconPainter = painterResource(R.drawable.fab)
)
}
}

@Composable
fun DeleteAccountSection() {
var deletionError by remember { mutableStateOf<String?>(null) }
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:pathData="M5.833,1.667C3.992,1.667 2.5,3.159 2.5,5V17.5C2.5,17.96 2.873,18.333 3.333,18.333C3.794,18.333 4.167,17.96 4.167,17.5V5C4.167,4.079 4.913,3.333 5.833,3.333H14.167C15.087,3.333 15.833,4.079 15.833,5V17.5C15.833,17.96 16.206,18.333 16.667,18.333C17.127,18.333 17.5,17.96 17.5,17.5V5C17.5,3.159 16.008,1.667 14.167,1.667H5.833Z"
android:fillColor="#80838D"/>
<path
android:pathData="M5,10C5,9.08 5.746,8.333 6.667,8.333H13.333C14.254,8.333 15,9.08 15,10V17.5C15,17.96 14.627,18.333 14.167,18.333H5.833C5.373,18.333 5,17.96 5,17.5V10Z"
android:fillColor="#80838D"/>
</vector>
10 changes: 10 additions & 0 deletions apps/expo-go/android/expoview/src/main/res/drawable/shake.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:pathData="M8.424,4.172C8.771,4.21 9.057,4.46 9.142,4.798L11.185,12.97L13.473,9.538C13.628,9.306 13.888,9.167 14.167,9.167H17.5C17.96,9.167 18.333,9.54 18.333,10C18.333,10.46 17.96,10.833 17.5,10.833H14.613L11.527,15.462C11.344,15.737 11.016,15.877 10.691,15.821C10.366,15.765 10.105,15.522 10.025,15.202L8.071,7.388L6.579,10.373C6.437,10.655 6.149,10.833 5.833,10.833H2.5C2.04,10.833 1.666,10.46 1.666,10C1.666,9.54 2.04,9.167 2.5,9.167H5.318L7.588,4.627C7.744,4.315 8.077,4.134 8.424,4.172Z"
android:fillColor="#8B8D98"
android:fillType="evenOdd"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:pathData="M5.968,2.5H6.667C7.127,2.5 7.5,2.873 7.5,3.333C7.5,3.794 7.127,4.167 6.667,4.167H6C5.52,4.167 5.209,4.167 4.973,4.187C4.747,4.205 4.663,4.236 4.622,4.258C4.465,4.337 4.337,4.465 4.258,4.622C4.236,4.663 4.205,4.747 4.187,4.973C4.167,5.209 4.167,5.52 4.167,6V6.667C4.167,7.127 3.794,7.5 3.333,7.5C2.873,7.5 2.5,7.127 2.5,6.667V5.968C2.5,5.529 2.5,5.15 2.525,4.837C2.552,4.508 2.612,4.18 2.772,3.865C3.012,3.395 3.395,3.012 3.865,2.772C4.18,2.612 4.508,2.552 4.837,2.525C5.15,2.5 5.529,2.5 5.968,2.5ZM15.027,4.187C14.791,4.167 14.481,4.167 14,4.167H13.333C12.873,4.167 12.5,3.794 12.5,3.333C12.5,2.873 12.873,2.5 13.333,2.5H14.032C14.471,2.5 14.85,2.5 15.163,2.525C15.492,2.552 15.82,2.612 16.135,2.772C16.605,3.012 16.988,3.395 17.228,3.865C17.388,4.18 17.448,4.508 17.475,4.837C17.5,5.15 17.5,5.529 17.5,5.968V6.667C17.5,7.127 17.127,7.5 16.667,7.5C16.206,7.5 15.833,7.127 15.833,6.667V6C15.833,5.52 15.833,5.209 15.813,4.973C15.795,4.747 15.764,4.663 15.743,4.622C15.663,4.465 15.535,4.337 15.378,4.258C15.337,4.236 15.253,4.205 15.027,4.187ZM3.333,12.5C3.794,12.5 4.167,12.873 4.167,13.333V14C4.167,14.481 4.167,14.791 4.187,15.027C4.205,15.253 4.236,15.337 4.258,15.378C4.337,15.535 4.465,15.663 4.622,15.743C4.663,15.764 4.747,15.795 4.973,15.813C5.209,15.833 5.52,15.833 6,15.833H6.667C7.127,15.833 7.5,16.206 7.5,16.667C7.5,17.127 7.127,17.5 6.667,17.5H5.968C5.529,17.5 5.15,17.5 4.837,17.475C4.508,17.448 4.18,17.388 3.865,17.228C3.395,16.988 3.012,16.605 2.772,16.135C2.612,15.82 2.552,15.492 2.525,15.163C2.5,14.85 2.5,14.471 2.5,14.032V13.333C2.5,12.873 2.873,12.5 3.333,12.5ZM16.667,12.5C17.127,12.5 17.5,12.873 17.5,13.333V14.032C17.5,14.471 17.5,14.85 17.475,15.163C17.448,15.492 17.388,15.82 17.228,16.135C16.988,16.605 16.605,16.988 16.135,17.228C15.82,17.388 15.492,17.448 15.163,17.475C14.85,17.5 14.471,17.5 14.032,17.5H13.333C12.873,17.5 12.5,17.127 12.5,16.667C12.5,16.206 12.873,15.833 13.333,15.833H14C14.481,15.833 14.791,15.833 15.027,15.813C15.253,15.795 15.337,15.764 15.378,15.743C15.535,15.663 15.663,15.535 15.743,15.378C15.764,15.337 15.795,15.253 15.813,15.027C15.833,14.791 15.833,14.481 15.833,14V13.333C15.833,12.873 16.206,12.5 16.667,12.5Z"
android:fillColor="#8B8D98"
android:fillType="evenOdd"/>
</vector>
Loading
Loading