[android] Add layout for self_service key

Signed-off-by: Arthur-GYT <a.gayot@posteo.com>
This commit is contained in:
Arthur-GYT 2024-06-24 21:45:30 +02:00 committed by Viktor Havaka
parent 4e380c7687
commit 58b74432ce
6 changed files with 55 additions and 1 deletions

View file

@ -64,7 +64,8 @@ public class Metadata implements Parcelable
FMD_WHEELCHAIR(43),
FMD_LOCAL_REF(44),
FMD_DRIVE_THROUGH(45),
FMD_WEBSITE_MENU(46);
FMD_WEBSITE_MENU(46),
FMD_SELF_SERVICE(47);
private final int mMetaType;
MetadataType(int metadataType)

View file

@ -629,6 +629,17 @@ public class Utils
return getStringValueByKey(context, key);
}
@Keep
@SuppressWarnings("unused")
@NonNull
public static String getTagValueLocalized(@NonNull Context context, @Nullable String tagKey, @Nullable String value)
{
if (TextUtils.isEmpty(tagKey) || TextUtils.isEmpty(value))
return "";
return getLocalizedFeatureType(context, tagKey + "-" + value);
}
// Called from JNI.
@Keep
@SuppressWarnings("unused")

View file

@ -106,6 +106,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
private TextView mTvWheelchair;
private View mDriveThrough;
private TextView mTvDriveThrough;
private View mSelfService;
private TextView mTvSelfService;
private View mCuisine;
private TextView mTvCuisine;
private View mEntrance;
@ -248,6 +250,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
mTvWheelchair = mFrame.findViewById(R.id.tv__place_wheelchair);
mDriveThrough = mFrame.findViewById(R.id.ll__place_drive_through);
mTvDriveThrough = mFrame.findViewById(R.id.tv__place_drive_through);
mSelfService = mFrame.findViewById(R.id.ll__place_self_service);
mTvSelfService = mFrame.findViewById(R.id.tv__place_self_service);
mCuisine = mFrame.findViewById(R.id.ll__place_cuisine);
mTvCuisine = mFrame.findViewById(R.id.tv__place_cuisine);
mEntrance = mFrame.findViewById(R.id.ll__place_entrance);
@ -267,6 +271,7 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
mCapacity.setOnLongClickListener(this);
mWheelchair.setOnLongClickListener(this);
mDriveThrough.setOnLongClickListener(this);
mSelfService.setOnLongClickListener(this);
mDownloaderIcon = new DownloaderStatusIcon(mPreview.findViewById(R.id.downloader_status_frame));
@ -422,6 +427,9 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
refreshMetadataOrHide(getString(R.string.drive_through), mDriveThrough, mTvDriveThrough);
}
final String selfService = mMapObject.getMetadata(Metadata.MetadataType.FMD_SELF_SERVICE);
refreshMetadataOrHide(Utils.getTagValueLocalized(getContext(), "self_service", selfService), mSelfService, mTvSelfService);
// showTaxiOffer(mapObject);
if (RoutingController.get().isNavigating() || RoutingController.get().isPlanning())

View file

@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3,3.414C2.744,3.414 2.489,3.511 2.293,3.707C1.901,4.099 1.901,4.729 2.293,5.121L6.859,9.688C6.595,9.897 6.346,10.121 6.117,10.363C4.727,11.834 4,13.844 4,16C4,16.552 4.448,17 5,17L14.172,17L15.172,18L4,18C3.446,18 3,18.446 3,19C3,19.554 3.446,20 4,20L17.172,20L18.879,21.707C19.271,22.099 19.901,22.099 20.293,21.707C20.685,21.315 20.685,20.685 20.293,20.293L20,20L18,18L17,17L8.641,8.641L3.707,3.707C3.511,3.511 3.256,3.414 3,3.414zM11,5C10.446,5 10,5.446 10,6C10,6.554 10.446,7 11,7L11,8C11,8.018 11.003,8.035 11.004,8.053C10.967,8.057 10.931,8.062 10.895,8.066L19.613,16.785C19.847,16.602 20,16.32 20,16C20,13.844 19.273,11.834 17.883,10.363C16.686,9.097 15.002,8.261 12.996,8.053C12.997,8.035 13,8.018 13,8L13,7C13.554,7 14,6.554 14,6C14,5.446 13.554,5 13,5L12,5L11,5z"
android:strokeLineJoin="round"
android:fillColor="#FFF"
android:strokeLineCap="round"/>
</vector>

View file

@ -65,6 +65,8 @@
<include layout="@layout/place_page_drive_through" />
<include layout="@layout/place_page_self_service" />
<!-- 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_self_service"
style="@style/PlacePageItemFrame"
android:tag="drive_through"
tools:background="#4000FFFF"
tools:visibility="visible">
<ImageView
android:id="@+id/iv__place_self_service"
style="@style/PlacePageMetadataIcon"
app:srcCompat="@drawable/ic_self_service" />
<TextView
android:id="@+id/tv__place_self_service"
style="@style/PlacePageMetadataText"
tools:text="Self-service" />
</LinearLayout>