-
Notifications
You must be signed in to change notification settings - Fork 26
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
Fix quick settings back press #129
Conversation
// Press the device's back button | ||
uiDevice.pressBack() | ||
|
||
// Assert we're on PreviewScreen by finding the capture button |
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.
I think the capture button also shows in the quick settings screen. Maybe assert on the flip camera button being visible?
feature/preview/src/main/java/com/google/jetpackcamera/feature/preview/ui/TestTags.kt
Outdated
Show resolved
Hide resolved
when (shouldShowQuickSetting) { | ||
IsExpandedQuickSetting.NONE -> toggleIsOpen() | ||
else -> shouldShowQuickSetting = IsExpandedQuickSetting.NONE | ||
} |
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.
nit: Can you just put this inline in BackHandler
?
BackHandler {
when (shouldShowQuickSetting) {
IsExpandedQuickSetting.NONE -> toggleIsOpen()
else -> shouldShowQuickSetting = IsExpandedQuickSetting.NONE
}
}
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.
onBack is used again below so I made it into a val
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.
I only see it being used in the BackHandler
below. Where else is it being used?
Make it so pressing back button in quick settings screen would navigate back instead of closing the app.
Added two more tests in NavigationTest