[Android] Multiple place phones #845

Merged
root merged 12 commits from multiple-place-phones into master 2021-07-24 22:27:49 +00:00
Member

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/1693972693
But 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:

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/1693972693 But Organicmaps supports only single phone number field. This PR adds support of multiple phone numbers for a place. ## Place details **Before:** <img src="https://user-images.githubusercontent.com/720808/125298832-31013f00-e331-11eb-89f9-8c80eaf51899.png" width="250"/> **After:** <img src="https://user-images.githubusercontent.com/720808/125298857-38284d00-e331-11eb-9fd4-a71999872f15.png" width="250"/> 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 <img src="https://user-images.githubusercontent.com/720808/125299111-7de51580-e331-11eb-8bfa-e3c1b885b22e.png" width="250"/> ## 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:** <img src="https://user-images.githubusercontent.com/720808/126669452-06284327-9219-4de6-a5fb-127d1b49f363.png" width="500"/> **RTL Layout:** <img src="https://user-images.githubusercontent.com/720808/126669527-f79a0c07-ab46-4547-a7cb-81f234ad7d62.png" width="500"/>
Endem10n (Migrated from github.com) requested changes 2021-07-12 15:51:36 +00:00
Endem10n (Migrated from github.com) commented 2021-07-12 15:25:48 +00:00

Redundant "android:layout_toLeftOf". Min api level is 21.

Redundant "android:layout_toLeftOf". Min api level is 21.
Endem10n (Migrated from github.com) commented 2021-07-12 15:26:07 +00:00

Redundant "android:layout_toLeftOf". Min api level is 21.

Redundant "android:layout_toLeftOf". Min api level is 21.
Endem10n (Migrated from github.com) commented 2021-07-12 15:27:45 +00:00

Redundant tags "android:paddingLeft" and "android:paddingRight". Min api level is 21.

Redundant tags "android:paddingLeft" and "android:paddingRight". Min api level is 21.
Endem10n (Migrated from github.com) commented 2021-07-12 15:34:40 +00:00

Should change three lines to support RTL. Could you, please, check in other places.

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"/>
Endem10n (Migrated from github.com) commented 2021-07-12 15:32:38 +00:00

Should use "android:layout_alignParentStart"

Should use "android:layout_alignParentStart"
Endem10n (Migrated from github.com) commented 2021-07-12 15:50:26 +00:00

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.

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.
Endem10n (Migrated from github.com) commented 2021-07-12 15:37:53 +00:00

Opening brace should be at the beginning of the next line according to project code style. Could you, please, check in other places.

Opening brace should be at the beginning of the next line according to project code style. Could you, please, check in other places.
Endem10n (Migrated from github.com) commented 2021-07-12 15:38:57 +00:00

In case of single line "if" should not use braces according to project code style.

In case of single line "if" should not use braces according to project code style.
Endem10n (Migrated from github.com) commented 2021-07-12 15:42:18 +00:00

Should not comment, but just delete.

Should not comment, but just delete.
Endem10n (Migrated from github.com) commented 2021-07-12 15:30:41 +00:00

Possibly, should not comment, but just delete. It will stay in git history. Could you, please, check in other places.

Possibly, should not comment, but just delete. It will stay in git history. Could you, please, check in other places.
strump reviewed 2021-07-13 13:44:45 +00:00
Author
Member

@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?

@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?
Endem10n (Migrated from github.com) reviewed 2021-07-14 12:28:25 +00:00
Endem10n (Migrated from github.com) commented 2021-07-14 12:28:25 +00:00

@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.

@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.
Author
Member

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.

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.
biodranik (Migrated from github.com) reviewed 2021-07-20 06:24:11 +00:00
@ -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>
biodranik (Migrated from github.com) commented 2021-07-20 06:24:11 +00:00

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.

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.
biodranik (Migrated from github.com) reviewed 2021-07-20 06:37:23 +00:00
biodranik (Migrated from github.com) left a comment
  1. Did you test it for RTL languages?
  2. Did you test dark and light themes?
  3. Did you test it in a large tablet layout?
1. Did you test it for RTL languages? 2. Did you test dark and light themes? 3. Did you test it in a large tablet layout?
biodranik (Migrated from github.com) commented 2021-07-20 06:26:46 +00:00

Why is it commented?

