[android] Add wheelchair info to place page

Signed-off-by: David Martinez <47610359+dvdmrtnz@users.noreply.github.com>
This commit is contained in:
David Martinez 2024-02-04 21:43:03 +01:00 committed by Viktor Govako
parent 12aab83cce
commit 13b1040222
5 changed files with 45 additions and 1 deletions

View file

@ -60,7 +60,8 @@ public class Metadata implements Parcelable
FMD_JUNCTION_REF(39),
FMD_BUILDING_MIN_LEVEL(40),
FMD_WIKIMEDIA_COMMONS(41),
FMD_CAPACITY(42);
FMD_CAPACITY(42),
FMD_WHEELCHAIR(43);
private final int mMetaType;
MetadataType(int metadataType)

View file

@ -42,6 +42,7 @@ import app.organicmaps.routing.RoutingController;
import app.organicmaps.util.SharingUtils;
import app.organicmaps.util.StringUtils;
import app.organicmaps.util.UiUtils;
import app.organicmaps.util.Utils;
import app.organicmaps.util.concurrency.UiThread;
import app.organicmaps.widget.ArrowView;
import app.organicmaps.widget.placepage.sections.PlacePageBookmarkFragment;
@ -101,6 +102,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
private TextView mTvAtm;
private View mCapacity;
private TextView mTvCapacity;
private View mWheelchair;
private TextView mTvWheelchair;
private View mCuisine;
private TextView mTvCuisine;
private View mEntrance;
@ -239,6 +242,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
mTvAtm = mFrame.findViewById(R.id.tv__place_atm);
mCapacity = mFrame.findViewById(R.id.ll__place_capacity);
mTvCapacity = mFrame.findViewById(R.id.tv__place_capacity);
mWheelchair = mFrame.findViewById(R.id.ll__place_wheelchair);
mTvWheelchair = mFrame.findViewById(R.id.tv__place_wheelchair);
mCuisine = mFrame.findViewById(R.id.ll__place_cuisine);
mTvCuisine = mFrame.findViewById(R.id.tv__place_cuisine);
mEntrance = mFrame.findViewById(R.id.ll__place_entrance);
@ -256,6 +261,7 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
mLevel.setOnLongClickListener(this);
mAtm.setOnLongClickListener(this);
mCapacity.setOnLongClickListener(this);
mWheelchair.setOnLongClickListener(this);
mDownloaderIcon = new DownloaderStatusIcon(mPreview.findViewById(R.id.downloader_status_frame));
@ -401,6 +407,9 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
refreshMetadataOrHide(mMapObject.hasAtm() ? getString(R.string.type_amenity_atm) : "", mAtm, mTvAtm);
final String wheelchair = Utils.getLocalizedFeatureType(getContext(), mMapObject.getMetadata(Metadata.MetadataType.FMD_WHEELCHAIR));
refreshMetadataOrHide(wheelchair, mWheelchair, mTvWheelchair);
// showTaxiOffer(mapObject);
if (RoutingController.get().isNavigating() || RoutingController.get().isPlanning())
@ -566,6 +575,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
items.add(mTvAtm.getText().toString());
else if (id == R.id.ll__place_capacity)
items.add(mTvCapacity.getText().toString());
else if (id == R.id.ll__place_wheelchair)
items.add(mTvWheelchair.getText().toString());
final Context context = requireContext();
if (items.size() == 1)

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="28dp"
android:height="28dp"
android:viewportWidth="28"
android:viewportHeight="28">
<path
android:pathData="m20.327,2c-1.318,0 -2.388,1.067 -2.388,2.385 0,1.318 1.07,2.388 2.388,2.388 1.318,0 2.388,-1.07 2.388,-2.388 0,-1.318 -1.07,-2.385 -2.388,-2.385zM12.168,3.156c-0.367,-0.019 -0.739,0.101 -1.027,0.357l-3.19,2.846c-0.588,0.524 -0.64,1.426 -0.115,2.014 0.524,0.588 1.426,0.64 2.014,0.115l2.419,-2.157 1.997,1.162 -3.527,4.016c-1.463,0.239 -2.78,0.915 -3.814,1.887l1.842,1.842c0.833,-0.757 1.941,-1.221 3.153,-1.221 2.585,0 4.686,2.103 4.686,4.689 0,1.212 -0.46,2.32 -1.218,3.153l1.842,1.842c1.228,-1.305 1.98,-3.062 1.98,-4.995 0,-1.152 -0.267,-2.241 -0.743,-3.209l1.924,-0.107 -0.467,5.743c-0.064,0.785 0.52,1.472 1.305,1.536 0.039,0.003 0.079,0.006 0.118,0.006 0.735,0 1.36,-0.565 1.42,-1.311l0.599,-7.372c0.034,-0.411 -0.112,-0.816 -0.399,-1.111 -0.288,-0.295 -0.689,-0.453 -1.1,-0.43l-4.973,0.278 2.737,-3.116c0.39,-0.444 0.502,-1.035 0.352,-1.564 -0.08,-0.362 -0.301,-0.692 -0.638,-0.903 -0.01,-0.007 -6.539,-3.803 -6.539,-3.803 -0.2,-0.116 -0.418,-0.177 -0.638,-0.188zM6.177,14.215c-0.971,1.239 -1.55,2.796 -1.55,4.492 0,4.028 3.265,7.293 7.293,7.293 1.696,0 3.253,-0.579 4.492,-1.55l-1.862,-1.865c-0.751,0.511 -1.656,0.81 -2.63,0.81 -2.585,0 -4.689,-2.103 -4.689,-4.689 0,-0.974 0.297,-1.879 0.807,-2.63l-1.862,-1.862z"
android:fillColor="#fff"/>
</vector>

View file

@ -61,6 +61,8 @@
<include layout="@layout/place_page_capacity" />
<include layout="@layout/place_page_wheelchair" />
<!-- ToDo: Address is missing compared with iOS. It's shown in title but anyway .. -->
<include layout="@layout/place_page_latlon"/>

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ll__place_wheelchair"
style="@style/PlacePageItemFrame"
android:tag="wheelchair"
tools:background="#4000FFFF"
tools:visibility="visible">
<ImageView
android:id="@+id/iv__place_wheelchair"
style="@style/PlacePageMetadataIcon"
app:srcCompat="@drawable/ic_wheelchair_white" />
<TextView
android:id="@+id/tv__place_wheelchair"
style="@style/PlacePageMetadataText"
tools:text="Wheelchair" />
</LinearLayout>