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

Swapping From and To fields sometimes results in an animation glitch #732

Closed
AcharyaS97 opened this issue Dec 16, 2020 · 4 comments · Fixed by #895
Closed

Swapping From and To fields sometimes results in an animation glitch #732

AcharyaS97 opened this issue Dec 16, 2020 · 4 comments · Fixed by #895
Assignees
Labels
beginner job 🔰 This is a relatively easy task suitable for new contributors. bug 🐞 A functional defect or unexpected behavior.

Comments

@AcharyaS97
Copy link

AcharyaS97 commented Dec 16, 2020

Describe the bug

It looks like there's a bug in the DirectionsFragment where if the From and To fields are both empty and you try swapping them, there's an animation glitch where it'll do the swap but then the hint text will reset. I saw that there have been a few issues relating to the DirectionsFragment with the 2 LocationViews for From and To, and there was a Pull Request #722 that addressed some problems. If that PR or some other PR addresses the problem I mention here then do let me know.

To Reproduce
Steps to reproduce the behavior:

(3 and 4 are separate usecases where I observed weird behavior.

  1. Open the directions view (click the left turn arrow in the map view)

  2. Make sure that both the From and To fields are empty and only the hint text is showing

  3. Type something in either From or To but don't select an option from the search results

  4. Click the swap button on the UI.

Notice that if the fields are empty, the swap will happen but the hint text on the From and To fields will reset to their original positions after the animation ends. If either field is populated but it's not a result from Search task, that field will be erased.

Expected behavior

For the 3. case (with both fields empty), the simplest solution might be just to not do anything if the swap is clicked and both From and To fields don't have any text in them.

For the 4. case (where the fields are populated with text but don't have a Location selected from the search results) I think it might be a little more complicated.

From looking at how the swap works, I understand that it doesn't actually change the positions of the two LocationViews, just swaps the underlying saved locations in those views. We could update this to actually swap the positions of those views? Alternatively we could change to swap the text of the LocationViews by surfacing a method in the LocationView to set the Text of the TextView in the LocationViewHolder independent of the Location it has stored.

Versions (please complete the following information):

  • Transportr Version: [2.1.0]
  • Device: [Samsung A70]
  • Android Version: [10]
@AcharyaS97 AcharyaS97 added the bug 🐞 A functional defect or unexpected behavior. label Dec 16, 2020
@ialokim
Copy link
Collaborator

ialokim commented Dec 16, 2020

Thanks for your issue report! These are indeed independent of #722.

I would propose to just disable/hide the button in both cases as an easy bugfix.

@AcharyaS97
Copy link
Author

Alright, I'll update it!

@AcharyaS97
Copy link
Author

Also saw a similar issue with the "Favourite" icon where if you had valid From and To locations, but then you used the clear button on either one, the "Favourite" icon would not go away, which doesn't make sense. Have pushed fix for both issues in associated PR.

@Altonss
Copy link
Collaborator

Altonss commented Dec 6, 2023

Just opened a PR to fix this issue, feel free to try it out :)
Edit: oh sorry I didn't see the linked PR #733

@Altonss Altonss added the beginner job 🔰 This is a relatively easy task suitable for new contributors. label Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner job 🔰 This is a relatively easy task suitable for new contributors. bug 🐞 A functional defect or unexpected behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants