-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Android): add basic onboarding UX #592
Conversation
androidApp/src/main/java/com/mbta/tid/mbta_app/android/ContentView.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
androidApp/src/main/java/com/mbta/tid/mbta_app/android/ContentView.kt
Outdated
Show resolved
Hide resolved
settingsRepository: ISettingsRepository = koinInject() | ||
) { | ||
val coroutineScope = rememberCoroutineScope() | ||
var sharingLocation by remember { mutableStateOf(false) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Is it safe to use remember
instead of rememberSaveable
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not! If the orientation changes, the permission response is ignored, because this will have been forgotten. Good catch.
class OnboardingScreenViewTest { | ||
@get:Rule val composeTestRule = createComposeRule() | ||
|
||
// We can't easily mock the permission request, so we grant the permission eagerly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 nice
this was working always locally and never in CI. weird
map.mapboxMap.addOnMapClickListener { point -> handleStopClick(map, point) } | ||
map.location.setLocationProvider(locationProvider) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After completing the onboarding flow, the LocationDataManager.currentLocation
already has the current location when the HomeMapView
is being initialized, so if we don't setLocationProvider
until after we've already collect
ed, the first location will be completely lost, the puck won't show, and recentering will not work. (This was not fun to track down.)
Summary
Ticket: 🤖 | Onboarding Flow UX
Adds the basic onboarding UX to Android.
iOS
android
Testing
Verified that the fixed onboarding screens appear on first launch and the hide maps onboarding screen appears if TalkBack is turned on. Added unit tests for each individual screen and the overall flow, similar to what exists on iOS.