Skip to content

Commit

Permalink
Fix back button behavior for QR code on Catalina
Browse files Browse the repository at this point in the history
Summary:
Modifies the code in AlohaDeviceAuthDialog.java related to animating the QR code when it is clicked on on Catalina to animate it and make it larger. There is an issue where if users hit the back button while the QR code is expanded, instead of returning to the regular split QR view the flow will navigate to the previous screen instead.

(note the user can also dismiss the QR view by clicking the center dpad button again.)

This fix also involved a slight change to DeviceAuthDialog.kt to allow for suppressing the regular back button functionality.

Differential Revision: D37332607

fbshipit-source-id: 846e767e0c53fd775d53daaa209e5fa0b6a2738f
  • Loading branch information
Austin Riopelle authored and facebook-github-bot committed Jun 22, 2022
1 parent 44dcef9 commit c694421
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ open class DeviceAuthDialog : DialogFragment() {
val dialog: Dialog =
object : Dialog(requireActivity(), R.style.com_facebook_auth_dialog) {
override fun onBackPressed() {
onBackButtonPressed()
super.onBackPressed()
if (onBackButtonPressed()) {
super.onBackPressed()
}
}
}
dialog.setContentView(initializeContentView(DeviceRequestsHelper.isAvailable() && !isRetry))
Expand Down Expand Up @@ -436,8 +437,8 @@ open class DeviceAuthDialog : DialogFragment() {
dialog?.dismiss()
}

protected open fun onBackButtonPressed() {
// no-op
protected open fun onBackButtonPressed(): Boolean {
return true
}

private class RequestState : Parcelable {
Expand Down

0 comments on commit c694421

Please sign in to comment.