From 8378a02cf3a307b382904c55698941fcd5774bf8 Mon Sep 17 00:00:00 2001 From: Arthur-GYT Date: Sun, 7 Jul 2024 18:48:05 +0200 Subject: [PATCH] [android] Add ui for `outdoor_seating` key Signed-off-by: Arthur-GYT --- .../organicmaps/bookmarks/data/Metadata.java | 3 ++- .../widget/placepage/PlacePageView.java | 13 ++++++++++++ .../main/res/drawable/ic_outdoor_seating.xml | 9 +++++++++ .../main/res/layout/place_page_details.xml | 1 + .../res/layout/place_page_outdoor_seating.xml | 20 +++++++++++++++++++ 5 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 android/app/src/main/res/drawable/ic_outdoor_seating.xml create mode 100644 android/app/src/main/res/layout/place_page_outdoor_seating.xml diff --git a/android/app/src/main/java/app/organicmaps/bookmarks/data/Metadata.java b/android/app/src/main/java/app/organicmaps/bookmarks/data/Metadata.java index e1a612f5d7..dc6a572783 100644 --- a/android/app/src/main/java/app/organicmaps/bookmarks/data/Metadata.java +++ b/android/app/src/main/java/app/organicmaps/bookmarks/data/Metadata.java @@ -65,7 +65,8 @@ public class Metadata implements Parcelable FMD_LOCAL_REF(44), FMD_DRIVE_THROUGH(45), FMD_WEBSITE_MENU(46), - FMD_SELF_SERVICE(47); + FMD_SELF_SERVICE(47), + FMD_OUTDOOR_SEATING(48); private final int mMetaType; MetadataType(int metadataType) diff --git a/android/app/src/main/java/app/organicmaps/widget/placepage/PlacePageView.java b/android/app/src/main/java/app/organicmaps/widget/placepage/PlacePageView.java index 13089df2c0..c4a5dcec67 100644 --- a/android/app/src/main/java/app/organicmaps/widget/placepage/PlacePageView.java +++ b/android/app/src/main/java/app/organicmaps/widget/placepage/PlacePageView.java @@ -110,6 +110,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener, private TextView mTvSelfService; private View mCuisine; private TextView mTvCuisine; + private View mOutdoorSeating; + private TextView mTvOutdoorSeating; private View mEntrance; private TextView mTvEntrance; private View mEditPlace; @@ -237,6 +239,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener, mTvLatlon = mFrame.findViewById(R.id.tv__place_latlon); mWifi = mFrame.findViewById(R.id.ll__place_wifi); mTvWiFi = mFrame.findViewById(R.id.tv__place_wifi); + mOutdoorSeating = mFrame.findViewById(R.id.ll__place_outdoor_seating); + mTvOutdoorSeating = mFrame.findViewById(R.id.tv__place_outdoor_seating); mOperator = mFrame.findViewById(R.id.ll__place_operator); mOperator.setOnClickListener(this); mTvOperator = mFrame.findViewById(R.id.tv__place_operator); @@ -272,6 +276,7 @@ public class PlacePageView extends Fragment implements View.OnClickListener, mWheelchair.setOnLongClickListener(this); mDriveThrough.setOnLongClickListener(this); mSelfService.setOnLongClickListener(this); + mOutdoorSeating.setOnLongClickListener(this); mDownloaderIcon = new DownloaderStatusIcon(mPreview.findViewById(R.id.downloader_status_frame)); @@ -430,6 +435,12 @@ public class PlacePageView extends Fragment implements View.OnClickListener, final String selfService = mMapObject.getMetadata(Metadata.MetadataType.FMD_SELF_SERVICE); refreshMetadataOrHide(Utils.getTagValueLocalized(getContext(), "self_service", selfService), mSelfService, mTvSelfService); + final String outdoorSeating = mMapObject.getMetadata(Metadata.MetadataType.FMD_OUTDOOR_SEATING); + if (outdoorSeating.equals("yes")) + { + refreshMetadataOrHide(getString(R.string.outdoor_seating), mOutdoorSeating, mTvOutdoorSeating); + } + // showTaxiOffer(mapObject); if (RoutingController.get().isNavigating() || RoutingController.get().isPlanning()) @@ -599,6 +610,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener, items.add(mTvWheelchair.getText().toString()); else if (id == R.id.ll__place_drive_through) items.add(mTvDriveThrough.getText().toString()); + else if (id == R.id.ll__place_outdoor_seating) + items.add(mTvOutdoorSeating.getText().toString()); final Context context = requireContext(); if (items.size() == 1) diff --git a/android/app/src/main/res/drawable/ic_outdoor_seating.xml b/android/app/src/main/res/drawable/ic_outdoor_seating.xml new file mode 100644 index 0000000000..2f41df3d10 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_outdoor_seating.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/android/app/src/main/res/layout/place_page_details.xml b/android/app/src/main/res/layout/place_page_details.xml index 8534820c9b..5b72eb8db5 100644 --- a/android/app/src/main/res/layout/place_page_details.xml +++ b/android/app/src/main/res/layout/place_page_details.xml @@ -48,6 +48,7 @@ + + + + + + + \ No newline at end of file