Android - Request money - Transition is not smooth after changing currency in currency selector and tapping continue
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Launch the app and login
- Tap + fab button and select "Request money"
- In request money page select a different currency and continue
Expected Result:
Transition back to request money page is smooth
Actual Result:
Number pad appears for a brief moment
Workaround:
Unknown
Platform:
Where is this issue occurring?
- Android
Version Number: 1.1.19-3
Reproducible in staging?: Yes
Reproducible in production?: Yes
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
https://user-images.githubusercontent.com/43996225/145512625-56aa1222-8158-4808-be6f-0d29a5f1425b.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause
Slack conversation:
Triggered auto assignment to @luacmartins (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
I could reproduce this in dev. This issue can be external.
Triggered auto assignment to @jliexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Proposal:
This problem is occurring because in android keyboard can't keep up to close before navigation is done.
Solution: We have to import Keyboard component from react-native and in functions that carry out Navigation.goBack() have to close Keyboard — Keyboard.dismiss().
Here: https://github.com/Expensify/App/blob/d827b9b9abdee6dd8cedb520ce51f38e39dccf3e/src/pages/iou/IOUCurrencySelection.js#L172 to :
onCloseButtonPress={() => {
Keyboard.dismiss();
Navigation.goBack();
}}
and here: https://github.com/Expensify/App/blob/d827b9b9abdee6dd8cedb520ce51f38e39dccf3e/src/pages/iou/IOUCurrencySelection.js#L154-L157 to:
confirmCurrencySelection() {
setIOUSelectedCurrency(this.state.toggledCurrencyCode);
Keyboard.dismiss();
Navigation.goBack();
}
https://user-images.githubusercontent.com/71173662/145657805-49d73291-d06c-4a9e-9f33-3496f20e7190.mp4
Posted!
Internal - https://www.upwork.com/ab/applicants/1470185909131399168/job-details External - https://www.upwork.com/jobs/~0195d90c9e8e28435e
Triggered auto assignment to @parasharrajat (Exported)
Triggered auto assignment to @mountiny (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@developvsn I had tried that solution before and it didn't seem to work, at least on my emulator. Does it work on your end?
But we think it depends on android processor or/and graphics card.
That may be it.
Can you please try this variant and give us feedback.Thank you.
I'll let either @parasharrajat or @mountiny take it from here since they are assigned to the issue. I just pitched in since I had tried your original proposed solution and still had issues on my end.
To me, this issue does not seem worthwhile. navigating back should close the keyboard automatically. It is handled by react-navigation.
On the other hand, adding a delay just to close the keyboard is also not a good option. You don't know how much time does the OS takes to close the keyboard. IOS /Android both work differently, I bet this issue must not be happening in IOS. I would say do nothing and I think Marc would say the same. 🕵🏼.
If we want to still proceed with this issue @developvsn has proposed a solution and @RGutu is the same user.
@mountiny Lead the way. :crown: .
:ribbon: :eyes: :ribbon:
(accidentally deleted message) @luacmartins Yep.But we think it depends on android processor or/and graphics card.We think that it will be a good idea to add some delay before navigation.It won't be observed by user, but transition back will be smoother. Like that:
confirmCurrencySelection() { setIOUSelectedCurrency(this.state.toggledCurrencyCode); Keyboard.dismiss(); setTimeout(() => Navigation.goBack(), 100) }
onCloseButtonPress={() => { Keyboard.dismiss(); setTimeout(() => Navigation.goBack(), 100); }}
result:
https://user-images.githubusercontent.com/92646072/145857311-85a548fc-6416-4f23-b7ef-8f5e99630f23.mp4
Can you please try this variant and give us feedback.Thank you.
IOS /Android both work differently, I bet this issue must not be happening in IOS.
So, we also can check and make this changes only on Android.
Yes, I agree with @parasharrajat here. We tend to not introduce some exceptions and "hacky" solutions as that obliously increases the complexity of the codebase and makes it hard to follow. I think it is not worth adding this one-off change here only as it does happen only on Android and as mentioned by @developvsn it might be also tightly related to the GPU performance of the phone itself.
Therefore, I would incline to not act for now and this issue might be reopened anytime in future if we will focus on polishing the UX to 100% in most use cases but for now, this feel like an edge case (how often will one change the currencies they use to send).
Thank you for the proposal @developvsn and sorry we wont go ahead. As mentioned, there is a chance we would revisit this in future.
Thanks for the updates everyone, job removed from Upworks.