-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 #2239 by adding a compass arrow for direction of nearest item #5433
Resolves #2239 by adding a compass arrow for direction of nearest item #5433
Conversation
In order to fix the unit tests, would you mind rebasing (or pulling) from main? Thanks :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love it!
It even works when holding the phone vertically, thanks for going the extra kilometer!
Code looks good too.
…nearest item (commons-app#5433) * Resolves issue commons-app#2239 by adding an arrow for direction * Removed unnecessary change in styles.xml * spacing * javadoc --------- Co-authored-by: Nicolas Raoul <[email protected]>
* Resolved issue #4513 * Localisation updates from https://translatewiki.net. * NearbyParentFragment : added referer (#5417) * NearbyParentFragment : added referer In file NearbyParentFragment.java, I added header property, i.e., the referer - http://maps.wikimedia.org/ and set tile source to wikimedia. * Reworded comments --------- Co-authored-by: Nicolas Raoul <[email protected]> * Localisation updates from https://translatewiki.net. * Localisation updates from https://translatewiki.net. * Removed butterknife from the quiz result activity (#5425) * ConnectRefuseError: removed the proxy from properties.gradle file to allow downloading of build tools during CI. (#5434) * NearbyParentFragment : added referer In file NearbyParentFragment.java, I added header property, i.e., the referer - http://maps.wikimedia.org/ and set tile source to wikimedia. * Reworded comments * sdkmanager: added installation command for build-tools-30.0.3 * Revert "sdkmanager: added installation command for build-tools-30.0.3" This reverts commit b3e5019. * Update android.yml * Update gradle.properties * android.yml: removed extra debug commands Removed some debug commands because they are no longer needed. --------- Co-authored-by: Nicolas Raoul <[email protected]> * Removed butterknife and inlined a couple of tiny methods (#5426) * Resolves #2239 by adding a compass arrow for direction of nearest item (#5433) * Resolves issue #2239 by adding an arrow for direction * Removed unnecessary change in styles.xml * spacing * javadoc --------- Co-authored-by: Nicolas Raoul <[email protected]> * Added voice input for caption and description (#5415) * Fixed Grey empty screen at Upload wizard caption step after denying files permission * Empty commit * Fixed loop issue * Created docs for earlier commits * Fixed javadoc * Fixed spaces * Added added basic features to OSM Maps * Added search location feature * Added filter to Open Street Maps * Fixed chipGroup in Open Street Maps * Removed mapBox code * Removed mapBox's code * Reformat code * Reformatted code * Removed rotation feature to map * Removed rotation files and Fixed Marker click problem * Ignored failing tests * Added voice input feature * Fixed test cases * Changed caption and description text --------- Co-authored-by: translatewiki.net <[email protected]> Co-authored-by: Rohit Verma <[email protected]> Co-authored-by: Nicolas Raoul <[email protected]> Co-authored-by: Paul Hawke <[email protected]> Co-authored-by: Kanahia <[email protected]>
Thank you so much Nicolas!! It's my pleasure to be of some use in this project ;) |
Description (required)
The CTA for the nearest item was missing the direction the user needed to head in. This PR aims to add a compass arrow to aid the user in moving in the direction of the nearest item without knowing where North is.
Fixes #2239
What changes did you make and why?
Computed bearing between the current location and the location of the nearest item and set the initial rotation of the compass arrow to the calculated bearing. Using the onSensorChanged, calculated the degree of rotation of the device and rotated the arrow accordingly, so that if the device is rotated by 30 degrees, the arrow does the same in the opposite direction.
Tests performed (required)
Tested prodDebug on OnePlus Nord CE 2 Lite with API level 31.
Screenshots (for UI changes only)
Example showing the accuracy of compass arrow:
Videos showing the rotation of the compass arrow with the device's rotation.
Dark Mode:
https://github.com/commons-app/apps-android-commons/assets/142137555/db6d20e2-3901-49c9-a661-5c6b58216248
Light Mode:
https://github.com/commons-app/apps-android-commons/assets/142137555/897868f0-3789-4262-916c-75aa1a0eabbd