[android][placepage] Add network to place page

Signed-off-by: David Martinez <47610359+dvdmrtnz@users.noreply.github.com>
This commit is contained in:
David Martinez 2024-06-22 12:57:34 +02:00 committed by Viktor Havaka
parent dc29c0101d
commit 50e0650799
5 changed files with 45 additions and 1 deletions

View file

@ -66,7 +66,8 @@ public class Metadata implements Parcelable
FMD_DRIVE_THROUGH(45),
FMD_WEBSITE_MENU(46),
FMD_SELF_SERVICE(47),
FMD_OUTDOOR_SEATING(48);
FMD_OUTDOOR_SEATING(48),
FMD_NETWORK(49);
private final int mMetaType;
MetadataType(int metadataType)

View file

@ -96,6 +96,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
private TextView mTvWiFi;
private View mOperator;
private TextView mTvOperator;
private View mNetwork;
private TextView mTvNetwork;
private View mLevel;
private TextView mTvLevel;
private View mAtm;
@ -244,6 +246,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
mOperator = mFrame.findViewById(R.id.ll__place_operator);
mOperator.setOnClickListener(this);
mTvOperator = mFrame.findViewById(R.id.tv__place_operator);
mNetwork = mFrame.findViewById(R.id.ll__place_network);
mTvNetwork = mFrame.findViewById(R.id.tv__place_network);
mLevel = mFrame.findViewById(R.id.ll__place_level);
mTvLevel = mFrame.findViewById(R.id.tv__place_level);
mAtm = mFrame.findViewById(R.id.ll__place_atm);
@ -270,6 +274,7 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
latlon.setOnLongClickListener(this);
address.setOnLongClickListener(this);
mOperator.setOnLongClickListener(this);
mNetwork.setOnLongClickListener(this);
mLevel.setOnLongClickListener(this);
mAtm.setOnLongClickListener(this);
mCapacity.setOnLongClickListener(this);
@ -410,6 +415,10 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
refreshLatLon();
refreshMetadataOrHide(mMapObject.getMetadata(Metadata.MetadataType.FMD_OPERATOR), mOperator, mTvOperator);
final String network = mMapObject.getMetadata(Metadata.MetadataType.FMD_NETWORK);
refreshMetadataOrHide(!TextUtils.isEmpty(network) ? getString(R.string.network, network) : "", mNetwork, mTvNetwork);
/// @todo I don't like it when we take all data from mapObject, but for cuisines, we should
/// go into JNI Framework and rely on some "active object".
refreshMetadataOrHide(Framework.nativeGetActiveObjectFormattedCuisine(), mCuisine, mTvCuisine);
@ -609,6 +618,8 @@ public class PlacePageView extends Fragment implements View.OnClickListener,
}
else if (id == R.id.ll__place_operator)
items.add(mTvOperator.getText().toString());
else if (id == R.id.ll__place_network)
items.add(mTvNetwork.getText().toString());
else if (id == R.id.ll__place_level)
items.add(mTvLevel.getText().toString());
else if (id == R.id.ll__place_atm)

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="m22.548,9.299c1.691,-0.398 2.952,-1.917 2.952,-3.733 0,-2.118 -1.715,-3.833 -3.833,-3.833 -2.08,0 -3.771,1.653 -3.833,3.714l-8.807,3.527c-0.695,-0.685 -1.643,-1.107 -2.693,-1.107 -2.118,0 -3.833,1.715 -3.833,3.833 0,2.118 1.715,3.833 3.833,3.833 0.585,0 1.14,-0.129 1.634,-0.364l6.977,6.105c-0.115,0.364 -0.177,0.757 -0.177,1.16 0,2.118 1.715,3.833 3.833,3.833s3.833,-1.715 3.833,-3.833c0,-1.327 -0.671,-2.497 -1.696,-3.182zM9.989,12.86c0.105,-0.331 0.168,-0.68 0.177,-1.04l8.807,-3.522c0.172,0.168 0.355,0.321 0.556,0.455l-1.811,9.948c-0.264,0.062 -0.517,0.149 -0.757,0.264z"
android:fillColor="#fff"/>
</vector>

View file

@ -47,6 +47,8 @@
<include layout="@layout/place_page_operator"/>
<include layout="@layout/place_page_network"/>
<include layout="@layout/place_page_wifi"/>
<include layout="@layout/place_page_outdoor_seating"/>

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_network"
style="@style/PlacePageItemFrame"
android:tag="network"
tools:background="#4000FFFF"
tools:visibility="visible">
<ImageView
android:id="@+id/iv__place_network"
style="@style/PlacePageMetadataIcon"
app:srcCompat="@drawable/ic_network_white" />
<TextView
android:id="@+id/tv__place_network"
style="@style/PlacePageMetadataText"
tools:text="Network" />
</LinearLayout>