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

Resolves #5444 & #5455 updating nearest item distance and direction as user moves #5459

Merged

Conversation

ShashwatKedia
Copy link
Contributor

Description (required)
This PR aims to add the feature of updating the distance from the nearest item as the user moves, which would aid the users while travelling towards it. Also, the bug of the compass not updating directions after walking past the place will be solved.

Fixes #5444 and #5455

What changes did you make and why?
Updated nearby banner whenever the location is changed slightly and fine-tuned the minimum distance and minimum time parameters to request for location updates. This will not only update the distance from the nearest item, but also update the direction of it, even after walking past the place.

Tests performed (required)

Tested prodDebug on OnePlusNord CE 2 Lite with API level 31.

Screenshots (for UI changes only)

Screencast showing updation of distance from nearest item as user moves:
https://drive.google.com/file/d/1_8RayBnvMDGLfYpSiwWTXui2PkgjO3iT/view?usp=share_link

@ShashwatKedia
Copy link
Contributor Author

@nicolas-raoul I've added code to update the nearby banner whenever the user moves by 1 m, which works approximately when the user moves 1-2 meters. Also, since the banner is updated, the direction also gets updated, so the problem of direction not updating when walking past the place is also solved.

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working great, thanks!
Only thing, it seems to flicker a bit, not a big issue really but feel free to create an issue & pull request about it if you want.

@nicolas-raoul nicolas-raoul merged commit 2c086b3 into commons-app:main Jan 21, 2024
1 check passed
@ShashwatKedia
Copy link
Contributor Author

Only thing, it seems to flicker a bit, not a big issue really but feel free to create an issue & pull request about it if you want.

The compass flickers because it's direction is being reset whenever user's location changes, I'll try to make it more calm if direction remains same ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update nearest location distance as user moves towards it, in home nearby banner
2 participants