Add "My Location" floating button to map#10
Open
fromalexx wants to merge 16 commits into
Open
Conversation
added 16 commits
April 1, 2026 21:33
AudioBufferProcessor.java and PacketCallback.java were stored as plain-text path pointers (Unix symlinks) which break on Windows. Replaced with actual file contents from PacketDroid submodule.
Packets arriving via igate (TYPE_IG) were only parsed and added to the map if the unrelated 'send my position to APRS-IS' (p.positiontois) preference was also enabled. This meant stations heard over igate showed in the log but never on the map unless that option was on. Fix: parse all TYPE_IG packets unconditionally, same as TYPE_POST and TYPE_INCMG packets.
- New checkbox in IGate settings: 'Auto-prepend GPS range filter' - New field: GPS filter radius in km (default 100) - When enabled, prepends r/lat/lon/radius to the custom filter string on login, so APRS-IS starts sending nearby traffic immediately - While connected, re-sends #filter command over the live socket whenever position changes by more than 5km (no reconnect needed) - Custom filter field still works normally; GPS filter is prepended - Falls back gracefully if no GPS fix is available
APRS-IS protocol requires the #filter command to be sent AFTER the server confirms login with '# logresp'. Sending it before (as part of sendLogin()) caused the server to silently ignore it, resulting in '# filter active' never appearing in the log and no range-based traffic being delivered. Fix: sendLogin() now only sends the 'user' line. A new sendFilterCommand() is called from the message loop when '# logresp' is detected.
sendFilterUpdate() was firing on the very first incoming packet because lastFilterLat/Lon were still 0,0. After sendFilterCommand() sends the filter on logresp, immediately sync lastFilterLat/Lon from GPS so shouldUpdateGpsFilter() won't trigger again until we actually move 5km.
- Add filterJustSent flag to skip shouldUpdateGpsFilter() on the same loop iteration that sendFilterCommand() ran, eliminating the duplicate '# filter active' line in the log - Replace fixed 5km threshold with 5% of the user's configured radius (e.g. 200km radius -> update every 10km, 50km -> every 2.5km) - Uses getLastKnownLocation() only, no additional GPS polling/battery use
Added check: if lastFilterLat/Lon are still 0.0/0.0, return false. This prevents sendFilterUpdate() firing on the first server message (aprsc banner) before sendFilterCommand() has run and set the baseline coordinates, which was causing the duplicate filter send.
…contents" This reverts commit 78b5dc10212813b6b059c947a25194bc0b9f49d6.
Floating button in bottom-right corner of the map. Tapping it looks up your callsign's last known position and centers the map there at zoom level 12. Shows a toast if no position is found yet.
Instead of an independent timer, mirrors the zoom controls visibility using OnGlobalLayoutListener so both fade and reappear in sync.
Author
|
And I am sorry for the confusion.. This PR includes changes from PR #8 as well. I did the first PR on my master branch without creating a new branch. So when I created this branch off my version of master it included those changes too. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a floating button to the bottom-right corner of the map view that instantly re-centers the map on your last known position.
Changes
A location button is placed above the built-in zoom controls. Tapping it:
The button's visibility and fade animation are fully synced with the built-in zoom controls — it appears and disappears at exactly the same time and speed. After tapping, the button hides until you interact with the map again.
I Disclosure
This code change was written by AI. Again, if its low quality, feel free to reject the PR or make any edits needed.