mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-02 11:03:44 +00:00
[android] Add Panoramax link on the place page
Signed-off-by: Jean-Baptiste Charron <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
committed by
Konstantin Pastbin
parent
6a10cffe51
commit
25e49b0fe1
@@ -69,7 +69,8 @@ public class Metadata implements Parcelable
|
||||
FMD_OUTDOOR_SEATING(48),
|
||||
FMD_NETWORK(49),
|
||||
FMD_CONTACT_FEDIVERSE(50),
|
||||
FMD_CONTACT_BLUESKY(51);
|
||||
FMD_CONTACT_BLUESKY(51),
|
||||
FMD_PANORAMAX(52);
|
||||
private final int mMetaType;
|
||||
|
||||
MetadataType(int metadataType)
|
||||
|
||||
@@ -56,6 +56,9 @@ public class PlacePageLinksFragment extends Fragment implements Observer<MapObje
|
||||
private View mWikimedia;
|
||||
private TextView mTvWikimedia;
|
||||
|
||||
private View mPanoramax;
|
||||
private TextView mTvPanoramax;
|
||||
|
||||
private PlacePageViewModel mViewModel;
|
||||
private MapObject mMapObject;
|
||||
|
||||
@@ -163,6 +166,11 @@ public class PlacePageLinksFragment extends Fragment implements Observer<MapObje
|
||||
mTvLinePage = mFrame.findViewById(R.id.tv__place_line_page);
|
||||
mLinePage.setOnClickListener((v) -> openUrl(Metadata.MetadataType.FMD_CONTACT_LINE));
|
||||
mLinePage.setOnLongClickListener((v) -> copyUrl(mLinePage, Metadata.MetadataType.FMD_CONTACT_LINE));
|
||||
|
||||
mPanoramax = mFrame.findViewById(R.id.ll__place_panoramax);
|
||||
mTvPanoramax = mFrame.findViewById(R.id.tv__place_panoramax);
|
||||
mPanoramax.setOnClickListener((v) -> openUrl(Metadata.MetadataType.FMD_PANORAMAX));
|
||||
mTvPanoramax.setOnLongClickListener((v) -> copyUrl(mPanoramax, Metadata.MetadataType.FMD_PANORAMAX));
|
||||
}
|
||||
|
||||
private void openUrl(Metadata.MetadataType type)
|
||||
@@ -226,6 +234,9 @@ public class PlacePageLinksFragment extends Fragment implements Observer<MapObje
|
||||
|
||||
final String line = mMapObject.getMetadata(Metadata.MetadataType.FMD_CONTACT_LINE);
|
||||
refreshMetadataOrHide(line, mLinePage, mTvLinePage);
|
||||
|
||||
final String panoramax = mMapObject.getMetadata(Metadata.MetadataType.FMD_PANORAMAX);
|
||||
refreshMetadataOrHide(panoramax, mPanoramax, mTvPanoramax);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
15
android/app/src/main/res/drawable/ic_panoramax.xml
Normal file
15
android/app/src/main/res/drawable/ic_panoramax.xml
Normal file
File diff suppressed because one or more lines are too long
@@ -21,4 +21,5 @@
|
||||
<include layout="@layout/place_page_line" />
|
||||
<include layout="@layout/place_page_bluesky" />
|
||||
<include layout="@layout/place_page_wikimedia" />
|
||||
<include layout="@layout/place_page_panoramax" />
|
||||
</LinearLayout>
|
||||
25
android/app/src/main/res/layout/place_page_panoramax.xml
Normal file
25
android/app/src/main/res/layout/place_page_panoramax.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/ll__place_panoramax"
|
||||
style="@style/PlacePageItemFrame"
|
||||
android:tag="website"
|
||||
tools:background="#20FF0000"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv__place_panoramax"
|
||||
style="@style/PlacePageMetadataIcon"
|
||||
app:srcCompat="@drawable/ic_panoramax"
|
||||
app:tint="?colorAccent"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv__place_panoramax"
|
||||
android:textAlignment="viewStart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/MwmTextAppearance.PlacePage.Accent"
|
||||
tools:text="@string/panoramax"/>
|
||||
</LinearLayout>
|
||||
@@ -291,6 +291,8 @@
|
||||
<string name="vk">VK</string>
|
||||
<!-- Text in menu -->
|
||||
<string name="bluesky">Bluesky</string>
|
||||
<!-- Text on the place page -->
|
||||
<string name="panoramax">Panoramax Picture</string>
|
||||
<!-- Text in the editor -->
|
||||
<string name="editor_line_social_network">LINE</string>
|
||||
<!-- Text in menu -->
|
||||
|
||||
Reference in New Issue
Block a user