Why is it commented?
biodranik (Migrated from github.com) commented 2021-07-20 06:27:23 +00:00

Why is it removed? Are phones properly stored and sent to OSM?

Why is it removed? Are phones properly stored and sent to OSM?
biodranik (Migrated from github.com) commented 2021-07-20 06:31:43 +00:00

We format simple ifs in two lines for easier debugging.

We format simple ifs in two lines for easier debugging.
biodranik (Migrated from github.com) commented 2021-07-20 06:32:47 +00:00

How to properly define icons from XML, so they will work in both light and dark themes?

How to properly define icons from XML, so they will work in both light and dark themes?
biodranik (Migrated from github.com) commented 2021-07-20 06:34:20 +00:00

nit: we insert spaces after slashes.

nit: we insert spaces after slashes.
biodranik (Migrated from github.com) commented 2021-07-20 06:33:50 +00:00

Missed space after // and the dot at the end.

Missed space after // and the dot at the end.
biodranik (Migrated from github.com) commented 2021-07-20 06:36:19 +00:00

We try not to pollute logs with debug strings (esp. warning ones).

We try not to pollute logs with debug strings (esp. warning ones).
strump reviewed 2021-07-20 07:43:35 +00:00
@ -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>
Author
Member

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

Viacheslav Greshilov removed "phone_number" string in commit [#cca70039](https://git.omaps.dev/organicmaps/organicmaps/commit/cca7003972cd540c6f1c7649250eb08fe5abc775) and regenerated strings.xml in commit [#2b46f73d](https://git.omaps.dev/organicmaps/organicmaps/commit/2b46f73d3a8b65cfafe9383eb77bdf97a233f7a9) I restored "phone_number" in strings.xml, but looks like I need to revert data/strings/strings.txt first
strump reviewed 2021-07-20 07:48:02 +00:00
Author
Member

I moved Editor.nativeSetPhone(phone); call to EditorHostFragment class simmilar to cuisine, opening house, street editors. Becase I created PhoneFragment to edit multiple phones, this fragment has "Save" button

I moved `Editor.nativeSetPhone(phone);` call to `EditorHostFragment` class simmilar to cuisine, opening house, street editors. Becase I created `PhoneFragment` to edit multiple phones, this fragment has "Save" button
strump reviewed 2021-07-20 07:51:04 +00:00
Author
Member

I forgot to remove those logs. It's no use to log this text any more

I forgot to remove those logs. It's no use to log this text any more
biodranik (Migrated from github.com) reviewed 2021-07-20 21:59:32 +00:00
@ -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>
biodranik (Migrated from github.com) commented 2021-07-20 21:59:32 +00:00

Wow, this string was unused, interesting. Thanks!

Wow, this string was unused, interesting. Thanks!
vng (Migrated from github.com) approved these changes 2021-07-22 03:42:13 +00:00
vng commented 2021-07-22 03:47:45 +00:00 (Migrated from github.com)

@Endem10n @biodranik Гляньте фиксы, я думаю пора мержить уже.

@Endem10n @biodranik Гляньте фиксы, я думаю пора мержить уже.
biodranik (Migrated from github.com) reviewed 2021-07-22 05:42:38 +00:00
biodranik (Migrated from github.com) commented 2021-07-22 05:42:38 +00:00

@ma4ko What is the Bulgarian translation?

@ma4ko What is the Bulgarian translation?
biodranik (Migrated from github.com) approved these changes 2021-07-22 05:43:31 +00:00
Endem10n (Migrated from github.com) approved these changes 2021-07-22 07:14:31 +00:00
biodranik commented 2021-07-23 07:36:45 +00:00 (Migrated from github.com)

Uups, sorry, looks like conflicts should be resolved. We usually remove all commits with regenerated strings, rebase, and then generate strings again.

Uups, sorry, looks like conflicts should be resolved. We usually remove all commits with regenerated strings, rebase, and then generate strings again.
rtsisyk approved these changes 2021-07-24 14:49:29 +00:00
rtsisyk left a comment
Owner

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.

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.
Owner

@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.

@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.
biodranik commented 2021-07-24 22:27:04 +00:00 (Migrated from github.com)

Let's polish it afterward to speed up and unblock other tasks with strings/localizations.

Let's polish it afterward to speed up and unblock other tasks with strings/localizations.
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
3 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#845
No description provided.