[android] Add home screen widget for favorite bookmarks #10372

Open
coderang-gk wants to merge 3 commits from coderang-gk/feature-homescreen-widget-bookmark into master
coderang-gk commented 2025-03-01 16:03:14 +00:00 (Migrated from github.com)

Home Screen Widget Feature

This PR adds a home screen widget feature that displays a user-selected bookmark and opens directly to that location when tapped.

Key components:

  • FavoriteBookmarkWidget provider class
  • Configuration activity for selecting bookmarks
  • Supporting layouts and drawables
  • Integration with MwmActivity for handling widget taps

The widget improves user experience by providing one-tap access to frequently used locations without needing to navigate through the app's UI.

Screenshots

Resolves: #3649

# Home Screen Widget Feature This PR adds a home screen widget feature that displays a user-selected bookmark and opens directly to that location when tapped. ## Key components: - FavoriteBookmarkWidget provider class - Configuration activity for selecting bookmarks - Supporting layouts and drawables - Integration with MwmActivity for handling widget taps The widget improves user experience by providing one-tap access to frequently used locations without needing to navigate through the app's UI. ## Screenshots <div align="center"> <table> <tr> <td><img src="https://github.com/user-attachments/assets/c2934062-0ff5-45c1-a51e-e667a15cdc7e" width="200"/></td> <td><img src="https://github.com/user-attachments/assets/30197ab3-02d0-41db-803c-d13a6bae7d1e" width="200"/></td> <td><img src="https://github.com/user-attachments/assets/bee7e171-2929-4e94-8983-65ff0239bd42" width="200"/></td> </tr> <tr> <td><img src="https://github.com/user-attachments/assets/91697bcb-9af6-4d25-919c-c3ec06584c72" width="200"/></td> <td><img src="https://github.com/user-attachments/assets/442af3d7-7781-4707-90a9-3b418ced3966" width="200"/></td> <td><img src="https://github.com/user-attachments/assets/5d9cfed9-869e-4e1d-88e4-c6050679199f" width="200"/></td> </tr> </table> </div> Resolves: #3649
strump reviewed 2025-03-01 16:03:14 +00:00
kavikhalique (Migrated from github.com) reviewed 2025-03-01 16:03:14 +00:00
AndrewShkrob reviewed 2025-03-01 16:03:14 +00:00
rtsisyk reviewed 2025-03-01 16:03:14 +00:00
kirylkaveryn reviewed 2025-03-01 16:03:14 +00:00
strump reviewed 2025-03-02 11:29:33 +00:00

Please see translation documentation to understand how OrganicMaps handles texts. If you need to introduce new strings to the project then use ‘data/strings/strings.txt’ file

Please see translation [documentation](https://github.com/organicmaps/organicmaps/blob/master/docs/TRANSLATIONS.md) to understand how OrganicMaps handles texts. If you need to introduce new strings to the project then use ‘data/strings/strings.txt’ file
coderang-gk (Migrated from github.com) reviewed 2025-03-02 12:23:56 +00:00
coderang-gk (Migrated from github.com) commented 2025-03-02 12:23:55 +00:00

Sure, I will make changes accordingly.

Sure, I will make changes accordingly.
kavikhalique (Migrated from github.com) requested changes 2025-03-04 18:33:39 +00:00
kavikhalique (Migrated from github.com) commented 2025-03-04 11:02:03 +00:00

Please format the code as described in docs.

Please format the code as described in docs.
kavikhalique (Migrated from github.com) commented 2025-03-04 11:04:29 +00:00

Curly braces will start from new line, please check https://github.com/organicmaps/organicmaps/blob/master/docs/JAVA_STYLE.md

Curly braces will start from new line, please check https://github.com/organicmaps/organicmaps/blob/master/docs/JAVA_STYLE.md
kirylkaveryn requested changes 2025-03-06 11:17:31 +00:00

Why the catch block is empty? At least there should be exception logging.

Why the catch block is empty? At least there should be exception logging.

Why is it necessary to iterate twice by all the categories bookmarks in the whole app?
It looks like a huge overhead with a lot of custom logic for such operation that is equal to single tap on the map.

There are already exist method in the c++ core that finds the bookmark by tap: BuildAndSetPlacePageInfo. You can just create a build info with coords and pass it:

  place_page::BuildInfo info;
  info.m_mercator = mercator::FromLatLon(lat, lon);
  fm.BuildAndSetPlacePageInfo(info);

Please use the core c++ API to work with the bookmarks.

Why is it necessary to iterate **twice** by all the categories bookmarks in the whole app? It looks like a huge overhead with a lot of custom logic for such operation that is equal to single tap on the map. There are already exist method in the c++ core that finds the bookmark by tap: `BuildAndSetPlacePageInfo`. You can just create a build info with coords and pass it: ``` place_page::BuildInfo info; info.m_mercator = mercator::FromLatLon(lat, lon); fm.BuildAndSetPlacePageInfo(info); ``` Please use the core c++ API to work with the bookmarks.

Can you explain why there are 2 iterations over the categories?

Can you explain why there are 2 iterations over the categories?

All this logic is already implemented in the
d7db7df723/geometry/distance_on_sphere.cpp (L10-L23)

There should not be duplications. Please check how the android app works with the core.

All this logic is already implemented in the https://github.com/organicmaps/organicmaps/blob/d7db7df72373f31463e0c355a9baeb51b8bee4f1/geometry/distance_on_sphere.cpp#L10-L23 There should not be duplications. Please check how the android app works with the core.

I assume that instead of 5 method with almost the same signature, there should only be the one that trigger the core method, which is already implemented. It finds the bookmark and opens the place page.

I assume that instead of 5 method with almost the same signature, there should only be the one that trigger the core method, which is already implemented. It finds the bookmark and opens the place page.
This repo is archived. You cannot comment on pull requests.
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
5 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: organicmaps/organicmaps-tmp#10372
No description provided.