forked from organicmaps/organicmaps
[android] Add capacity tag to Place Page
Signed-off-by: David Martinez <47610359+dvdmrtnz@users.noreply.github.com>
This commit is contained in:
parent
2e7f582f07
commit
afb9e427e9
5 changed files with 43 additions and 1 deletions
|
@ -59,7 +59,8 @@ public class Metadata implements Parcelable
|
|||
FMD_DESTINATION_REF(38),
|
||||
FMD_JUNCTION_REF(39),
|
||||
FMD_BUILDING_MIN_LEVEL(40),
|
||||
FMD_WIKIMEDIA_COMMONS(41);
|
||||
FMD_WIKIMEDIA_COMMONS(41),
|
||||
FMD_CAPACITY(42);
|
||||
private final int mMetaType;
|
||||
|
||||
MetadataType(int metadataType)
|
||||
|
|
|
@ -99,6 +99,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
|
|||
private TextView mTvLevel;
|
||||
private View mAtm;
|
||||
private TextView mTvAtm;
|
||||
private View mCapacity;
|
||||
private TextView mTvCapacity;
|
||||
private View mCuisine;
|
||||
private TextView mTvCuisine;
|
||||
private View mEntrance;
|
||||
|
@ -235,6 +237,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
|
|||
mTvLevel = mFrame.findViewById(R.id.tv__place_level);
|
||||
mAtm = mFrame.findViewById(R.id.ll__place_atm);
|
||||
mTvAtm = mFrame.findViewById(R.id.tv__place_atm);
|
||||
mCapacity = mFrame.findViewById(R.id.ll__place_capacity);
|
||||
mTvCapacity = mFrame.findViewById(R.id.tv__place_capacity);
|
||||
mCuisine = mFrame.findViewById(R.id.ll__place_cuisine);
|
||||
mTvCuisine = mFrame.findViewById(R.id.tv__place_cuisine);
|
||||
mEntrance = mFrame.findViewById(R.id.ll__place_entrance);
|
||||
|
@ -251,6 +255,7 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
|
|||
mOperator.setOnLongClickListener(this);
|
||||
mLevel.setOnLongClickListener(this);
|
||||
mAtm.setOnLongClickListener(this);
|
||||
mCapacity.setOnLongClickListener(this);
|
||||
|
||||
mDownloaderIcon = new DownloaderStatusIcon(mPreview.findViewById(R.id.downloader_status_frame));
|
||||
|
||||
|
@ -390,6 +395,7 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
|
|||
refreshWiFi();
|
||||
refreshMetadataOrHide(mMapObject.getMetadata(Metadata.MetadataType.FMD_FLATS), mEntrance, mTvEntrance);
|
||||
refreshMetadataOrHide(mMapObject.getMetadata(Metadata.MetadataType.FMD_LEVEL), mLevel, mTvLevel);
|
||||
refreshMetadataOrHide(mMapObject.getMetadata(Metadata.MetadataType.FMD_CAPACITY), mCapacity, mTvCapacity);
|
||||
refreshMetadataOrHide(mMapObject.hasAtm() ? getString(R.string.type_amenity_atm) : "", mAtm, mTvAtm);
|
||||
|
||||
// showTaxiOffer(mapObject);
|
||||
|
@ -559,6 +565,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
|
|||
items.add(mTvLevel.getText().toString());
|
||||
else if (id == R.id.ll__place_atm)
|
||||
items.add(mTvAtm.getText().toString());
|
||||
else if (id == R.id.ll__place_capacity)
|
||||
items.add(mTvCapacity.getText().toString());
|
||||
|
||||
final Context context = requireContext();
|
||||
if (items.size() == 1)
|
||||
|
|
11
android/app/src/main/res/drawable/ic_capacity_white.xml
Normal file
11
android/app/src/main/res/drawable/ic_capacity_white.xml
Normal file
|
@ -0,0 +1,11 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:viewportWidth="28"
|
||||
android:viewportHeight="28"
|
||||
android:width="28dp"
|
||||
android:height="28dp">
|
||||
<path
|
||||
android:pathData="M0.59959 7.7922a0.59986 0.60011 0 0 0-0.59959 0.59959v11.217a0.59986 0.60011 0 0 0 0.59959 0.59959h1.1699a0.59986 0.60011 0 0 0 0.59959-0.59959v-5.162l1.4824 5.3241a0.59986 0.60011 0 0 0 0.57811 0.43749h1.0957a0.59986 0.60011 0 0 0 0.57616-0.43554l1.5019-5.2655v5.1014a0.59986 0.60011 0 0 0 0.5996 0.59959h1.1699a0.59986 0.60011 0 0 0 0.47655-0.25585 0.59986 0.60011 0 0 0 0.4785 0.25585h1.2929a0.59986 0.60011 0 0 0 0.5742-0.42772l0.88279-2.9687h2.953l0.93748 2.9765a0.59986 0.60011 0 0 0 0.57225 0.41991h1.3925a0.59986 0.60011 0 0 0 0.02734-2e-3 0.59986 0.60011 0 0 0 0.01172 2e-3h1.4589a0.59986 0.60011 0 0 0 0.51561-0.29491l2.2402-3.789 2.1933 3.7851a0.59986 0.60011 0 0 0 0.51952 0.29882h1.5a0.59986 0.60011 0 0 0 0.51756-0.90427l-3.2987-5.619 3.0409-4.9803a0.59986 0.60011 0 0 0-0.5117-0.91209h-1.3164a0.59986 0.60011 0 0 0-0.50975 0.28124l-1.8574 2.9745c-0.07044 0.11201-0.13749 0.2228-0.20312 0.33202-0.07681-0.13777-0.14364-0.26029-0.23242-0.41405l-1.6757-2.8769a0.59986 0.60011 0 0 0-0.51757-0.29687h-1.4433a0.59986 0.60011 0 0 0-0.51756 0.90232l2.955 5.0624-2.7245 4.4784-3.3671-10.035a0.59986 0.60011 0 0 0-0.56834-0.40819h-1.3086a0.59986 0.60011 0 0 0-0.57225 0.41991l-3.3163 10.529v-10.349a0.59986 0.60011 0 0 0-0.59959-0.59959h-1.6367a0.59986 0.60011 0 0 0-0.57811 0.43749l-2.1054 7.4607-2.0488-7.4568a0.59986 0.60011 0 0 0-0.57616-0.4414zm13.937 4.1893c0.0096 0.031 0.01763 0.0585 0.02734 0.08985l0.71873 2.33h-1.4882z"
|
||||
android:fillType="evenOdd"
|
||||
android:fillColor="#FFFFFF"
|
||||
android:strokeLineJoin="round" />
|
||||
</vector>
|
20
android/app/src/main/res/layout/place_page_capacity.xml
Normal file
20
android/app/src/main/res/layout/place_page_capacity.xml
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/ll__place_capacity"
|
||||
style="@style/PlacePageItemFrame"
|
||||
android:tag="capacity"
|
||||
tools:background="#4000FFFF"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv__place_capacity"
|
||||
style="@style/PlacePageMetadataIcon"
|
||||
android:src="@drawable/ic_capacity_white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__place_capacity"
|
||||
style="@style/PlacePageMetadataText"
|
||||
tools:text="Capacity" />
|
||||
</LinearLayout>
|
|
@ -59,6 +59,8 @@
|
|||
|
||||
<include layout="@layout/place_page_atm" />
|
||||
|
||||
<include layout="@layout/place_page_capacity" />
|
||||
|
||||
<!-- ToDo: Address is missing compared with iOS. It's shown in title but anyway .. -->
|
||||
|
||||
<include layout="@layout/place_page_latlon"/>
|
||||
|
|
Loading…
Add table
Reference in a new issue