[android] basic collection_times on placepage

Signed-off-by: Harry Bond <me@hbond.xyz>
This commit is contained in:
Harry Bond 2024-06-30 23:58:38 +01:00
parent 78d881a67d
commit 2d43548f2f
5 changed files with 48 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_COLLECTION_TIMES(47);
private final int mMetaType;
MetadataType(int metadataType)

View file

@ -114,6 +114,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
private View mAddOrganisation;
private View mAddPlace;
private View mEditTopSpace;
private View mCollectionTimes;
private TextView mTvCollectionTimes;
// Data
private CoordinatesFormat mCoordsFormat = CoordinatesFormat.LatLonDecimal;
@ -267,6 +269,9 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
mCapacity.setOnLongClickListener(this);
mWheelchair.setOnLongClickListener(this);
mDriveThrough.setOnLongClickListener(this);
mCollectionTimes = mFrame.findViewById(R.id.ll__place_collection_times);
mTvCollectionTimes = mFrame.findViewById(R.id.tv__place_collection_times);
mCollectionTimes.setOnLongClickListener(this);
mDownloaderIcon = new DownloaderStatusIcon(mPreview.findViewById(R.id.downloader_status_frame));
@ -408,6 +413,9 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
final String level = Utils.getLocalizedLevel(getContext(), mMapObject.getMetadata(Metadata.MetadataType.FMD_LEVEL));
refreshMetadataOrHide(level, mLevel, mTvLevel);
final String collectionTimes = mMapObject.getMetadata(Metadata.MetadataType.FMD_COLLECTION_TIMES);
refreshMetadataOrHide(collectionTimes, mCollectionTimes, mTvCollectionTimes);
final String cap = mMapObject.getMetadata(Metadata.MetadataType.FMD_CAPACITY);
refreshMetadataOrHide(!TextUtils.isEmpty(cap) ? getString(R.string.capacity, cap) : "", mCapacity, mTvCapacity);

View file

@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="m7.547,7.609 l-3.547,1.773 0.447,0.223 7.553,3.66 7.553,-3.66 0.447,-0.223 -3.547,-1.773c-0.443,0.252 -0.943,0.386 -1.453,0.391 0,1.657 -1.343,3 -3,3s-3,-1.343 -3,-3c-0.51,-0.005 -1.01,-0.139 -1.453,-0.391zM3,11.117v7.383c-0,0.379 0.214,0.725 0.553,0.895l7.447,3.605v-8l-7.447,-3.605zM21,11.117 L20.447,11.395 13,15v8l7.447,-3.605c0.339,-0.169 0.553,-0.516 0.553,-0.895z"/>
<path
android:pathData="m12,2 l-3,3m3,-3 l3,3m-3,3v-6"
android:strokeWidth="1.8"
android:strokeColor="@android:color/white"
android:strokeLineCap="round"/>
</vector>

View file

@ -0,0 +1,22 @@
<?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_collection_times"
style="@style/PlacePageItemFrame"
android:tag="collection_times"
tools:background="#4000FFFF"
tools:visibility="visible">
<ImageView
android:id="@+id/iv__place_collection_times"
style="@style/PlacePageMetadataIcon"
app:srcCompat="@drawable/ic_collection_icon" />
<TextView
android:id="@+id/tv__place_collection_times"
style="@style/PlacePageMetadataText"
tools:text="Mo-Fr 9:00; Sa 11:00" />
</LinearLayout>

View file

@ -35,6 +35,8 @@
android:layout_height="wrap_content"
tools:layout="@layout/place_page_opening_hours_fragment" />
<include layout="@layout/place_page_collection_times" />
<include layout="@layout/place_page_cuisine"/>
<include layout="@layout/place_page_entrance"/>