Skip to content
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

Show in progress spinner after phone number is confirmed in EnterPhoneNumberFragment #13042

Closed

Conversation

clauz9
Copy link
Contributor

@clauz9 clauz9 commented Jul 3, 2023

First time contributor checklist

Contributor checklist

  • Samsung A14, Android 13
  • Nokia 3.1, Android 10
  • My contribution is fully baked and ready to be merged as is
  • I ensure that all the open issues my contribution fixes are mentioned in the commit message of my first commit using the Fixes #1234 syntax

Description

Current behavior of the continue/progress button, in EnterPhoneNumberFragment makes for a confusing user experience.

GIF Recording Before changes

before

after you confirm the phone number, the spinner is canceled, and the user is left with an active "Continue" button, and no indication that something is happening in the background.

the spinner is cancelled by this call to exitInProgressUiState() on line 473

.subscribe(canSkipSms -> showConfirmNumberDialogIfTranslated(context,
viewModel.hasUserSkippedReRegisterFlow() ? R.string.RegistrationActivity_additional_verification_required
: R.string.RegistrationActivity_phone_number_verification_dialog_title,
canSkipSms ? null
: R.string.RegistrationActivity_a_verification_code_will_be_sent_to_this_number,
e164number,
() -> {
exitInProgressUiState();
ViewUtil.hideKeyboard(context, number.getEditText());
onConfirmed.run();
},
() -> {
exitInProgressUiState();
ViewUtil.focusAndMoveCursorToEndAndOpenKeyboard(this.number.getEditText());
}))

And also, it will be canceled by the use of the onDismissListener() in showConfirmNumberDialogIfTranslated()

which according to the docs is called for any reason, if the dialog is dismissed.

So I changed it with setOnCancelListener() which gets called, when you cancel the dialog, this includes tapping outside the dialog

This is the behavior after the change..

GIF Recording after changed

after

@clauz9
Copy link
Contributor Author

clauz9 commented Jul 13, 2023

This got fixed here e1570e9

Edit: Not entirely....

@clauz9 clauz9 closed this Jul 13, 2023
@clauz9 clauz9 reopened this Jul 13, 2023
@clauz9
Copy link
Contributor Author

clauz9 commented Jul 13, 2023

It turns out this change, e1570e9 causes an issue with the missing play services dialog

Screenshot

image

Because this line

starts the spinning animation as soon as the confirmNumberPrompt is displayed,
and since the missing play services dialog is displayed after that, if you dismiss it, at that point, the user is stuck on the EnterPhoneNumberFragment with a spinning circle animation, instead of a continue button

Deleting that line, ensures that the only start point for the circle animation is here.

private void onE164EnteredSuccessfully(@NonNull Context context, boolean fcmSupported) {
enterInProgressUiState();
Disposable disposable = viewModel.canEnterSkipSmsFlow()
.observeOn(AndroidSchedulers.mainThread())
.onErrorReturnItem(false)
.subscribe(canEnter -> {
if (canEnter) {
Log.i(TAG, "Enter skip flow");
SafeNavigation.safeNavigate(NavHostFragment.findNavController(this), EnterPhoneNumberFragmentDirections.actionReRegisterWithPinFragment());
} else {
Log.i(TAG, "Unable to collect necessary data to enter skip flow, returning to normal");
handleRequestVerification(context, fcmSupported);
}
});
disposables.add(disposable);
}

@clauz9 clauz9 force-pushed the registration_in_progress_ui_state branch from aedf51b to 89e4298 Compare July 13, 2023 22:07
@clauz9 clauz9 closed this Aug 15, 2023
@clauz9 clauz9 deleted the registration_in_progress_ui_state branch February 25, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant