mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-15 16:44:21 +00:00
initial attempt at panoramax layer
Signed-off-by: zyphlar <zyphlar@gmail.com>
This commit is contained in:
@@ -74,6 +74,11 @@ public class PlacePageButtonFactory
|
||||
titleId = R.string.avoid_ferry;
|
||||
yield R.drawable.ic_avoid_ferry;
|
||||
}
|
||||
case PANORAMAX ->
|
||||
{
|
||||
titleId = R.string.panoramax;
|
||||
yield R.drawable.ic_camera;
|
||||
}
|
||||
case MORE ->
|
||||
{
|
||||
titleId = R.string.placepage_more_button;
|
||||
|
||||
@@ -144,6 +144,7 @@ public final class PlacePageButtons extends Fragment implements Observer<List<Pl
|
||||
ROUTE_AVOID_TOLL,
|
||||
ROUTE_AVOID_FERRY,
|
||||
ROUTE_AVOID_UNPAVED,
|
||||
PANORAMAX,
|
||||
MORE
|
||||
}
|
||||
|
||||
|
||||
@@ -428,6 +428,7 @@ public class PlacePageController
|
||||
case ROUTE_AVOID_TOLL -> onAvoidTollBtnClicked();
|
||||
case ROUTE_AVOID_UNPAVED -> onAvoidUnpavedBtnClicked();
|
||||
case ROUTE_AVOID_FERRY -> onAvoidFerryBtnClicked();
|
||||
case PANORAMAX -> onPanoramaxBtnClicked();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,6 +500,19 @@ public class PlacePageController
|
||||
requireActivity().finish();
|
||||
}
|
||||
|
||||
private void onPanoramaxBtnClicked()
|
||||
{
|
||||
if (mMapObject == null)
|
||||
return;
|
||||
String url = Framework.nativeGetPanoramaxUrl();
|
||||
if (!TextUtils.isEmpty(url))
|
||||
{
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(android.net.Uri.parse(url));
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
private void onRouteFromBtnClicked()
|
||||
{
|
||||
if (mMapObject == null)
|
||||
@@ -637,6 +651,10 @@ public class PlacePageController
|
||||
buttons.add(mapObject.isBookmark() ? PlacePageButtons.ButtonType.BOOKMARK_DELETE
|
||||
: PlacePageButtons.ButtonType.BOOKMARK_SAVE);
|
||||
}
|
||||
|
||||
// Add Panoramax button if imagery is available
|
||||
if (Framework.nativeHasPanoramax())
|
||||
buttons.add(PlacePageButtons.ButtonType.PANORAMAX);
|
||||
}
|
||||
mViewModel.setCurrentButtons(buttons);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user