[Android] Multiple place phones #845
Labels
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
3 participants
Due date
No due date set.
Dependencies
No dependencies set.
Reference: organicmaps/organicmaps-tmp#845
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "multiple-place-phones"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
POIs and places in OSM could have more than one phone number. Tag
phone
allows storing semicolon-separated list of numbers. E.g. https://osm.org/node/2143314850 https://osm.org/node/1693972693But Organicmaps supports only single phone number field. This PR adds support of multiple phone numbers for a place.
Place details
Before:
After:
Each phone has separate line. Tap to call, long tap to copy.
Call button
Before:
Pressing call button would initiate call to a concatenated phone number.
After:
If more than one phone is avaiilable a popup will appear
Editing
Before:
Single edit text to edit all phone numbers
After:
New phone editing UI
https://user-images.githubusercontent.com/720808/125300069-5d698b00-e332-11eb-80b8-231c724a7222.mp4
TODO
New string "Add phone" needs translation.
Screenshots:
Dark theme:

RTL Layout:

Redundant "android:layout_toLeftOf". Min api level is 21.
Redundant "android:layout_toLeftOf". Min api level is 21.
Redundant tags "android:paddingLeft" and "android:paddingRight". Min api level is 21.
Should change three lines to support RTL. Could you, please, check in other places.
@ -0,0 +14,4 @@
style="@style/MwmWidget.Editor.MetadataIcon"
tools:ignore="ContentDescription"
tools:src="@drawable/ic_phone"
android:layout_alignParentLeft="true"/>
Should use "android:layout_alignParentStart"
nit: As we already will have in this big vertical linear layout duplicating layout items, it would be great, if you will be able to refactor it to RecyclerView.
Opening brace should be at the beginning of the next line according to project code style. Could you, please, check in other places.
In case of single line "if" should not use braces according to project code style.
Should not comment, but just delete.
Possibly, should not comment, but just delete. It will stay in git history. Could you, please, check in other places.
@Endem10n I see that attribute
android:layout_toLeftOf
is used in fragment_editor.xml on Wi-Fi checkbox row.Should I replace RelativeLayout with LinearLayout to get rid of
android:layout_toLeftOf
property?Or how to correctly layout phone icon, phone number text view, and edit phone buton in a single row?
@strump my point is that you already have in the next line "android:layout_toStartOf="@+id/edit_phone", so all will work fine even without "android:layout_toLeftOf" at line 161.
Added RecyclerView to display multiple phones on place details fragment.
Removed unused commented code. Fixed formatting.
Changed layout to support RTL languages and removed redundant attributes.
@ -598,6 +598,7 @@
<string name="bookmarks_error_title_list_name_already_taken">Deze naam is al in gebruik</string>
<string name="bookmarks_error_message_list_name_already_taken">Kies alstublieft een andere naam</string>
<string name="please_wait">Even geduld aub…</string>
<string name="phone_number">Telefoonnummer</string>
Did you manually add it? I see that these strings were already present in the master branch, in data/strings/strings.txt and in XML android resources.
Why is it commented?
Why is it removed? Are phones properly stored and sent to OSM?
We format simple ifs in two lines for easier debugging.
How to properly define icons from XML, so they will work in both light and dark themes?
nit: we insert spaces after slashes.
Missed space after // and the dot at the end.
We try not to pollute logs with debug strings (esp. warning ones).
@ -598,6 +598,7 @@
<string name="bookmarks_error_title_list_name_already_taken">Deze naam is al in gebruik</string>
<string name="bookmarks_error_message_list_name_already_taken">Kies alstublieft een andere naam</string>
<string name="please_wait">Even geduld aub…</string>
<string name="phone_number">Telefoonnummer</string>
Viacheslav Greshilov removed "phone_number" string in commit #cca70039 and regenerated strings.xml in commit #2b46f73d
I restored "phone_number" in strings.xml, but looks like I need to revert data/strings/strings.txt first
I moved
Editor.nativeSetPhone(phone);
call toEditorHostFragment
class simmilar to cuisine, opening house, street editors. Becase I createdPhoneFragment
to edit multiple phones, this fragment has "Save" buttonI forgot to remove those logs. It's no use to log this text any more
@ -598,6 +598,7 @@
<string name="bookmarks_error_title_list_name_already_taken">Deze naam is al in gebruik</string>
<string name="bookmarks_error_message_list_name_already_taken">Kies alstublieft een andere naam</string>
<string name="please_wait">Even geduld aub…</string>
<string name="phone_number">Telefoonnummer</string>
Wow, this string was unused, interesting. Thanks!
@Endem10n @biodranik Гляньте фиксы, я думаю пора мержить уже.
@ma4ko What is the Bulgarian translation?
Uups, sorry, looks like conflicts should be resolved. We usually remove all commits with regenerated strings, rebase, and then generate strings again.
Thank you for contribution! I don't see any blockers, but please try to address code style comments from other reviewers. This patch will be merged as soon as we fix localization in the master.
@strump, to save time, I squashed and rebased this PR.
See https://github.com/organicmaps/organicmaps/tree/multiple-place-phones
Please address comments from other reviewers and force-push the final version into this PR.
Let's polish it afterward to speed up and unblock other tasks with strings/localizations.