From c555e52eacf10b8888ad51c9f42962dbc15e12d6 Mon Sep 17 00:00:00 2001 From: "S. Kozyr" Date: Mon, 25 Oct 2021 11:11:35 +0300 Subject: [PATCH] Copy menu for social networks now includes username if possible. Signed-off-by: S. Kozyr --- .../maps/widget/placepage/PlacePageView.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java index c74e66b30e..fabe730fad 100644 --- a/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java +++ b/android/src/com/mapswithme/maps/widget/placepage/PlacePageView.java @@ -1349,18 +1349,26 @@ public class PlacePageView extends NestedScrollViewClickFixed break; case R.id.ll__place_facebook: final String facebookPage = mMapObject.getMetadata(Metadata.MetadataType.FMD_CONTACT_FACEBOOK); + if (facebookPage.indexOf('/') == -1) + items.add(facebookPage); // Show username along with URL items.add("https://m.facebook.com/" + facebookPage); break; case R.id.ll__place_instagram: final String instagramPage = mMapObject.getMetadata(Metadata.MetadataType.FMD_CONTACT_INSTAGRAM); + if (instagramPage.indexOf('/') == -1) + items.add(instagramPage); // Show username along with URL items.add("https://instagram.com/" + instagramPage); break; case R.id.ll__place_twitter: final String twitterPage = mMapObject.getMetadata(Metadata.MetadataType.FMD_CONTACT_TWITTER); + if (twitterPage.indexOf('/') == -1) + items.add(twitterPage); // Show username along with URL items.add("https://mobile.twitter.com/" + twitterPage); break; case R.id.ll__place_vk: final String vkPage = mMapObject.getMetadata(Metadata.MetadataType.FMD_CONTACT_VK); + if (vkPage.indexOf('/') == -1) + items.add(vkPage); // Show username along with URL items.add("https://vk.com/" + vkPage); break; case R.id.ll__place_line: @@ -1368,7 +1376,10 @@ public class PlacePageView extends NestedScrollViewClickFixed if (linePage.indexOf('/') >= 0) items.add("https://" + linePage); else + { + items.add(linePage); // Show username along with URL items.add("https://line.me/R/ti/p/@" + linePage); + } break; case R.id.ll__place_email: items.add(mTvEmail.getText().toString());