Repo Created
This commit is contained in:
parent
eb305e2886
commit
a8c22c65db
4784 changed files with 329907 additions and 2 deletions
22
play-services-maps/src/main/AndroidManifest.xml
Normal file
22
play-services-maps/src/main/AndroidManifest.xml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ SPDX-FileCopyrightText: 2022 microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- Include required permissions for Google Maps API to run. -->
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
||||
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
|
||||
|
||||
<queries>
|
||||
<package android:name="com.google.android.apps.maps"/>
|
||||
</queries>
|
||||
|
||||
<application>
|
||||
<uses-library android:name="org.apache.http.legacy"
|
||||
android:required="false"/>
|
||||
</application>
|
||||
</manifest>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps;
|
||||
|
||||
parcelable GoogleMapOptions;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps;
|
||||
|
||||
parcelable StreetViewPanoramaOptions;
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import com.google.android.gms.maps.model.CameraPosition;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.android.gms.maps.model.LatLngBounds;
|
||||
|
||||
interface ICameraUpdateFactoryDelegate {
|
||||
IObjectWrapper zoomIn();
|
||||
IObjectWrapper zoomOut();
|
||||
IObjectWrapper scrollBy(float x, float y);
|
||||
IObjectWrapper zoomTo(float zoom);
|
||||
IObjectWrapper zoomBy(float zoomDelta);
|
||||
IObjectWrapper zoomByWithFocus(float zoomDelta, int x, int y);
|
||||
IObjectWrapper newCameraPosition(in CameraPosition cameraPosition);
|
||||
IObjectWrapper newLatLng(in LatLng latLng);
|
||||
IObjectWrapper newLatLngZoom(in LatLng latLng, float zoom);
|
||||
IObjectWrapper newLatLngBounds(in LatLngBounds bounds, int padding);
|
||||
IObjectWrapper newLatLngBoundsWithSize(in LatLngBounds bounds, int width, int height, int padding);
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
interface ICancelableCallback {
|
||||
void onFinish();
|
||||
void onCancel();
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import com.google.android.gms.maps.GoogleMapOptions;
|
||||
import com.google.android.gms.maps.StreetViewPanoramaOptions;
|
||||
import com.google.android.gms.maps.internal.IMapFragmentDelegate;
|
||||
import com.google.android.gms.maps.internal.IMapViewDelegate;
|
||||
import com.google.android.gms.maps.internal.ICameraUpdateFactoryDelegate;
|
||||
import com.google.android.gms.maps.internal.IStreetViewPanoramaFragmentDelegate;
|
||||
import com.google.android.gms.maps.internal.IStreetViewPanoramaViewDelegate;
|
||||
import com.google.android.gms.maps.model.internal.IBitmapDescriptorFactoryDelegate;
|
||||
|
||||
interface ICreator {
|
||||
void init(IObjectWrapper resources) = 0;
|
||||
IMapFragmentDelegate newMapFragmentDelegate(IObjectWrapper activity) = 1;
|
||||
IMapViewDelegate newMapViewDelegate(IObjectWrapper context, in GoogleMapOptions options) = 2;
|
||||
ICameraUpdateFactoryDelegate newCameraUpdateFactoryDelegate() = 3;
|
||||
IBitmapDescriptorFactoryDelegate newBitmapDescriptorFactoryDelegate() = 4;
|
||||
void initV2(IObjectWrapper resources, int versionCode) = 5;
|
||||
IStreetViewPanoramaViewDelegate newStreetViewPanoramaViewDelegate(IObjectWrapper context, in StreetViewPanoramaOptions options) = 6;
|
||||
IStreetViewPanoramaFragmentDelegate newStreetViewPanoramaFragmentDelegate(IObjectWrapper activity) = 7;
|
||||
int getRendererType() = 8;
|
||||
void logInitialization(IObjectWrapper context, int preferredRenderer) = 9;
|
||||
}
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import android.location.Location;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import com.google.android.gms.maps.model.CameraPosition;
|
||||
import com.google.android.gms.maps.internal.ICancelableCallback;
|
||||
import com.google.android.gms.maps.internal.ILocationSourceDelegate;
|
||||
import com.google.android.gms.maps.internal.IUiSettingsDelegate;
|
||||
import com.google.android.gms.maps.internal.IProjectionDelegate;
|
||||
import com.google.android.gms.maps.internal.IOnCameraChangeListener;
|
||||
import com.google.android.gms.maps.internal.IOnCameraIdleListener;
|
||||
import com.google.android.gms.maps.internal.IOnCameraMoveCanceledListener;
|
||||
import com.google.android.gms.maps.internal.IOnCameraMoveListener;
|
||||
import com.google.android.gms.maps.internal.IOnCameraMoveStartedListener;
|
||||
import com.google.android.gms.maps.internal.IOnCircleClickListener;
|
||||
import com.google.android.gms.maps.internal.IOnMapClickListener;
|
||||
import com.google.android.gms.maps.internal.IOnMapLongClickListener;
|
||||
import com.google.android.gms.maps.internal.IOnMarkerClickListener;
|
||||
import com.google.android.gms.maps.internal.IOnMarkerDragListener;
|
||||
import com.google.android.gms.maps.internal.IOnInfoWindowClickListener;
|
||||
import com.google.android.gms.maps.internal.IOnInfoWindowCloseListener;
|
||||
import com.google.android.gms.maps.internal.IOnInfoWindowLongClickListener;
|
||||
import com.google.android.gms.maps.internal.IInfoWindowAdapter;
|
||||
import com.google.android.gms.maps.internal.IOnMapLoadedCallback;
|
||||
import com.google.android.gms.maps.internal.IOnMyLocationChangeListener;
|
||||
import com.google.android.gms.maps.internal.IOnMyLocationClickListener;
|
||||
import com.google.android.gms.maps.internal.IOnMyLocationButtonClickListener;
|
||||
import com.google.android.gms.maps.internal.IOnGroundOverlayClickListener;
|
||||
import com.google.android.gms.maps.internal.IOnPolygonClickListener;
|
||||
import com.google.android.gms.maps.internal.IOnPolylineClickListener;
|
||||
import com.google.android.gms.maps.internal.ISnapshotReadyCallback;
|
||||
import com.google.android.gms.maps.model.CircleOptions;
|
||||
import com.google.android.gms.maps.model.GroundOverlayOptions;
|
||||
import com.google.android.gms.maps.model.LatLngBounds;
|
||||
import com.google.android.gms.maps.model.MarkerOptions;
|
||||
import com.google.android.gms.maps.model.MapStyleOptions;
|
||||
import com.google.android.gms.maps.model.PolygonOptions;
|
||||
import com.google.android.gms.maps.model.PolylineOptions;
|
||||
import com.google.android.gms.maps.model.TileOverlayOptions;
|
||||
import com.google.android.gms.maps.model.internal.ICircleDelegate;
|
||||
import com.google.android.gms.maps.model.internal.IGroundOverlayDelegate;
|
||||
import com.google.android.gms.maps.model.internal.IIndoorBuildingDelegate;
|
||||
import com.google.android.gms.maps.model.internal.IMarkerDelegate;
|
||||
import com.google.android.gms.maps.model.internal.IPolygonDelegate;
|
||||
import com.google.android.gms.maps.model.internal.IPolylineDelegate;
|
||||
import com.google.android.gms.maps.model.internal.ITileOverlayDelegate;
|
||||
|
||||
interface IGoogleMapDelegate {
|
||||
CameraPosition getCameraPosition() = 0;
|
||||
|
||||
float getMaxZoomLevel() = 1;
|
||||
float getMinZoomLevel() = 2;
|
||||
|
||||
void moveCamera(IObjectWrapper cameraUpdate) = 3;
|
||||
void animateCamera(IObjectWrapper cameraUpdate) = 4;
|
||||
void animateCameraWithCallback(IObjectWrapper cameraUpdate, ICancelableCallback callback) = 5;
|
||||
void animateCameraWithDurationAndCallback(IObjectWrapper cameraUpdate, int duration, ICancelableCallback callback) = 6;
|
||||
void stopAnimation() = 7;
|
||||
|
||||
IPolylineDelegate addPolyline(in PolylineOptions options) = 8;
|
||||
IPolygonDelegate addPolygon(in PolygonOptions options) = 9;
|
||||
IMarkerDelegate addMarker(in MarkerOptions options) = 10;
|
||||
IGroundOverlayDelegate addGroundOverlay(in GroundOverlayOptions options) = 11;
|
||||
ITileOverlayDelegate addTileOverlay(in TileOverlayOptions options) = 12;
|
||||
|
||||
void clear() = 13;
|
||||
|
||||
int getMapType() = 14;
|
||||
void setMapType(int type) = 15;
|
||||
boolean isTrafficEnabled() = 16;
|
||||
void setTrafficEnabled(boolean traffic) = 17;
|
||||
boolean isIndoorEnabled() = 18;
|
||||
void setIndoorEnabled(boolean indoor) = 19;
|
||||
|
||||
boolean isMyLocationEnabled() = 20;
|
||||
void setMyLocationEnabled(boolean myLocation) = 21;
|
||||
Location getMyLocation() = 22;
|
||||
void setLocationSource(ILocationSourceDelegate locationSource) = 23;
|
||||
|
||||
IUiSettingsDelegate getUiSettings() = 24;
|
||||
IProjectionDelegate getProjection() = 25;
|
||||
|
||||
void setOnCameraChangeListener(IOnCameraChangeListener listener) = 26;
|
||||
void setOnMapClickListener(IOnMapClickListener listener) = 27;
|
||||
void setOnMapLongClickListener(IOnMapLongClickListener listener) = 28;
|
||||
void setOnMarkerClickListener(IOnMarkerClickListener listener) = 29;
|
||||
void setOnMarkerDragListener(IOnMarkerDragListener listener) = 30;
|
||||
void setOnInfoWindowClickListener(IOnInfoWindowClickListener listener) = 31;
|
||||
void setInfoWindowAdapter(IInfoWindowAdapter adapter) = 32;
|
||||
|
||||
IObjectWrapper getTestingHelper() = 33;
|
||||
|
||||
ICircleDelegate addCircle(in CircleOptions options) = 34;
|
||||
|
||||
void setOnMyLocationChangeListener(IOnMyLocationChangeListener listener) = 35;
|
||||
void setOnMyLocationButtonClickListener(IOnMyLocationButtonClickListener listener) = 36;
|
||||
|
||||
void snapshot(ISnapshotReadyCallback callback, IObjectWrapper bitmap) = 37;
|
||||
|
||||
void setPadding(int left, int top, int right, int bottom) = 38;
|
||||
|
||||
boolean isBuildingsEnabled() = 39;
|
||||
void setBuildingsEnabled(boolean buildings) = 40;
|
||||
|
||||
void setOnMapLoadedCallback(IOnMapLoadedCallback callback) = 41;
|
||||
|
||||
//IIndoorBuildingDelegate getFocusedBuilding() = 43;
|
||||
//void setIndoorStateChangeListener(IOnIndoorStateChangeListener listener) = 44;
|
||||
|
||||
void setWatermarkEnabled(boolean watermark) = 50;
|
||||
|
||||
//void getMapAsync(IOnMapReadyCallback callback) = 52;
|
||||
void onCreate(in Bundle savedInstanceState) = 53;
|
||||
void onResume() = 54;
|
||||
void onPause() = 55;
|
||||
void onDestroy() = 56;
|
||||
void onLowMemory() = 57;
|
||||
boolean useViewLifecycleWhenInFragment() = 58;
|
||||
void onSaveInstanceState(out Bundle outState) = 59;
|
||||
|
||||
void setContentDescription(String desc) = 60;
|
||||
|
||||
void snapshotForTest(ISnapshotReadyCallback callback) = 70;
|
||||
|
||||
//void setPoiClickListener(IOnPoiClickListener listener) = 79;
|
||||
void onEnterAmbient(in Bundle bundle) = 80;
|
||||
void onExitAmbient() = 81;
|
||||
|
||||
void setOnGroundOverlayClickListener(IOnGroundOverlayClickListener listener) = 82;
|
||||
void setOnInfoWindowLongClickListener(IOnInfoWindowLongClickListener listener) = 83;
|
||||
void setOnPolygonClickListener(IOnPolygonClickListener listener) = 84;
|
||||
void setOnInfoWindowCloseListener(IOnInfoWindowCloseListener listener) = 85;
|
||||
void setOnPolylineClickListener(IOnPolylineClickListener listener) = 86;
|
||||
void setOnCircleClickListener(IOnCircleClickListener listener) = 88;
|
||||
|
||||
boolean setMapStyle(in MapStyleOptions options) = 90;
|
||||
void setMinZoomPreference(float minZoom) = 91;
|
||||
void setMaxZoomPreference(float maxZoom) = 92;
|
||||
void resetMinMaxZoomPreference() = 93;
|
||||
void setLatLngBoundsForCameraTarget(in LatLngBounds bounds) = 94;
|
||||
|
||||
void setCameraMoveStartedListener(IOnCameraMoveStartedListener listener) = 95;
|
||||
void setCameraMoveListener(IOnCameraMoveListener listener) = 96;
|
||||
void setCameraMoveCanceledListener(IOnCameraMoveCanceledListener listener) = 97;
|
||||
void setCameraIdleListener(IOnCameraIdleListener listener) = 98;
|
||||
|
||||
void onStart() = 100;
|
||||
void onStop() = 101;
|
||||
|
||||
void setOnMyLocationClickListener(IOnMyLocationClickListener listener) = 106;
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import com.google.android.gms.maps.model.internal.IMarkerDelegate;
|
||||
|
||||
interface IInfoWindowAdapter {
|
||||
IObjectWrapper getInfoWindow(IMarkerDelegate marker);
|
||||
IObjectWrapper getInfoContents(IMarkerDelegate marker);
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.internal.IOnLocationChangeListener;
|
||||
|
||||
interface ILocationSourceDelegate {
|
||||
void activate(IOnLocationChangeListener listener) = 0;
|
||||
void deactivate() = 1;
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.google.android.gms.maps.internal.IGoogleMapDelegate;
|
||||
import com.google.android.gms.maps.internal.IOnMapReadyCallback;
|
||||
import com.google.android.gms.maps.GoogleMapOptions;
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
|
||||
interface IMapFragmentDelegate {
|
||||
IGoogleMapDelegate getMap();
|
||||
void onInflate(IObjectWrapper activity, in GoogleMapOptions options, in Bundle savedInstanceState);
|
||||
void onCreate(in Bundle savedInstanceState);
|
||||
IObjectWrapper onCreateView(IObjectWrapper layoutInflater, IObjectWrapper container, in Bundle savedInstanceState);
|
||||
void onResume();
|
||||
void onPause();
|
||||
void onDestroyView();
|
||||
void onDestroy();
|
||||
void onLowMemory();
|
||||
void onSaveInstanceState(inout Bundle outState);
|
||||
boolean isReady();
|
||||
void getMapAsync(IOnMapReadyCallback callback);
|
||||
void onEnterAmbient(in Bundle bundle);
|
||||
void onExitAmbient();
|
||||
void onStart();
|
||||
void onStop();
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.google.android.gms.maps.internal.IGoogleMapDelegate;
|
||||
import com.google.android.gms.maps.internal.IOnMapReadyCallback;
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
|
||||
interface IMapViewDelegate {
|
||||
IGoogleMapDelegate getMap();
|
||||
void onCreate(in Bundle savedInstanceState);
|
||||
void onResume();
|
||||
void onPause();
|
||||
void onDestroy();
|
||||
void onLowMemory();
|
||||
void onSaveInstanceState(inout Bundle outState);
|
||||
IObjectWrapper getView();
|
||||
void getMapAsync(IOnMapReadyCallback callback);
|
||||
void onEnterAmbient(in Bundle bundle);
|
||||
void onExitAmbient();
|
||||
void onStart();
|
||||
void onStop();
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.CameraPosition;
|
||||
|
||||
interface IOnCameraChangeListener {
|
||||
void onCameraChange(in CameraPosition update);
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
interface IOnCameraIdleListener {
|
||||
void onCameraIdle();
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
interface IOnCameraMoveCanceledListener {
|
||||
void onCameraMoveCanceled();
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
interface IOnCameraMoveListener {
|
||||
void onCameraMove();
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
interface IOnCameraMoveStartedListener {
|
||||
void onCameraMoveStarted(int i);
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.internal.ICircleDelegate;
|
||||
|
||||
interface IOnCircleClickListener {
|
||||
void onCircleClick(ICircleDelegate circle);
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.internal.IGroundOverlayDelegate;
|
||||
|
||||
interface IOnGroundOverlayClickListener {
|
||||
void onGroundOverlayClick(IGroundOverlayDelegate groundOverlay);
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
interface IOnIndoorStateChangeListener {
|
||||
void onIndoorBuildingFocused() = 0;
|
||||
void onIndoorLevelActivated() = 1;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.internal.IMarkerDelegate;
|
||||
|
||||
interface IOnInfoWindowClickListener {
|
||||
void onInfoWindowClick(IMarkerDelegate marker);
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.internal.IMarkerDelegate;
|
||||
|
||||
interface IOnInfoWindowCloseListener {
|
||||
void onInfoWindowClose(IMarkerDelegate marker);
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.internal.IMarkerDelegate;
|
||||
|
||||
interface IOnInfoWindowLongClickListener {
|
||||
void onInfoWindowLongClick(IMarkerDelegate marker);
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import android.location.Location;
|
||||
|
||||
interface IOnLocationChangeListener {
|
||||
void onLocationChanged(in Location location) = 1;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
|
||||
interface IOnMapClickListener {
|
||||
void onMapClick(in LatLng latLng);
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
interface IOnMapLoadedCallback {
|
||||
void onMapLoaded();
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
|
||||
interface IOnMapLongClickListener {
|
||||
void onMapLongClick(in LatLng latLng);
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.internal.IGoogleMapDelegate;
|
||||
|
||||
interface IOnMapReadyCallback {
|
||||
void onMapReady(IGoogleMapDelegate map);
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.internal.IMarkerDelegate;
|
||||
|
||||
interface IOnMarkerClickListener {
|
||||
boolean onMarkerClick(IMarkerDelegate marker);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.internal.IMarkerDelegate;
|
||||
|
||||
interface IOnMarkerDragListener {
|
||||
void onMarkerDragStart(IMarkerDelegate marker) = 0;
|
||||
void onMarkerDrag(IMarkerDelegate marker) = 1;
|
||||
void onMarkerDragEnd(IMarkerDelegate marker) = 2;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
interface IOnMyLocationButtonClickListener {
|
||||
boolean onMyLocationButtonClick();
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
|
||||
interface IOnMyLocationChangeListener {
|
||||
void onMyLocationChanged(IObjectWrapper location);
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import android.location.Location;
|
||||
|
||||
interface IOnMyLocationClickListener {
|
||||
void onMyLocationClick(in Location location);
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.internal.IPolygonDelegate;
|
||||
|
||||
interface IOnPolygonClickListener {
|
||||
void onPolygonClick(IPolygonDelegate polygon);
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.internal.IPolylineDelegate;
|
||||
|
||||
interface IOnPolylineClickListener {
|
||||
void onPolylineClick(IPolylineDelegate polyline);
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.StreetViewPanoramaCamera;
|
||||
|
||||
interface IOnStreetViewPanoramaCameraChangeListener {
|
||||
void onStreetViewPanoramaCameraChange(in StreetViewPanoramaCamera camera);
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.StreetViewPanoramaLocation;
|
||||
|
||||
interface IOnStreetViewPanoramaChangeListener {
|
||||
void onStreetViewPanoramaChange(in StreetViewPanoramaLocation location);
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.StreetViewPanoramaOrientation;
|
||||
|
||||
interface IOnStreetViewPanoramaClickListener {
|
||||
void onStreetViewPanoramaClick(in StreetViewPanoramaOrientation orientation);
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.StreetViewPanoramaOrientation;
|
||||
|
||||
interface IOnStreetViewPanoramaLongClickListener {
|
||||
void onStreetViewPanoramaLongClick(in StreetViewPanoramaOrientation orientation);
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.maps.internal.IStreetViewPanoramaDelegate;
|
||||
|
||||
interface IOnStreetViewPanoramaReadyCallback {
|
||||
void onStreetViewPanoramaReady(IStreetViewPanoramaDelegate streetView);
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.android.gms.maps.model.VisibleRegion;
|
||||
|
||||
interface IProjectionDelegate {
|
||||
LatLng fromScreenLocation(IObjectWrapper obj);
|
||||
IObjectWrapper toScreenLocation(in LatLng latLng);
|
||||
VisibleRegion getVisibleRegion();
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
interface ISnapshotReadyCallback {
|
||||
void onBitmapReady(in Bitmap bitmap);
|
||||
void onBitmapWrappedReady(IObjectWrapper wrapper);
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import com.google.android.gms.maps.internal.IOnStreetViewPanoramaCameraChangeListener;
|
||||
import com.google.android.gms.maps.internal.IOnStreetViewPanoramaChangeListener;
|
||||
import com.google.android.gms.maps.internal.IOnStreetViewPanoramaClickListener;
|
||||
import com.google.android.gms.maps.internal.IOnStreetViewPanoramaLongClickListener;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.android.gms.maps.model.StreetViewPanoramaCamera;
|
||||
import com.google.android.gms.maps.model.StreetViewPanoramaLocation;
|
||||
import com.google.android.gms.maps.model.StreetViewPanoramaOrientation;
|
||||
import com.google.android.gms.maps.model.StreetViewSource;
|
||||
|
||||
interface IStreetViewPanoramaDelegate {
|
||||
void enableZoom(boolean enableZoom) = 0;
|
||||
void enablePanning(boolean enablePanning) = 1;
|
||||
void enableUserNavigation(boolean enableUserNavigation) = 2;
|
||||
void enableStreetNames(boolean enableStreetNames) = 3;
|
||||
boolean isZoomGesturesEnabled() = 4;
|
||||
boolean isPanningGesturesEnabled() = 5;
|
||||
boolean isUserNavigationEnabled() = 6;
|
||||
boolean isStreetNamesEnabled() = 7;
|
||||
void animateTo(in StreetViewPanoramaCamera streetViewPanoramaCamera, long duration) = 8;
|
||||
StreetViewPanoramaCamera getPanoramaCamera() = 9;
|
||||
void setPositionWithID(String panoramaId) = 10;
|
||||
void setPosition(in LatLng position) = 11;
|
||||
void setPositionWithRadius(in LatLng position, int radius) = 12;
|
||||
StreetViewPanoramaLocation getStreetViewPanoramaLocation() = 13;
|
||||
void setOnStreetViewPanoramaChangeListener(IOnStreetViewPanoramaChangeListener listener) = 14;
|
||||
void setOnStreetViewPanoramaCameraChangeListener(IOnStreetViewPanoramaCameraChangeListener listener) = 15;
|
||||
void setOnStreetViewPanoramaClickListener(IOnStreetViewPanoramaClickListener listener) = 16;
|
||||
StreetViewPanoramaOrientation pointToOrientation(in IObjectWrapper point) = 17;
|
||||
IObjectWrapper orientationToPoint(in StreetViewPanoramaOrientation orientation) = 18;
|
||||
void setOnStreetViewPanoramaLongClickListener(IOnStreetViewPanoramaLongClickListener listener) = 19;
|
||||
void setPositionWithSource(in LatLng position, in StreetViewSource source) = 20;
|
||||
void setPositionWithRadiusAndSource(in LatLng position, int radius, in StreetViewSource source) = 21;
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import com.google.android.gms.maps.StreetViewPanoramaOptions;
|
||||
import com.google.android.gms.maps.internal.IOnStreetViewPanoramaReadyCallback;
|
||||
import com.google.android.gms.maps.internal.IStreetViewPanoramaDelegate;
|
||||
|
||||
interface IStreetViewPanoramaFragmentDelegate {
|
||||
IStreetViewPanoramaDelegate getStreetViewPanorama() = 0;
|
||||
void onInflate(IObjectWrapper activity, in StreetViewPanoramaOptions options, in Bundle savedInstanceState) = 1;
|
||||
void onCreate(in Bundle savedInstanceState) = 2;
|
||||
IObjectWrapper onCreateView(IObjectWrapper layoutInflater, IObjectWrapper container, in Bundle savedInstanceState) = 3;
|
||||
void onResume() = 4;
|
||||
void onPause() = 5;
|
||||
void onDestroyView() = 6;
|
||||
void onDestroy() = 7;
|
||||
void onLowMemory() = 8;
|
||||
void onSaveInstanceState(inout Bundle outState) = 9;
|
||||
boolean isReady() = 10;
|
||||
void getStreetViewPanoramaAsync(IOnStreetViewPanoramaReadyCallback callback) = 11;
|
||||
void onStart() = 12;
|
||||
void onStop() = 13;
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.internal;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import com.google.android.gms.maps.internal.IOnStreetViewPanoramaReadyCallback;
|
||||
import com.google.android.gms.maps.internal.IStreetViewPanoramaDelegate;
|
||||
|
||||
interface IStreetViewPanoramaViewDelegate {
|
||||
IStreetViewPanoramaDelegate getStreetViewPanorama() = 0;
|
||||
void onCreate(in Bundle savedInstanceState) = 1;
|
||||
void onResume() = 2;
|
||||
void onPause() = 3;
|
||||
void onDestroy() = 4;
|
||||
void onLowMemory() = 5;
|
||||
void onSaveInstanceState(inout Bundle outState) = 6;
|
||||
IObjectWrapper getView() = 7;
|
||||
void getStreetViewPanoramaAsync(IOnStreetViewPanoramaReadyCallback callback) = 8;
|
||||
void onStart() = 9;
|
||||
void onStop() = 10;
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.google.android.gms.maps.internal;
|
||||
|
||||
interface IUiSettingsDelegate {
|
||||
void setZoomControlsEnabled(boolean zoom);
|
||||
void setCompassEnabled(boolean compass);
|
||||
void setMyLocationButtonEnabled(boolean locationButton);
|
||||
void setScrollGesturesEnabled(boolean scrollGestures);
|
||||
void setZoomGesturesEnabled(boolean zoomGestures);
|
||||
void setTiltGesturesEnabled(boolean tiltGestures);
|
||||
void setRotateGesturesEnabled(boolean rotateGestures);
|
||||
void setAllGesturesEnabled(boolean gestures);
|
||||
boolean isZoomControlsEnabled();
|
||||
boolean isCompassEnabled();
|
||||
boolean isMyLocationButtonEnabled();
|
||||
boolean isScrollGesturesEnabled();
|
||||
boolean isZoomGesturesEnabled();
|
||||
boolean isTiltGesturesEnabled();
|
||||
boolean isRotateGesturesEnabled();
|
||||
void setIndoorLevelPickerEnabled(boolean indoorLevelPicker);
|
||||
boolean isIndoorLevelPickerEnabled();
|
||||
void setMapToolbarEnabled(boolean mapToolbar);
|
||||
boolean isMapToolbarEnabled();
|
||||
void setScrollGesturesEnabledDuringRotateOrZoom(boolean scrollDuringZoom);
|
||||
boolean isScrollGesturesEnabledDuringRotateOrZoom();
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable CameraPosition;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable Cap;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable CircleOptions;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable Dash;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable Dot;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable Gap;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable GroundOverlayOptions;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable LatLng;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable LatLngBounds;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable MapStyleOptions;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable MarkerOptions;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable PatternItem;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable PolygonOptions;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable PolylineOptions;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable StreetViewPanoramaCamera;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable StreetViewPanoramaLocation;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable StreetViewPanoramaOrientation;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable StreetViewSource;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable StyleSpan;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable Tile;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable TileOverlayOptions;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.maps.model;
|
||||
|
||||
parcelable VisibleRegion;
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.google.android.gms.maps.model.internal;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
|
||||
interface IBitmapDescriptorFactoryDelegate {
|
||||
IObjectWrapper fromResource(int resourceId);
|
||||
IObjectWrapper fromAsset(String assetName);
|
||||
IObjectWrapper fromFile(String fileName);
|
||||
IObjectWrapper defaultMarker();
|
||||
IObjectWrapper defaultMarkerWithHue(float hue);
|
||||
IObjectWrapper fromBitmap(in Bitmap bitmap);
|
||||
IObjectWrapper fromPath(String absolutePath);
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.google.android.gms.maps.model.internal;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.android.gms.maps.model.PatternItem;
|
||||
|
||||
interface ICircleDelegate {
|
||||
void remove();
|
||||
String getId();
|
||||
void setCenter(in LatLng center);
|
||||
LatLng getCenter();
|
||||
void setRadius(double radius);
|
||||
double getRadius();
|
||||
void setStrokeWidth(float width);
|
||||
float getStrokeWidth();
|
||||
void setStrokeColor(int color);
|
||||
int getStrokeColor();
|
||||
void setFillColor(int color);
|
||||
int getFillColor();
|
||||
void setZIndex(float zIndex);
|
||||
float getZIndex();
|
||||
void setVisible(boolean visible);
|
||||
boolean isVisible();
|
||||
boolean equalsRemote(ICircleDelegate other);
|
||||
int hashCodeRemote();
|
||||
void setClickable(boolean clickable);
|
||||
boolean isClickable();
|
||||
void setStrokePattern(in List<PatternItem> items);
|
||||
List<PatternItem> getStrokePattern();
|
||||
void setTag(IObjectWrapper object);
|
||||
IObjectWrapper getTag();
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.google.android.gms.maps.model.internal;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.android.gms.maps.model.LatLngBounds;
|
||||
|
||||
interface IGroundOverlayDelegate {
|
||||
void remove() = 0;
|
||||
String getId() = 1;
|
||||
void setPosition(in LatLng pos) = 2;
|
||||
LatLng getPosition() = 3;
|
||||
void setDimension(float dimension) = 4;
|
||||
void setDimensions(float width, float height) = 5;
|
||||
float getWidth() = 6;
|
||||
float getHeight() = 7;
|
||||
void setPositionFromBounds(in LatLngBounds bounds) = 8;
|
||||
LatLngBounds getBounds() = 9;
|
||||
void setBearing(float bearing) = 10;
|
||||
float getBearing() = 11;
|
||||
void setZIndex(float zIndex) = 12;
|
||||
float getZIndex() = 13;
|
||||
void setVisible(boolean visible) = 14;
|
||||
boolean isVisible() = 15;
|
||||
void setTransparency(float transparency) = 16;
|
||||
float getTransparency() = 17;
|
||||
boolean equalsRemote(IGroundOverlayDelegate other) = 18;
|
||||
int hashCodeRemote() = 19;
|
||||
void setImage(IObjectWrapper img) = 20;
|
||||
void setClickable(boolean clickable) = 21;
|
||||
boolean isClickable() = 22;
|
||||
void setTag(IObjectWrapper obj) = 23;
|
||||
IObjectWrapper getTag() = 24;
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.google.android.gms.maps.model.internal;
|
||||
|
||||
interface IIndoorBuildingDelegate {
|
||||
int getActiveLevelIndex() = 0;
|
||||
int getDefaultLevelIndex() = 1;
|
||||
List<IBinder> getLevels() = 2; // IIndoorLevelDelegate's
|
||||
boolean isUnderground() = 3;
|
||||
boolean equalsRemote(IIndoorBuildingDelegate other) = 4;
|
||||
int hashCodeRemote() = 5;
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.google.android.gms.maps.model.internal;
|
||||
|
||||
interface IIndoorLevelDelegate {
|
||||
String getName() = 0;
|
||||
String getShortName() = 1;
|
||||
void activate() = 2;
|
||||
boolean equalsRemote(IIndoorLevelDelegate other) = 3;
|
||||
int hashCodeRemote() = 4;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.google.android.gms.maps.model.internal;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
|
||||
interface IMarkerDelegate {
|
||||
void remove();
|
||||
String getId();
|
||||
void setPosition(in LatLng pos);
|
||||
LatLng getPosition();
|
||||
void setTitle(String title);
|
||||
String getTitle();
|
||||
void setSnippet(String snippet);
|
||||
String getSnippet();
|
||||
void setDraggable(boolean drag);
|
||||
boolean isDraggable();
|
||||
void showInfoWindow();
|
||||
void hideInfoWindow();
|
||||
boolean isInfoWindowShown();
|
||||
void setVisible(boolean visible);
|
||||
boolean isVisible();
|
||||
boolean equalsRemote(IMarkerDelegate other);
|
||||
int hashCodeRemote();
|
||||
void setIcon(IObjectWrapper obj);
|
||||
void setAnchor(float x, float y);
|
||||
void setFlat(boolean flat);
|
||||
boolean isFlat();
|
||||
void setRotation(float rotation);
|
||||
float getRotation();
|
||||
void setInfoWindowAnchor(float x, float y);
|
||||
void setAlpha(float alpha);
|
||||
float getAlpha();
|
||||
void setZIndex(float zIndex);
|
||||
float getZIndex();
|
||||
void setTag(IObjectWrapper obj);
|
||||
IObjectWrapper getTag();
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2015 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.model.internal;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.android.gms.maps.model.PatternItem;
|
||||
|
||||
interface IPolygonDelegate {
|
||||
void remove() = 0;
|
||||
String getId() = 1;
|
||||
void setPoints(in List<LatLng> points) = 2;
|
||||
List<LatLng> getPoints() = 3;
|
||||
void setHoles(in List holes) = 4;
|
||||
List getHoles() = 5;
|
||||
void setStrokeWidth(float width) = 6;
|
||||
float getStrokeWidth() = 7;
|
||||
void setStrokeColor(int color) = 8;
|
||||
int getStrokeColor() = 9;
|
||||
void setFillColor(int color) = 10;
|
||||
int getFillColor() = 11;
|
||||
void setZIndex(float zIndex) = 12;
|
||||
float getZIndex() = 13;
|
||||
void setVisible(boolean visible) = 14;
|
||||
boolean isVisible() = 15;
|
||||
void setGeodesic(boolean geod) = 16;
|
||||
boolean isGeodesic() = 17;
|
||||
boolean equalsRemote(IPolygonDelegate other) = 18;
|
||||
int hashCodeRemote() = 19;
|
||||
void setClickable(boolean click) = 20;
|
||||
boolean isClickable() = 21;
|
||||
void setStrokeJointType(int type) = 22;
|
||||
int getStrokeJointType() = 23;
|
||||
void setStrokePattern(in List<PatternItem> items) = 24;
|
||||
List<PatternItem> getStrokePattern() = 25;
|
||||
void setTag(IObjectWrapper obj) = 26;
|
||||
IObjectWrapper getTag() = 27;
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.google.android.gms.maps.model.internal;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import com.google.android.gms.maps.model.Cap;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.android.gms.maps.model.PatternItem;
|
||||
import com.google.android.gms.maps.model.StyleSpan;
|
||||
|
||||
interface IPolylineDelegate {
|
||||
void remove() = 0;
|
||||
String getId() = 1;
|
||||
void setPoints(in List<LatLng> points) = 2;
|
||||
List<LatLng> getPoints() = 3;
|
||||
void setWidth(float width) = 4;
|
||||
float getWidth() = 5;
|
||||
void setColor(int color) = 6;
|
||||
int getColor() = 7;
|
||||
void setZIndex(float zIndex) = 8;
|
||||
float getZIndex() = 9;
|
||||
void setVisible(boolean visible) = 10;
|
||||
boolean isVisible() = 11;
|
||||
void setGeodesic(boolean geod) = 12;
|
||||
boolean isGeodesic() = 13;
|
||||
boolean equalsRemote(IPolylineDelegate other) = 14;
|
||||
int hashCodeRemote() = 15;
|
||||
void setClickable(boolean clickable) = 16;
|
||||
boolean isClickable() = 17;
|
||||
void setStartCap(in Cap startCap) = 18;
|
||||
Cap getStartCap() = 19;
|
||||
void setEndCap(in Cap endCap) = 20;
|
||||
Cap getEndCap() = 21;
|
||||
void setJointType(int jointType) = 22;
|
||||
int getJointType() = 23;
|
||||
void setPattern(in List<PatternItem> pattern) = 24;
|
||||
List<PatternItem> getPattern() = 25;
|
||||
void setTag(IObjectWrapper tag) = 26;
|
||||
IObjectWrapper getTag() = 27;
|
||||
//void setSpans(in List<StyleSpan> spans) = 28;
|
||||
//List<StyleSpan> getSpans() = 29
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.google.android.gms.maps.model.internal;
|
||||
|
||||
interface ITileOverlayDelegate {
|
||||
void remove() = 0;
|
||||
void clearTileCache() = 1;
|
||||
String getId() = 2;
|
||||
void setZIndex(float zIndex) = 3;
|
||||
float getZIndex() = 4;
|
||||
void setVisible(boolean visible) = 5;
|
||||
boolean isVisible() = 6;
|
||||
boolean equalsRemote(ITileOverlayDelegate other) = 7;
|
||||
int hashCodeRemote() = 8;
|
||||
void setFadeIn(boolean fadeIn) = 9;
|
||||
boolean getFadeIn() = 10;
|
||||
void setTransparency(float transparency) = 11;
|
||||
float getTransparency() = 12;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.google.android.gms.maps.model.internal;
|
||||
|
||||
import com.google.android.gms.maps.model.Tile;
|
||||
|
||||
interface ITileProviderDelegate {
|
||||
Tile getTile(int x, int y, int zoom);
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import org.microg.gms.common.PublicApi;
|
||||
|
||||
/**
|
||||
* Defines a camera move. An object of this type can be used to modify a map's camera by calling {@link GoogleMap#animateCamera(CameraUpdate)},
|
||||
* {@link GoogleMap#animateCamera(CameraUpdate, GoogleMap.CancelableCallback)} or {@link GoogleMap#moveCamera(CameraUpdate)}.
|
||||
* <p>
|
||||
* To obtain a {@link CameraUpdate} use the factory class {@link CameraUpdateFactory}.
|
||||
*/
|
||||
@PublicApi
|
||||
public class CameraUpdate {
|
||||
IObjectWrapper wrapped;
|
||||
|
||||
CameraUpdate(IObjectWrapper wrapped) {
|
||||
this.wrapped = wrapped;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps;
|
||||
|
||||
import android.os.RemoteException;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.google.android.gms.maps.internal.ICameraUpdateFactoryDelegate;
|
||||
import com.google.android.gms.maps.model.CameraPosition;
|
||||
import org.microg.gms.common.Hide;
|
||||
|
||||
/**
|
||||
* A class containing methods for creating {@link CameraUpdate} objects that change a map's camera. To modify the map's camera, call
|
||||
* {@link GoogleMap#animateCamera(CameraUpdate)}, {@link GoogleMap#animateCamera(CameraUpdate, GoogleMap.CancelableCallback)} or
|
||||
* {@link GoogleMap#moveCamera(CameraUpdate)}, using a {@link CameraUpdate} object created with this class.
|
||||
*/
|
||||
public class CameraUpdateFactory {
|
||||
private static ICameraUpdateFactoryDelegate delegate;
|
||||
@Hide
|
||||
public static void setDelegate(@NonNull ICameraUpdateFactoryDelegate delegate) {
|
||||
CameraUpdateFactory.delegate = delegate;
|
||||
}
|
||||
private static ICameraUpdateFactoryDelegate getDelegate() {
|
||||
if (delegate == null) throw new IllegalStateException("CameraUpdateFactory is not initialized");
|
||||
return delegate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a {@link CameraUpdate} that moves the camera to a specified {@link CameraPosition}. In effect, this creates a transformation from the
|
||||
* {@link CameraPosition} object's latitude, longitude, zoom level, bearing and tilt.
|
||||
*
|
||||
* @param cameraPosition The requested position. Must not be {@code null}.
|
||||
* @return a {@link CameraUpdate} containing the transformation.
|
||||
*/
|
||||
public static CameraUpdate newCameraPosition(@NonNull CameraPosition cameraPosition) {
|
||||
try {
|
||||
return new CameraUpdate(getDelegate().newCameraPosition(cameraPosition));
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,199 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps;
|
||||
|
||||
import android.os.RemoteException;
|
||||
import android.view.View;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.gms.maps.internal.ICancelableCallback;
|
||||
import com.google.android.gms.maps.internal.IGoogleMapDelegate;
|
||||
import com.google.android.gms.maps.model.CameraPosition;
|
||||
import com.google.android.gms.maps.model.Circle;
|
||||
import com.google.android.gms.maps.model.CircleOptions;
|
||||
import com.google.android.gms.maps.model.RuntimeRemoteException;
|
||||
import org.microg.gms.common.Hide;
|
||||
|
||||
/**
|
||||
* This is the main class of the Google Maps SDK for Android and is the entry point for all methods related to the map. You cannot instantiate a
|
||||
* {@link GoogleMap} object directly, rather, you must obtain one from the {@code getMapAsync()} method on a {@link MapFragment} or {@link MapView} that you
|
||||
* have added to your application.
|
||||
* <p>
|
||||
* Note: Similar to a {@link View} object, a {@link GoogleMap} can only be read and modified from the Android UI thread. Calling {@link GoogleMap} methods from
|
||||
* another thread will result in an exception.
|
||||
* <p>
|
||||
* You can adjust the viewpoint of a map by changing the position of the camera (as opposed to moving the map). You can use the map's camera to set parameters
|
||||
* such as location, zoom level, tilt angle, and bearing.
|
||||
*/
|
||||
public class GoogleMap {
|
||||
/**
|
||||
* No base map tiles.
|
||||
*/
|
||||
public static final int MAP_TYPE_NONE = 0;
|
||||
/**
|
||||
* Basic maps.
|
||||
*/
|
||||
public static final int MAP_TYPE_NORMAL = 1;
|
||||
/**
|
||||
* Satellite maps with no labels.
|
||||
*/
|
||||
public static final int MAP_TYPE_SATELLITE = 2;
|
||||
/**
|
||||
* Terrain maps.
|
||||
*/
|
||||
public static final int MAP_TYPE_TERRAIN = 3;
|
||||
/**
|
||||
* Satellite maps with a transparent layer of major streets.
|
||||
*/
|
||||
public static final int MAP_TYPE_HYBRID = 4;
|
||||
|
||||
private final IGoogleMapDelegate delegate;
|
||||
|
||||
@Hide
|
||||
public GoogleMap(IGoogleMapDelegate delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
private IGoogleMapDelegate getDelegate() {
|
||||
return delegate;
|
||||
}
|
||||
|
||||
public Circle addCircle(CircleOptions options) {
|
||||
try {
|
||||
return new Circle(getDelegate().addCircle(options));
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Animates the movement of the camera from the current position to the position defined in the update. During the animation, a call to
|
||||
* {@link #getCameraPosition()} returns an intermediate location of the camera.
|
||||
* <p>
|
||||
* See CameraUpdateFactory for a set of updates.
|
||||
*
|
||||
* @param update The change that should be applied to the camera.
|
||||
*/
|
||||
public void animateCamera(CameraUpdate update) {
|
||||
try {
|
||||
getDelegate().animateCamera(update.wrapped);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Animates the movement of the camera from the current position to the position defined in the update and calls an optional callback on completion. See
|
||||
* {@link CameraUpdateFactory} for a set of updates.
|
||||
* <p>
|
||||
* During the animation, a call to {@link #getCameraPosition()} returns an intermediate location of the camera.
|
||||
*
|
||||
* @param update The change that should be applied to the camera.
|
||||
* @param callback The callback to invoke from the Android UI thread when the animation stops. If the animation completes normally,
|
||||
* {@link GoogleMap.CancelableCallback#onFinish()} is called; otherwise, {@link GoogleMap.CancelableCallback#onCancel()} is called. Do not
|
||||
* update or animate the camera from within {@link GoogleMap.CancelableCallback#onCancel()}.
|
||||
*/
|
||||
public void animateCamera(CameraUpdate update, @Nullable GoogleMap.CancelableCallback callback) {
|
||||
try {
|
||||
getDelegate().animateCameraWithCallback(update.wrapped, new ICancelableCallback.Stub() {
|
||||
@Override
|
||||
public void onFinish() throws RemoteException {
|
||||
if (callback != null) {
|
||||
callback.onFinish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() throws RemoteException {
|
||||
if (callback != null) {
|
||||
callback.onCancel();
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current position of the camera.
|
||||
* <p>
|
||||
* The {@link CameraPosition} returned is a snapshot of the current position, and will not automatically update when the camera moves.
|
||||
*
|
||||
* @return The current position of the Camera.
|
||||
*/
|
||||
public CameraPosition getCameraPosition() {
|
||||
try {
|
||||
return getDelegate().getCameraPosition();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Repositions the camera according to the instructions defined in the update. The move is instantaneous, and a subsequent {@link #getCameraPosition()} will
|
||||
* reflect the new position. See {@link CameraUpdateFactory} for a set of updates.
|
||||
*
|
||||
* @param update The change that should be applied to the camera.
|
||||
*/
|
||||
public void moveCamera(CameraUpdate update) {
|
||||
try {
|
||||
getDelegate().moveCamera(update.wrapped);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A callback interface for reporting when a task is complete or canceled.
|
||||
*/
|
||||
public interface CancelableCallback {
|
||||
/**
|
||||
* Invoked when a task is canceled.
|
||||
*/
|
||||
void onCancel();
|
||||
|
||||
/**
|
||||
* Invoked when a task is complete.
|
||||
*/
|
||||
void onFinish();
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback interface for when the camera motion starts.
|
||||
*/
|
||||
public interface OnCameraMoveStartedListener {
|
||||
/**
|
||||
* Camera motion initiated in response to user gestures on the map. For example: pan, tilt, pinch to zoom, or rotate.
|
||||
*/
|
||||
int REASON_GESTURE = 1;
|
||||
/**
|
||||
* Non-gesture animation initiated in response to user actions. For example: zoom buttons, my location button, or marker clicks.
|
||||
*/
|
||||
int REASON_API_ANIMATION = 2;
|
||||
/**
|
||||
* Developer initiated animation.
|
||||
*/
|
||||
int REASON_DEVELOPER_ANIMATION = 3;
|
||||
|
||||
/**
|
||||
* Called when the camera starts moving after it has been idle or when the reason for camera motion has changed.
|
||||
* Do not update or animate the camera from within this method.
|
||||
* <p>
|
||||
* This is called on the Android UI thread.
|
||||
*
|
||||
* @param reason The reason for the camera change. Possible values:
|
||||
* <ul>
|
||||
* <li>{@link #REASON_GESTURE}: User gestures on the map.</li>
|
||||
* <li>{@link #REASON_API_ANIMATION}: Default animations resulting from user interaction.</li>
|
||||
* <li>{@link #REASON_DEVELOPER_ANIMATION}: Developer animations.</li>
|
||||
* </ul>
|
||||
*/
|
||||
void onCameraMoveStarted(int reason);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,479 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2015 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.SurfaceView;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.gms.maps.model.CameraPosition;
|
||||
import com.google.android.gms.maps.model.LatLngBounds;
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
|
||||
/**
|
||||
* Defines configuration GoogleMapOptions for a {@link GoogleMap}. These options can be used when adding a map to your application programmatically
|
||||
* (as opposed to via XML). If you are using a {@link MapFragment}, you can pass these options in using the static factory method
|
||||
* {@link MapFragment#newInstance(GoogleMapOptions)}. If you are using a {@link MapView}, you can pass these options in using the constructor
|
||||
* {@link MapView#MapView(Context, GoogleMapOptions)}.
|
||||
* <p>
|
||||
* If you add a map using XML, then you can apply these options using custom XML tags.
|
||||
*/
|
||||
public final class GoogleMapOptions extends AutoSafeParcelable {
|
||||
@Field(1)
|
||||
private int versionCode;
|
||||
@Field(2)
|
||||
private int zOrderOnTop;
|
||||
@Field(3)
|
||||
private boolean useViewLifecycleInFragment;
|
||||
@Field(4)
|
||||
private int mapType;
|
||||
@Field(5)
|
||||
@Nullable
|
||||
private CameraPosition camera;
|
||||
@Field(6)
|
||||
private boolean zoomControlsEnabled;
|
||||
@Field(7)
|
||||
private boolean compassEnabled;
|
||||
@Field(8)
|
||||
private boolean scrollGesturesEnabled = true;
|
||||
@Field(9)
|
||||
private boolean zoomGesturesEnabled = true;
|
||||
@Field(10)
|
||||
private boolean tiltGesturesEnabled = true;
|
||||
@Field(11)
|
||||
private boolean rotateGesturesEnabled = true;
|
||||
@Field(12)
|
||||
private int liteMode = 0;
|
||||
@Field(14)
|
||||
private boolean mapToobarEnabled = false;
|
||||
@Field(15)
|
||||
private boolean ambientEnabled = false;
|
||||
@Field(16)
|
||||
private float minZoom;
|
||||
@Field(17)
|
||||
private float maxZoom;
|
||||
@Field(18)
|
||||
@Nullable
|
||||
private LatLngBounds boundsForCamera;
|
||||
@Field(19)
|
||||
private boolean scrollGesturesEnabledDuringRotateOrZoom = true;
|
||||
@Field(20)
|
||||
@ColorInt
|
||||
@Nullable
|
||||
private Integer backgroundColor;
|
||||
@Field(21)
|
||||
@Nullable
|
||||
private String mapId;
|
||||
|
||||
/**
|
||||
* Creates a new GoogleMapOptions object.
|
||||
*/
|
||||
public GoogleMapOptions() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@code GoogleMapsOptions} from the {@link AttributeSet}.
|
||||
*/
|
||||
public static @Nullable GoogleMapOptions createFromAttributes(@Nullable Context context, @Nullable AttributeSet attrs) {
|
||||
if (context == null || attrs == null) return null;
|
||||
GoogleMapOptions options = new GoogleMapOptions();
|
||||
TypedArray obtainAttributes = context.getResources().obtainAttributes(attrs, R.styleable.MapAttrs);
|
||||
// TODO: Handle attributes
|
||||
if (obtainAttributes.hasValue(R.styleable.MapAttrs_mapType)) {
|
||||
// options.mapType(obtainAttributes.getInt(R.styleable.MapAttrs_mapType, -1));
|
||||
}
|
||||
obtainAttributes.recycle();
|
||||
return options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether ambient-mode styling should be enabled. The default value is {@code false}.
|
||||
* When enabled, ambient-styled maps can be displayed when an Ambiactive device enters ambient mode.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions ambientEnabled(boolean enabled) {
|
||||
this.ambientEnabled = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the map background color. This is the color that shows underneath map tiles and displays whenever the renderer does not have a tile available for
|
||||
* a portion of the viewport.
|
||||
*
|
||||
* @param backgroundColor the color to show in the background of the map. If {@code null} is supplied then the map uses the default renderer background color.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions backgroundColor(@Nullable @ColorInt Integer backgroundColor) {
|
||||
this.backgroundColor = backgroundColor;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the initial camera position for the map (specify null to use the default camera position).
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions camera(@Nullable CameraPosition camera) {
|
||||
this.camera = camera;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether the compass should be enabled. See {@link UiSettings#setCompassEnabled(boolean)} for more details. The default value is {@code true}.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions compassEnabled(boolean enabled) {
|
||||
this.compassEnabled = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies a LatLngBounds to constrain the camera target, so that when users scroll and pan the map, the camera target does not move outside these bounds.
|
||||
* <p>
|
||||
* See {@link GoogleMap#setLatLngBoundsForCameraTarget(LatLngBounds)} for details.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions latLngBoundsForCameraTarget(@Nullable LatLngBounds llbounds) {
|
||||
this.boundsForCamera = llbounds;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether the map should be created in lite mode. The default value is {@code false}. If lite mode is enabled, maps will load as static images.
|
||||
* This improves performance in the case where a lot of maps need to be displayed at the same time, for example in a scrolling list, however lite-mode maps
|
||||
* cannot be panned or zoomed by the user, or tilted or rotated at all.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions liteMode(boolean enabled) {
|
||||
this.liteMode = enabled ? 1 : 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the map's ID.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions mapId(@NonNull String mapId) {
|
||||
this.mapId = mapId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether the mapToolbar should be enabled. See {@link UiSettings#setMapToolbarEnabled(boolean)} for more details.
|
||||
* The default value is {@code true}.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions mapToolbarEnabled(boolean enabled) {
|
||||
this.mapToobarEnabled = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies a change to the initial map type.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions mapType(int mapType) {
|
||||
this.mapType = mapType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies a preferred upper bound for camera zoom.
|
||||
* <p>
|
||||
* See {@link GoogleMap#setMaxZoomPreference(float)} for details.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions maxZoomPreference(float maxZoomPreference) {
|
||||
this.maxZoom = maxZoomPreference;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies a preferred lower bound for camera zoom.
|
||||
* <p>
|
||||
* See {@link GoogleMap#setMinZoomPreference(float)} for details.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions minZoomPreference(float minZoomPreference) {
|
||||
this.minZoom = minZoomPreference;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether rotate gestures should be enabled. See {@link UiSettings#setRotateGesturesEnabled(boolean)} for more details.
|
||||
* The default value is {@code true}.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions rotateGesturesEnabled(boolean enabled) {
|
||||
this.rotateGesturesEnabled = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether scroll gestures should be enabled. See {@link UiSettings#setScrollGesturesEnabled(boolean)} for more details.
|
||||
* The default value is {@code true}.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions scrollGesturesEnabled(boolean enabled) {
|
||||
this.scrollGesturesEnabled = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether scroll gestures should be enabled during rotate and zoom gestures.
|
||||
* See {@link UiSettings#setScrollGesturesEnabledDuringRotateOrZoom(boolean)} for more details. The default value is {@code true}.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions scrollGesturesEnabledDuringRotateOrZoom(boolean enabled) {
|
||||
this.scrollGesturesEnabledDuringRotateOrZoom = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether tilt gestures should be enabled. See {@link UiSettings#setTiltGesturesEnabled(boolean)} for more details.
|
||||
* The default value is {@code true}.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions tiltGesturesEnabled(boolean enabled) {
|
||||
this.tiltGesturesEnabled = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* When using a {@link MapFragment}, this flag specifies whether the lifecycle of the map should be tied to the fragment's view or the fragment itself.
|
||||
* The default value is {@code false}, tying the lifecycle of the map to the fragment.
|
||||
* <p>
|
||||
* Using the lifecycle of the fragment allows faster rendering of the map when the fragment is detached and reattached, because the underlying GL context
|
||||
* is preserved. This has the cost that detaching the fragment, but not destroying it, will not release memory used by the map.
|
||||
* <p>
|
||||
* Using the lifecycle of a fragment's view means that a map is not reused when the fragment is detached and reattached. This will cause the map to
|
||||
* re-render from scratch, which can take a few seconds. It also means that while a fragment is detached, and therefore has no view, all {@link GoogleMap}
|
||||
* methods will throw {@link NullPointerException}.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions useViewLifecycleInFragment(boolean useViewLifecycleInFragment) {
|
||||
this.useViewLifecycleInFragment = useViewLifecycleInFragment;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Control whether the map view's surface is placed on top of its window. See {@link SurfaceView#setZOrderOnTop(boolean)} for more details.
|
||||
* Note that this will cover all other views that could appear on the map (e.g., the zoom controls, the my location button).
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions zOrderOnTop(boolean zOrderOnTop) {
|
||||
this.zOrderOnTop = zOrderOnTop ? 1 : 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether the zoom controls should be enabled. See {@link UiSettings#setZoomControlsEnabled(boolean)} for more details.
|
||||
* The default value is {@code true}.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions zoomControlsEnabled(boolean enabled) {
|
||||
this.zoomControlsEnabled = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether zoom gestures should be enabled. See {@link UiSettings#setZoomGesturesEnabled(boolean)} for more details.
|
||||
* The default value is {@code true}.
|
||||
*/
|
||||
@NonNull
|
||||
public GoogleMapOptions zoomGesturesEnabled(boolean enabled) {
|
||||
this.zoomGesturesEnabled = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@code ambientEnabled} option, or {@code null} if unspecified.
|
||||
*/
|
||||
public Boolean getAmbientEnabled() {
|
||||
return ambientEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the current backgroundColor for the map, or null if unspecified.
|
||||
*/
|
||||
public Integer getBackgroundColor() {
|
||||
return backgroundColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the camera option, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public CameraPosition getCamera() {
|
||||
return camera;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@code compassEnabled} option, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getCompassEnabled() {
|
||||
return compassEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@code LatLngBounds} used to constrain the camera target, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public LatLngBounds getLatLngBoundsForCameraTarget() {
|
||||
return boundsForCamera;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@code liteMode} option, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public boolean getLiteMode() {
|
||||
// Is encoded as `-1` if null, `0` if false, `1` if true. The default is false.
|
||||
return liteMode == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@code mapId}, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public String getMapId() {
|
||||
return mapId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@code mapToolbarEnabled} option, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getMapToolbarEnabled() {
|
||||
return mapToobarEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@code mapType} option, or -1 if unspecified.
|
||||
*/
|
||||
public int getMapType() {
|
||||
return mapType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the maximum zoom level preference, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public Float getMaxZoomPreference() {
|
||||
return maxZoom;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the minimum zoom level preference, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public Float getMinZoomPreference() {
|
||||
return minZoom;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@code rotateGesturesEnabled} option, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getRotateGesturesEnabled() {
|
||||
return rotateGesturesEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@code scrollGesturesEnabled} option, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getScrollGesturesEnabled() {
|
||||
return scrollGesturesEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@code scrollGesturesEnabledDuringRotateOrZoom} option, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getScrollGesturesEnabledDuringRotateOrZoom() {
|
||||
return scrollGesturesEnabledDuringRotateOrZoom;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@code tiltGesturesEnabled} option, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getTiltGesturesEnabled() {
|
||||
return tiltGesturesEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@code useViewLifecycleInFragment} option, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getUseViewLifecycleInFragment() {
|
||||
return useViewLifecycleInFragment;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@code zOrderOnTop} option, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getZOrderOnTop() {
|
||||
return zOrderOnTop == 1; // TODO
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@code zoomControlsEnabled} option, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getZoomControlsEnabled() {
|
||||
return zoomControlsEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@code zoomGesturesEnabled} option, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getZoomGesturesEnabled() {
|
||||
return zoomGesturesEnabled;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean isCompassEnabled() {
|
||||
return compassEnabled;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean isZoomControlsEnabled() {
|
||||
return zoomControlsEnabled;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean isScrollGesturesEnabled() {
|
||||
return scrollGesturesEnabled;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean isZoomGesturesEnabled() {
|
||||
return zoomGesturesEnabled;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean isTiltGesturesEnabled() {
|
||||
return tiltGesturesEnabled;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean isRotateGesturesEnabled() {
|
||||
return rotateGesturesEnabled;
|
||||
}
|
||||
|
||||
|
||||
public static Creator<GoogleMapOptions> CREATOR = new AutoCreator<GoogleMapOptions>(GoogleMapOptions.class);
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps;
|
||||
|
||||
import android.app.Fragment;
|
||||
|
||||
public class MapFragment extends Fragment {
|
||||
}
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.FrameLayout;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import org.microg.gms.maps.MapViewLifecycleHelper;
|
||||
|
||||
/**
|
||||
* A View which displays a map. When focused, it will capture keypresses and touch gestures to move the map.
|
||||
* <p>
|
||||
* Users of this class must forward all the life cycle methods from the {@link Activity} or {@link Fragment} containing this view to the corresponding ones in
|
||||
* this class.
|
||||
* <p>
|
||||
* A {@link GoogleMap} must be acquired using {@link #getMapAsync(OnMapReadyCallback)}.
|
||||
* The {@link MapView} automatically initializes the maps system and the view.
|
||||
*/
|
||||
public class MapView extends FrameLayout {
|
||||
private final MapViewLifecycleHelper helper;
|
||||
|
||||
public MapView(@NonNull Context context) {
|
||||
super(context);
|
||||
helper = new MapViewLifecycleHelper(this, context, null);
|
||||
setClickable(true);
|
||||
}
|
||||
|
||||
public MapView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
helper = new MapViewLifecycleHelper(this, context, GoogleMapOptions.createFromAttributes(context, attrs));
|
||||
setClickable(true);
|
||||
}
|
||||
|
||||
public MapView(@NonNull Context context, @NonNull AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
helper = new MapViewLifecycleHelper(this, context, GoogleMapOptions.createFromAttributes(context, attrs));
|
||||
setClickable(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs MapView with {@link GoogleMapOptions}.
|
||||
*
|
||||
* @param options configuration GoogleMapOptions for a {@link GoogleMap}, or {@code null} to use the default options.
|
||||
*/
|
||||
public MapView(@NonNull Context context, @Nullable GoogleMapOptions options) {
|
||||
super(context);
|
||||
helper = new MapViewLifecycleHelper(this, context, options);
|
||||
setClickable(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a instance of the {@link GoogleMap} through the callback, ready to be used.
|
||||
* <p>
|
||||
* Note that:
|
||||
* <ul>
|
||||
* <li>This method must be called from the main thread.</li>
|
||||
* <li>The callback will be executed in the main thread.</li>
|
||||
* <li>In the case where Google Play services is not installed on the user's device, the callback will not be triggered until the user installs it.</li>
|
||||
* <li>The GoogleMap object provided by the callback is never null.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param callback The callback object that will be triggered when the map is ready to be used.
|
||||
*/
|
||||
public void getMapAsync(OnMapReadyCallback callback) {
|
||||
helper.getMapAsync(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
*/
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
helper.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
*/
|
||||
public void onDestroy() {
|
||||
helper.onDestroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent WearableActivity's corresponding method.
|
||||
*/
|
||||
public void onEnterAmbient(Bundle ambientDetails) {
|
||||
if (helper.getDelegate() != null) {
|
||||
helper.getDelegate().onEnterAmbient(ambientDetails);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent WearableActivity's corresponding method.
|
||||
*/
|
||||
public void onExitAmbient() {
|
||||
if (helper.getDelegate() != null) {
|
||||
helper.getDelegate().onExitAmbient();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
*/
|
||||
public void onLowMemory() {
|
||||
helper.onLowMemory();
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
*/
|
||||
public void onPause() {
|
||||
helper.onPause();
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
*/
|
||||
public void onResume() {
|
||||
helper.onResume();
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
* <p>
|
||||
* Provides a {@link Bundle} to store the state of the View before it gets destroyed.
|
||||
* It can later be retrieved when {@link #onCreate(Bundle)} is called again.
|
||||
*/
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
helper.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
*/
|
||||
public void onStart() {
|
||||
helper.onStart();
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
*/
|
||||
public void onStop() {
|
||||
helper.onStop();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.gms.common.api.CommonStatusCodes;
|
||||
import com.google.android.gms.dynamic.ObjectWrapper;
|
||||
import com.google.android.gms.maps.internal.ICreator;
|
||||
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
||||
import com.google.android.gms.maps.model.RuntimeRemoteException;
|
||||
import org.microg.gms.maps.MapsContextLoader;
|
||||
|
||||
/**
|
||||
* Use this class to initialize the Maps SDK for Android if features need to be used before obtaining a map.
|
||||
* It must be called because some classes such as BitmapDescriptorFactory and CameraUpdateFactory need to be initialized.
|
||||
* <p>
|
||||
* If you are using {@link MapFragment} or {@link MapView} and have already obtained a (non-null) {@link GoogleMap} by calling {@code getMapAsync()} on either
|
||||
* of these classes and waiting for the {@code onMapReady(GoogleMap map)} callback, then you do not need to worry about this class.
|
||||
*/
|
||||
public class MapsInitializer {
|
||||
private static final String TAG = "MapsInitializer";
|
||||
private static boolean initialized = false;
|
||||
private static Renderer renderer = Renderer.LEGACY;
|
||||
|
||||
/**
|
||||
* Initializes the Maps SDK for Android so that its classes are ready for use. If you are using {@link MapFragment} or {@link MapView} and have
|
||||
* already obtained a (non-null) {@link GoogleMap} by calling {@code getMapAsync()} on either of these classes, then it is not necessary to call this.
|
||||
*
|
||||
* @param context Required to fetch the necessary SDK resources and code. Must not be {@code null}.
|
||||
* @return A ConnectionResult error code.
|
||||
*/
|
||||
public static synchronized int initialize(@NonNull Context context) {
|
||||
return initialize(context, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies which {@link MapsInitializer.Renderer} type you prefer to use to initialize the Maps SDK for Android, and provides a callback to receive the
|
||||
* actual {@link MapsInitializer.Renderer} type. This call will initialize the Maps SDK for Android, so that its classes are ready for use. The callback
|
||||
* will be triggered when the Maps SDK is initialized.
|
||||
* <p>
|
||||
* The Maps SDK only initializes once per Application lifecycle. Only the first call of this method or {@link #initialize(Context)} takes effect.
|
||||
* If you are using {@link MapFragment} or {@link MapView} and have already obtained a (non-null) {@link GoogleMap} by calling {@code getMapAsync()} on
|
||||
* either of these classes, then this call will have no effect other than triggering the callback for the initialized {@link MapsInitializer.Renderer}.
|
||||
* To make renderer preference meaningful, you must call this method before {@link #initialize(Context)}, and before {@link MapFragment#onCreate(Bundle)}
|
||||
* and {@link MapView#onCreate(Bundle)}. It's recommended to do this in {@link Application#onCreate()}.
|
||||
* <p>
|
||||
* Note the following:
|
||||
* <ul>
|
||||
* <li>Use {@code LATEST} to request the new renderer. No action is necessary if you prefer to use the legacy renderer.</li>
|
||||
* <li>The latest renderer may not always be returned due to various reasons, including not enough memory, unsupported Android version, or routine downtime.</li>
|
||||
* <li>The new renderer will eventually become the default renderer through a progressive rollout. At that time, you will need to request {@code LEGACY} in
|
||||
* order to continue using the legacy renderer.</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param context Required to fetch the necessary SDK resources and code. Must not be {@code null}.
|
||||
* @param preferredRenderer Which {@link MapsInitializer.Renderer} type you prefer to use for your application.
|
||||
* If {@code null} is provided, the default preference is taken.
|
||||
* @param callback The callback that the Maps SDK triggers when it informs you about which renderer type was actually loaded.
|
||||
* You can define what you want to do differently according to the maps renderer that is loaded.
|
||||
* @return A ConnectionResult error code.
|
||||
*/
|
||||
public static synchronized int initialize(@NonNull Context context, @Nullable MapsInitializer.Renderer preferredRenderer, @Nullable OnMapsSdkInitializedCallback callback) {
|
||||
Log.d(TAG, "preferredRenderer: " + preferredRenderer);
|
||||
if (initialized) {
|
||||
if (callback != null) {
|
||||
callback.onMapsSdkInitialized(renderer);
|
||||
}
|
||||
return CommonStatusCodes.SUCCESS;
|
||||
}
|
||||
try {
|
||||
ICreator creator = MapsContextLoader.getCreator(context, preferredRenderer);
|
||||
try {
|
||||
CameraUpdateFactory.setDelegate(creator.newCameraUpdateFactoryDelegate());
|
||||
BitmapDescriptorFactory.setDelegate(creator.newBitmapDescriptorFactoryDelegate());
|
||||
int preferredRendererInt = 0;
|
||||
if (preferredRenderer != null) {
|
||||
if (preferredRenderer == Renderer.LEGACY) preferredRendererInt = 1;
|
||||
else if (preferredRenderer == Renderer.LATEST) preferredRendererInt = 2;
|
||||
}
|
||||
try {
|
||||
if (creator.getRendererType() == 2) {
|
||||
renderer = Renderer.LATEST;
|
||||
}
|
||||
creator.logInitialization(ObjectWrapper.wrap(context), preferredRendererInt);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "Failed to retrieve renderer type or log initialization.", e);
|
||||
}
|
||||
Log.d(TAG, "loadedRenderer: " + renderer);
|
||||
if (callback != null) {
|
||||
callback.onMapsSdkInitialized(renderer);
|
||||
}
|
||||
return CommonStatusCodes.SUCCESS;
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return CommonStatusCodes.INTERNAL_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables you to specify which {@link MapsInitializer.Renderer} you prefer to use for your application {@code LATEST} or {@code LEGACY}.
|
||||
* It also informs you which maps {@link MapsInitializer.Renderer} is actually used for your application.
|
||||
*/
|
||||
public enum Renderer {
|
||||
LEGACY, LATEST
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewTreeObserver;
|
||||
import com.google.android.gms.maps.model.LatLngBounds;
|
||||
|
||||
/**
|
||||
* Callback interface for when the map is ready to be used.
|
||||
* <p>
|
||||
* Once an instance of this interface is set on a {@link MapFragment} or {@link MapView} object, the {@link #onMapReady(GoogleMap)} method is triggered when
|
||||
* the map is ready to be used and provides a non-null instance of {@link GoogleMap}.
|
||||
* <p>
|
||||
* If required services are not installed on the device, the user will be prompted to install it, and the {@link #onMapReady(GoogleMap)} method will only be
|
||||
* triggered when the user has installed it and returned to the app.
|
||||
*/
|
||||
public interface OnMapReadyCallback {
|
||||
/**
|
||||
* Called when the map is ready to be used.
|
||||
* <p>
|
||||
* Note that this does not guarantee that the map has undergone layout. Therefore, the map's size may not have been determined by the time the callback
|
||||
* method is called. If you need to know the dimensions or call a method in the API that needs to know the dimensions, get the map's {@link View} and
|
||||
* register an {@link ViewTreeObserver.OnGlobalLayoutListener} as well.
|
||||
* <p>
|
||||
* Do not chain the {@code OnMapReadyCallback} and {@code OnGlobalLayoutListener} listeners, but instead register and wait for both callbacks independently,
|
||||
* since the callbacks can be fired in any order.
|
||||
* <p>
|
||||
* As an example, if you want to update the map's camera using a {@link LatLngBounds} without dimensions, you should wait until both
|
||||
* {@code OnMapReadyCallback} and {@code OnGlobalLayoutListener} have completed. Otherwise there is a race condition that could trigger an
|
||||
* {@link IllegalStateException}.
|
||||
*
|
||||
* @param googleMap A non-null instance of a GoogleMap associated with the {@link MapFragment} or {@link MapView} that defines the callback.
|
||||
*/
|
||||
void onMapReady(GoogleMap googleMap);
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps;
|
||||
|
||||
/**
|
||||
* Callback interface used by the Maps SDK to inform you which maps {@link MapsInitializer.Renderer} type has been loaded for your application.
|
||||
*/
|
||||
public interface OnMapsSdkInitializedCallback {
|
||||
/**
|
||||
* The Maps SDK calls this method to inform you which maps {@link MapsInitializer.Renderer} has been loaded for your application.
|
||||
* <p>
|
||||
* You can implement this method to define configurations or operations that are specific to each {@link MapsInitializer.Renderer} type.
|
||||
*
|
||||
* @param renderer The actual maps {@link MapsInitializer.Renderer} the maps SDK has loaded for your application.
|
||||
*/
|
||||
void onMapsSdkInitialized(MapsInitializer.Renderer renderer);
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps;
|
||||
|
||||
/**
|
||||
* Callback interface for when the Street View panorama is ready to be used.
|
||||
* <p>
|
||||
* Once an instance of this interface is set on a {@link StreetViewPanoramaFragment} or {@link StreetViewPanoramaView} object, the
|
||||
* {@link #onStreetViewPanoramaReady(StreetViewPanorama)} method is triggered when the panorama is ready to be used and provides a non-null
|
||||
* instance of {@link StreetViewPanorama}.
|
||||
* <p>
|
||||
* If Google Play services is not installed on the device, the user is prompted to install it, and the
|
||||
* {@link #onStreetViewPanoramaReady(StreetViewPanorama)} method will only be triggered when the user has installed it and returned to the app.
|
||||
*/
|
||||
public interface OnStreetViewPanoramaReadyCallback {
|
||||
/**
|
||||
* Called when the Street View panorama is ready to be used.
|
||||
*
|
||||
* @param panorama A non-null instance of a StreetViewPanorama associated with the {@link StreetViewPanoramaFragment} or {@link StreetViewPanoramaView} that
|
||||
* defines the callback.
|
||||
*/
|
||||
void onStreetViewPanoramaReady(StreetViewPanorama panorama);
|
||||
}
|
||||
|
|
@ -0,0 +1,421 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps;
|
||||
|
||||
import android.graphics.Point;
|
||||
import android.os.RemoteException;
|
||||
import android.view.View;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
import com.google.android.gms.dynamic.ObjectWrapper;
|
||||
import com.google.android.gms.maps.internal.*;
|
||||
import com.google.android.gms.maps.model.*;
|
||||
import org.microg.gms.common.Hide;
|
||||
|
||||
/**
|
||||
* This is the main class of the Street View feature in the Google Maps SDK for Android and is the entry point for all methods related to Street
|
||||
* View panoramas. You cannot instantiate a {@link StreetViewPanorama} object directly, rather, you must obtain one from the
|
||||
* {@code #getStreetViewPanoramaAsync()} method on a {@link StreetViewPanoramaFragment} or {@link StreetViewPanoramaView} that you have added to
|
||||
* your application.
|
||||
* <p>
|
||||
* Note: Similar to a {@link View} object, a {@link StreetViewPanorama} can only be read and modified from the main thread. Calling
|
||||
* {@link StreetViewPanorama} methods from another thread will result in an exception.
|
||||
*/
|
||||
public class StreetViewPanorama {
|
||||
private final IStreetViewPanoramaDelegate delegate;
|
||||
|
||||
@Hide
|
||||
public StreetViewPanorama(@NonNull IStreetViewPanoramaDelegate delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
private IStreetViewPanoramaDelegate getDelegate() {
|
||||
return delegate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the current camera position, orientation and zoom, to a given position over a specified duration
|
||||
*
|
||||
* @param camera The camera position to animate to. Must not be {@code null}.
|
||||
* @param duration The length of time, in milliseconds, it takes to transition from the current camera position to the given one
|
||||
*/
|
||||
public void animateTo(@NonNull StreetViewPanoramaCamera camera, long duration) {
|
||||
try {
|
||||
getDelegate().animateTo(camera, duration);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current location of the user and information regarding the current panorama's adjacent panoramas
|
||||
*
|
||||
* @return The current location of the user
|
||||
*/
|
||||
@NonNull
|
||||
public StreetViewPanoramaLocation getLocation() {
|
||||
try {
|
||||
return getDelegate().getStreetViewPanoramaLocation();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current orientation and zoom
|
||||
*
|
||||
* @return The current camera
|
||||
*/
|
||||
@NonNull
|
||||
public StreetViewPanoramaCamera getPanoramaCamera() {
|
||||
try {
|
||||
return getDelegate().getPanoramaCamera();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not the panning gestures are enabled for the user
|
||||
*
|
||||
* @return {@code true} if panning gestures are enabled
|
||||
*/
|
||||
public boolean isPanningGesturesEnabled() {
|
||||
try {
|
||||
return getDelegate().isPanningGesturesEnabled();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not the street names appear on the panorama
|
||||
*
|
||||
* @return {@code true} if street names are shown
|
||||
*/
|
||||
public boolean isStreetNamesEnabled() {
|
||||
try {
|
||||
return getDelegate().isStreetNamesEnabled();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not the zoom gestures are enabled for the user
|
||||
*
|
||||
* @return {@code true} if zoom gestures are enabled
|
||||
*/
|
||||
public boolean isUserNavigationEnabled() {
|
||||
try {
|
||||
return getDelegate().isUserNavigationEnabled();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not the zoom gestures are enabled for the user
|
||||
*
|
||||
* @return {@code true} if zoom gestures are enabled
|
||||
*/
|
||||
public boolean isZoomGesturesEnabled() {
|
||||
try {
|
||||
return getDelegate().isZoomGesturesEnabled();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a screen location that corresponds to an orientation ({@link StreetViewPanoramaOrientation}). The screen location is in screen pixels
|
||||
* (not display pixels) relative to the top left of the Street View panorama (not of the whole screen).
|
||||
*
|
||||
* @param orientation A {@link StreetViewPanoramaOrientation} on the Street View panorama to convert to a screen location.
|
||||
* @return A {@link Point} representing the screen location in screen pixels. Returns {@code null} if the orientation is unable to be projected on the screen
|
||||
* (e.g. behind the user's field of view)
|
||||
*/
|
||||
public Point orientationToPoint(StreetViewPanoramaOrientation orientation) {
|
||||
try {
|
||||
IObjectWrapper orientationToPoint = getDelegate().orientationToPoint(orientation);
|
||||
if (orientationToPoint == null) {
|
||||
return null;
|
||||
}
|
||||
return (Point) ObjectWrapper.unwrap(orientationToPoint);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the orientation that corresponds to a screen location. The screen location is specified in screen pixels (not display pixels) relative to
|
||||
* the top left of the Street View panorama (not the top left of the whole screen).
|
||||
*
|
||||
* @param point A {@link Point} on the screen in screen pixels.
|
||||
* @return The {@link StreetViewPanoramaOrientation} corresponding to the point on the screen, or {@code null} if the Street View panorama has not
|
||||
* been initialized or if the given point is not a valid point on the screen
|
||||
*/
|
||||
public StreetViewPanoramaOrientation pointToOrientation(Point point) {
|
||||
try {
|
||||
return getDelegate().pointToOrientation(ObjectWrapper.wrap(point));
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a callback that's invoked when the camera changes
|
||||
*
|
||||
* @param listener The callback that's invoked when the camera changes. To unset the callback, use {@code null}.
|
||||
*/
|
||||
public final void setOnStreetViewPanoramaCameraChangeListener(OnStreetViewPanoramaCameraChangeListener listener) {
|
||||
try {
|
||||
getDelegate().setOnStreetViewPanoramaCameraChangeListener(new IOnStreetViewPanoramaCameraChangeListener.Stub() {
|
||||
@Override
|
||||
public void onStreetViewPanoramaCameraChange(StreetViewPanoramaCamera camera) throws RemoteException {
|
||||
listener.onStreetViewPanoramaCameraChange(camera);
|
||||
}
|
||||
});
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a callback that's invoked when the panorama changes
|
||||
*
|
||||
* @param listener The callback that's invoked when the panorama changes. To unset the callback, use {@code null}.
|
||||
*/
|
||||
public final void setOnStreetViewPanoramaChangeListener(OnStreetViewPanoramaChangeListener listener) {
|
||||
try {
|
||||
getDelegate().setOnStreetViewPanoramaChangeListener(new IOnStreetViewPanoramaChangeListener.Stub() {
|
||||
@Override
|
||||
public void onStreetViewPanoramaChange(StreetViewPanoramaLocation location) throws RemoteException {
|
||||
listener.onStreetViewPanoramaChange(location);
|
||||
}
|
||||
});
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a callback that's invoked when the panorama is tapped.
|
||||
*
|
||||
* @param listener The callback that's invoked when the panorama is tapped. To unset the callback, use {@code null}.
|
||||
*/
|
||||
public final void setOnStreetViewPanoramaClickListener(OnStreetViewPanoramaClickListener listener) {
|
||||
try {
|
||||
getDelegate().setOnStreetViewPanoramaClickListener(new IOnStreetViewPanoramaClickListener.Stub() {
|
||||
@Override
|
||||
public void onStreetViewPanoramaClick(StreetViewPanoramaOrientation orientation) throws RemoteException {
|
||||
listener.onStreetViewPanoramaClick(orientation);
|
||||
}
|
||||
});
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a callback that's invoked when the panorama is long-pressed.
|
||||
*
|
||||
* @param listener The callback that's invoked when the panorama is long-pressed. To unset the callback, use {@code null}.
|
||||
*/
|
||||
public final void setOnStreetViewPanoramaLongClickListener(OnStreetViewPanoramaLongClickListener listener) {
|
||||
try {
|
||||
getDelegate().setOnStreetViewPanoramaLongClickListener(new IOnStreetViewPanoramaLongClickListener.Stub() {
|
||||
@Override
|
||||
public void onStreetViewPanoramaLongClick(StreetViewPanoramaOrientation orientation) throws RemoteException {
|
||||
listener.onStreetViewPanoramaLongClick(orientation);
|
||||
}
|
||||
});
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the user is able to use panning gestures
|
||||
*
|
||||
* @param enablePanning {@code true} if users are allowed to use panning gestures
|
||||
*/
|
||||
public void setPanningGesturesEnabled(boolean enablePanning) {
|
||||
try {
|
||||
getDelegate().enablePanning(enablePanning);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the StreetViewPanorama to a given location
|
||||
*
|
||||
* @param position Latitude and longitude of the desired location. Must not be {@code null}.
|
||||
* @param source StreetViewSource specifies the source of panoramas to search. If source is {@code null}, use the default.
|
||||
*/
|
||||
public void setPosition(LatLng position, StreetViewSource source) {
|
||||
try {
|
||||
getDelegate().setPositionWithSource(position, source);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the StreetViewPanorama to a given location
|
||||
*
|
||||
* @param position Latitude and longitude of the desired location. Should not be {@code null}.
|
||||
*/
|
||||
public void setPosition(LatLng position) {
|
||||
try {
|
||||
getDelegate().setPosition(position);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the StreetViewPanorama to a given location
|
||||
*
|
||||
* @param position Latitude and longitude of the desired location. Must not be {@code null}.
|
||||
* @param radius Radius, specified in meters, that defines the area in which to search for a panorama, centered on the given latitude and longitude
|
||||
*/
|
||||
public void setPosition(LatLng position, int radius) {
|
||||
try {
|
||||
getDelegate().setPositionWithRadius(position, radius);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the StreetViewPanorama to a given location
|
||||
*
|
||||
* @param position Latitude and longitude of the desired location. Must not be {@code null}.
|
||||
* @param radius Radius, specified in meters, that defines the area in which to search for a panorama, centered on the given latitude and longitude
|
||||
* @param source StreetViewSource specifies the source of panoramas to search. If source is {@code null}, use the default.
|
||||
*/
|
||||
public void setPosition(LatLng position, int radius, StreetViewSource source) {
|
||||
try {
|
||||
getDelegate().setPositionWithRadiusAndSource(position, radius, source);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the StreetViewPanorama to a given location
|
||||
*
|
||||
* @param panoId Panorama ID of the desired location. Must not be {@code null}.
|
||||
*/
|
||||
public void setPosition(String panoId) {
|
||||
try {
|
||||
getDelegate().setPositionWithID(panoId);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the user is able to see street names on panoramas
|
||||
*
|
||||
* @param enableStreetNames {@code true} if users are able to see street names on panoramas
|
||||
*/
|
||||
public void setStreetNamesEnabled(boolean enableStreetNames) {
|
||||
try {
|
||||
getDelegate().enableStreetNames(enableStreetNames);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the user is able to move to another panorama
|
||||
*
|
||||
* @param enableUserNavigation {@code true} if users are allowed to move to another panorama
|
||||
*/
|
||||
public void setUserNavigationEnabled(boolean enableUserNavigation) {
|
||||
try {
|
||||
getDelegate().enableUserNavigation(enableUserNavigation);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the user is able to use zoom gestures
|
||||
*
|
||||
* @param enableZoom {@code true} if users are allowed to use zoom gestures
|
||||
*/
|
||||
public void setZoomGesturesEnabled(boolean enableZoom) {
|
||||
try {
|
||||
getDelegate().enableZoom(enableZoom);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A listener for when the StreetViewPanoramaCamera changes
|
||||
*/
|
||||
public interface OnStreetViewPanoramaCameraChangeListener {
|
||||
/**
|
||||
* Called when the user makes changes to the camera on the panorama or if the camera is changed programmatically. Implementations of this
|
||||
* method are always invoked on the main thread.
|
||||
*
|
||||
* @param camera The position the camera has changed to
|
||||
*/
|
||||
void onStreetViewPanoramaCameraChange(StreetViewPanoramaCamera camera);
|
||||
}
|
||||
|
||||
/**
|
||||
* A listener for when the Street View panorama loads a new panorama
|
||||
*/
|
||||
public interface OnStreetViewPanoramaChangeListener {
|
||||
/**
|
||||
* The StreetViewPanorama performs an animated transition from one location to another when the user performs a manual navigation action. This callback is called when the transition animation has occurred and the rendering of the first panorama has occurred. This callback also occurs when the developer sets a position and the rendering of the first panorama has occurred. It is possible that not all the panoramas have loaded when this callback is activated. Implementations of this method are always invoked on the main thread.
|
||||
*
|
||||
* @param location Location the StreetViewPanorama is changed to. null if it is an invalid panorama
|
||||
*/
|
||||
void onStreetViewPanoramaChange(StreetViewPanoramaLocation location);
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback interface for when the user taps on the panorama.
|
||||
* <p>
|
||||
* Listeners will be invoked on the main thread
|
||||
*/
|
||||
public interface OnStreetViewPanoramaClickListener {
|
||||
/**
|
||||
* Called when the user makes a tap gesture on the panorama, but only if none of the overlays of the panorama handled the gesture.
|
||||
* Implementations of this method are always invoked on the main thread.
|
||||
*
|
||||
* @param orientation The tilt and bearing values corresponding to the point on the screen where the user tapped. These values have an absolute value within a
|
||||
* specific panorama, and are independent of the current orientation of the camera.
|
||||
*/
|
||||
void onStreetViewPanoramaClick(StreetViewPanoramaOrientation orientation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback interface for when the user long presses on the panorama.
|
||||
* <p>
|
||||
* Listeners will be invoked on the main thread
|
||||
*/
|
||||
public interface OnStreetViewPanoramaLongClickListener {
|
||||
/**
|
||||
* Called when the user makes a long-press gesture on the panorama, but only if none of the overlays of the panorama handled the gesture.
|
||||
* Implementations of this method are always invoked on the main thread.
|
||||
*
|
||||
* @param orientation The tilt and bearing values corresponding to the point on the screen where the user long-pressed. These values have an absolute value within a
|
||||
* specific panorama, and are independent of the current orientation of the camera.
|
||||
*/
|
||||
void onStreetViewPanoramaLongClick(StreetViewPanoramaOrientation orientation);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps;
|
||||
|
||||
import android.app.Fragment;
|
||||
|
||||
public class StreetViewPanoramaFragment extends Fragment {
|
||||
}
|
||||
|
|
@ -0,0 +1,308 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Parcel;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.android.gms.maps.model.StreetViewPanoramaCamera;
|
||||
import com.google.android.gms.maps.model.StreetViewSource;
|
||||
import org.microg.gms.utils.ToStringHelper;
|
||||
|
||||
/**
|
||||
* Defines configuration PanoramaOptions for a {@link StreetViewPanorama}. These options can be used when adding a panorama to your
|
||||
* application programmatically. If you are using a {@link StreetViewPanoramaFragment}, you can pass these options in using the static factory
|
||||
* method {@link StreetViewPanoramaFragment#newInstance(StreetViewPanoramaOptions)}. If you are using a {@link StreetViewPanoramaView},
|
||||
* you can pass these options in using the constructor {@link StreetViewPanoramaView#StreetViewPanoramaView(Context, StreetViewPanoramaOptions)}.
|
||||
*/
|
||||
@SafeParcelable.Class
|
||||
public class StreetViewPanoramaOptions extends AbstractSafeParcelable {
|
||||
@Nullable
|
||||
@Field(value = 2, getterName = "getStreetViewPanoramaCamera")
|
||||
private StreetViewPanoramaCamera panoramaCamera;
|
||||
@Nullable
|
||||
@Field(value = 3, getterName = "getPanoramaId")
|
||||
private String panoramaId;
|
||||
@Nullable
|
||||
@Field(value = 4, getterName = "getPosition")
|
||||
private LatLng position;
|
||||
@Nullable
|
||||
@Field(value = 5, getterName = "getRadius")
|
||||
private Integer radius;
|
||||
@Nullable
|
||||
@Field(value = 6, getterName = "getUserNavigationEnabled")
|
||||
private Boolean userNavigationEnabled = true;
|
||||
@Nullable
|
||||
@Field(value = 7, getterName = "getZoomGesturesEnabled")
|
||||
private Boolean zoomGesturesEnabled = true;
|
||||
@Nullable
|
||||
@Field(value = 8, getterName = "getPanningGesturesEnabled")
|
||||
private Boolean panningGesturesEnabled = true;
|
||||
@Nullable
|
||||
@Field(value = 9, getterName = "getStreetNamesEnabled")
|
||||
private Boolean streetNamesEnabled = true;
|
||||
@Nullable
|
||||
@Field(value = 10, getterName = "getUseViewLifecycleInFragment")
|
||||
private Boolean useViewLifecycleInFragment = false;
|
||||
@Field(value = 11, getterName = "getSource")
|
||||
private StreetViewSource source = StreetViewSource.DEFAULT;
|
||||
|
||||
/**
|
||||
* Creates a new StreetViewPanoramaOptions object.
|
||||
*/
|
||||
public StreetViewPanoramaOptions() {
|
||||
}
|
||||
|
||||
@Constructor
|
||||
StreetViewPanoramaOptions(@Nullable @Param(2) StreetViewPanoramaCamera panoramaCamera, @Nullable @Param(3) String panoramaId, @Nullable @Param(4) LatLng position, @Nullable @Param(5) Integer radius, @Nullable @Param(6) Boolean userNavigationEnabled, @Nullable @Param(7) Boolean zoomGesturesEnabled, @Nullable @Param(8) Boolean panningGesturesEnabled, @Nullable @Param(9) Boolean streetNamesEnabled, @Nullable @Param(10) Boolean useViewLifecycleInFragment, @Param(11) StreetViewSource source) {
|
||||
this.panoramaCamera = panoramaCamera;
|
||||
this.panoramaId = panoramaId;
|
||||
this.position = position;
|
||||
this.radius = radius;
|
||||
this.userNavigationEnabled = userNavigationEnabled;
|
||||
this.zoomGesturesEnabled = zoomGesturesEnabled;
|
||||
this.panningGesturesEnabled = panningGesturesEnabled;
|
||||
this.streetNamesEnabled = streetNamesEnabled;
|
||||
this.useViewLifecycleInFragment = useViewLifecycleInFragment;
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@code true} if users are initially able to pan via gestures on Street View panoramas.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getPanningGesturesEnabled() {
|
||||
return panningGesturesEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the initial panorama ID for the Street View panorama, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public String getPanoramaId() {
|
||||
return panoramaId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the initial position for the Street View panorama, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public LatLng getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the initial radius used to search for a Street View panorama, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public Integer getRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the source filter used to search for a Street View panorama, or {@link StreetViewSource#DEFAULT} if unspecified.
|
||||
*/
|
||||
@NonNull
|
||||
public StreetViewSource getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@code true} if users are initially able to see street names on Street View panoramas.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getStreetNamesEnabled() {
|
||||
return streetNamesEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the initial camera for the Street View panorama, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public StreetViewPanoramaCamera getStreetViewPanoramaCamera() {
|
||||
return panoramaCamera;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the useViewLifecycleInFragment option, or {@code null} if unspecified.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getUseViewLifecycleInFragment() {
|
||||
return useViewLifecycleInFragment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@code true} if users are initially able to move to different Street View panoramas.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getUserNavigationEnabled() {
|
||||
return userNavigationEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@code true} if users are initially able to zoom via gestures on Street View panoramas.
|
||||
*/
|
||||
@Nullable
|
||||
public Boolean getZoomGesturesEnabled() {
|
||||
return zoomGesturesEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the ability for users to use pan around on panoramas using gestures. See
|
||||
* {@link StreetViewPanorama#setPanningGesturesEnabled(boolean)} for more details. The default is {@code true}
|
||||
*/
|
||||
@NonNull
|
||||
public StreetViewPanoramaOptions panningGesturesEnabled(boolean enabled) {
|
||||
this.panningGesturesEnabled = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the initial camera for the Street View panorama.
|
||||
*/
|
||||
@NonNull
|
||||
public StreetViewPanoramaOptions panoramaCamera(StreetViewPanoramaCamera camera) {
|
||||
this.panoramaCamera = camera;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the initial position for the Street View panorama based on a panorama id. The position set by the panoramaID takes precedence
|
||||
* over a position set by a LatLng.
|
||||
*/
|
||||
@NonNull
|
||||
public StreetViewPanoramaOptions panoramaId(String panoId) {
|
||||
panoramaId = panoId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the initial position for the Street View panorama based upon location. The position set by the panoramaID, if set, takes precedence
|
||||
* over a position set by a LatLng.
|
||||
*/
|
||||
@NonNull
|
||||
public StreetViewPanoramaOptions position(LatLng position) {
|
||||
this.position = position;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the initial position for the Street View panorama based upon location, radius and source. The position set by the panoramaID, if
|
||||
* set, takes precedence over a position set by a LatLng.
|
||||
*/
|
||||
@NonNull
|
||||
public StreetViewPanoramaOptions position(LatLng position, Integer radius, StreetViewSource source) {
|
||||
this.position = position;
|
||||
this.radius = radius;
|
||||
this.source = source;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the initial position for the Street View panorama based upon location and radius. The position set by the panoramaID, if set, takes
|
||||
* precedence over a position set by a LatLng.
|
||||
*/
|
||||
@NonNull
|
||||
public StreetViewPanoramaOptions position(LatLng position, Integer radius) {
|
||||
this.position = position;
|
||||
this.radius = radius;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the initial position for the Street View panorama based upon location and source. The position set by the panoramaID, if set, takes
|
||||
* precedence over a position set by a LatLng.
|
||||
*/
|
||||
@NonNull
|
||||
public StreetViewPanoramaOptions position(LatLng position, StreetViewSource source) {
|
||||
this.position = position;
|
||||
this.source = source;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the ability for users to see street names on panoramas. See {@link StreetViewPanorama#setStreetNamesEnabled(boolean)} for more
|
||||
* details. The default is {@code true}
|
||||
*/
|
||||
@NonNull
|
||||
public StreetViewPanoramaOptions streetNamesEnabled(boolean enabled) {
|
||||
this.streetNamesEnabled = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return ToStringHelper.name("StreetViewPanoramaOptions")
|
||||
.field("PanoramaId", panoramaId)
|
||||
.field("Position", position)
|
||||
.field("Radius", radius)
|
||||
.field("Source", source)
|
||||
.field("StreetViewPanoramaCamera", panoramaCamera)
|
||||
.field("UserNavigationEnabled", userNavigationEnabled)
|
||||
.field("ZoomGesturesEnabled", zoomGesturesEnabled)
|
||||
.field("PanningGesturesEnabled", panningGesturesEnabled)
|
||||
.field("StreetNamesEnabled", streetNamesEnabled)
|
||||
.field("UseViewLifecycleInFragment", useViewLifecycleInFragment)
|
||||
.end();
|
||||
}
|
||||
|
||||
/**
|
||||
* When using a {@link StreetViewPanoramaFragment}, this flag specifies whether the lifecycle of the Street View panorama should be tied to the
|
||||
* fragment's view or the fragment itself. The default value is {@code false}, tying the lifecycle of the Street View panorama to the fragment.
|
||||
* <p>
|
||||
* Using the lifecycle of the fragment allows faster rendering of the Street View panorama when the fragment is detached and reattached,
|
||||
* because the underlying GL context is preserved. This has the cost that detaching the fragment, but not destroying it, will not release memory
|
||||
* used by the panorama.
|
||||
* <p>
|
||||
* Using the lifecycle of a fragment's view means that a Street View panorama is not reused when the fragment is detached and reattached.
|
||||
* This will cause the map to re-render from scratch, which can take a few seconds. It also means that while a fragment is detached, and
|
||||
* therefore has no view, all {@link StreetViewPanorama} methods will throw {@link NullPointerException}.
|
||||
*/
|
||||
@NonNull
|
||||
public StreetViewPanoramaOptions useViewLifecycleInFragment(boolean useViewLifecycleInFragment) {
|
||||
this.useViewLifecycleInFragment = useViewLifecycleInFragment;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the ability for users to move between panoramas. See {@link StreetViewPanorama#setUserNavigationEnabled(boolean)} for more
|
||||
* details. The default is {@code true}
|
||||
*/
|
||||
@NonNull
|
||||
public StreetViewPanoramaOptions userNavigationEnabled(boolean enabled) {
|
||||
this.userNavigationEnabled = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
||||
CREATOR.writeToParcel(this, dest, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the ability for users to zoom on panoramas using gestures. See {@link StreetViewPanorama#setZoomGesturesEnabled(boolean)} for
|
||||
* more details. The default is {@code true}
|
||||
*/
|
||||
@NonNull
|
||||
public StreetViewPanoramaOptions zoomGesturesEnabled(boolean enabled) {
|
||||
this.zoomGesturesEnabled = enabled;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static final SafeParcelableCreatorAndWriter<StreetViewPanoramaOptions> CREATOR = findCreator(StreetViewPanoramaOptions.class);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.FrameLayout;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import org.microg.gms.maps.StreetViewPanoramaViewLifecycleHelper;
|
||||
|
||||
/**
|
||||
* A View which displays a Street View panorama (with data obtained from the Google Maps service). When focused, it captures keypresses
|
||||
* and touch gestures to move the panorama.
|
||||
* <p>
|
||||
* Users of this class must forward all the life cycle methods from the {@link Activity} or {@link Fragment} containing this view to the corresponding ones
|
||||
* in this class.
|
||||
* <p>
|
||||
* A StreetViewPanorama must be acquired using {@link #getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback)}. The
|
||||
* {@link StreetViewPanoramaView} automatically initializes the Street View system and the view.
|
||||
*/
|
||||
public class StreetViewPanoramaView extends FrameLayout {
|
||||
private final StreetViewPanoramaViewLifecycleHelper helper;
|
||||
|
||||
public StreetViewPanoramaView(@NonNull Context context) {
|
||||
super(context);
|
||||
this.helper = new StreetViewPanoramaViewLifecycleHelper(this, context, null);
|
||||
}
|
||||
|
||||
public StreetViewPanoramaView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
this.helper = new StreetViewPanoramaViewLifecycleHelper(this, context, null);
|
||||
}
|
||||
|
||||
public StreetViewPanoramaView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
this.helper = new StreetViewPanoramaViewLifecycleHelper(this, context, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context The context that will show the view. Must not be {@code null}.
|
||||
* @param options Configuration options for the new view. The view will be configured with default values if {@code options} is {@code null} or any option field is left {@code null}.
|
||||
*/
|
||||
public StreetViewPanoramaView(@NonNull Context context, StreetViewPanoramaOptions options) {
|
||||
super(context);
|
||||
this.helper = new StreetViewPanoramaViewLifecycleHelper(this, context, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a callback object which will be triggered when the {@link StreetViewPanorama} instance is ready to be used.
|
||||
*
|
||||
* @param callback The callback object that will be triggered when the panorama is ready to be used. Must not be {@code null}.
|
||||
*/
|
||||
public void getStreetViewPanoramaAsync(OnStreetViewPanoramaReadyCallback callback) {
|
||||
helper.getStreetViewPanoramaAsync(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
*/
|
||||
public final void onCreate(Bundle savedInstanceState) {
|
||||
helper.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
*/
|
||||
public void onDestroy() {
|
||||
helper.onDestroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
*/
|
||||
public final void onLowMemory() {
|
||||
helper.onLowMemory();
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
*/
|
||||
public final void onPause() {
|
||||
helper.onPause();
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
*/
|
||||
public void onResume() {
|
||||
helper.onResume();
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
*/
|
||||
public final void onSaveInstanceState(Bundle outState) {
|
||||
helper.onSaveInstanceState(outState);
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
*/
|
||||
public void onStart() {
|
||||
helper.onStart();
|
||||
}
|
||||
|
||||
/**
|
||||
* You must call this method from the parent Activity/Fragment's corresponding method.
|
||||
*/
|
||||
public void onStop() {
|
||||
helper.onStop();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (C) 2013-2017 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.model;
|
||||
|
||||
import com.google.android.gms.dynamic.IObjectWrapper;
|
||||
|
||||
import org.microg.gms.common.PublicApi;
|
||||
|
||||
/**
|
||||
* Defines an image. For a marker, it can be used to set the image of the marker icon. For a ground
|
||||
* overlay, it can be used to set the image to place on the surface of the earth.
|
||||
*/
|
||||
@PublicApi
|
||||
public class BitmapDescriptor {
|
||||
private final IObjectWrapper remoteObject;
|
||||
|
||||
public BitmapDescriptor(IObjectWrapper remoteObject) {
|
||||
this.remoteObject = remoteObject;
|
||||
}
|
||||
|
||||
public IObjectWrapper getRemoteObject() {
|
||||
return remoteObject;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.model;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import com.google.android.gms.maps.CameraUpdateFactory;
|
||||
import com.google.android.gms.maps.internal.ICameraUpdateFactoryDelegate;
|
||||
import com.google.android.gms.maps.model.internal.IBitmapDescriptorFactoryDelegate;
|
||||
import org.microg.gms.common.Hide;
|
||||
|
||||
public class BitmapDescriptorFactory {
|
||||
private static IBitmapDescriptorFactoryDelegate delegate;
|
||||
@Hide
|
||||
public static void setDelegate(@NonNull IBitmapDescriptorFactoryDelegate delegate) {
|
||||
BitmapDescriptorFactory.delegate = delegate;
|
||||
}
|
||||
private static IBitmapDescriptorFactoryDelegate getDelegate() {
|
||||
if (delegate == null) throw new IllegalStateException("CameraUpdateFactory is not initialized");
|
||||
return delegate;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.model;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* Cap that is squared off exactly at the start or end vertex of a {@link Polyline} with solid stroke pattern, equivalent to having no
|
||||
* additional cap beyond the start or end vertex. This is the default cap type at start and end vertices of {@link Polyline}s with
|
||||
* solid stroke pattern.
|
||||
*/
|
||||
public class ButtCap extends Cap {
|
||||
/**
|
||||
* Constructs a {@code ButtCap}.
|
||||
*/
|
||||
public ButtCap() {
|
||||
super(0, null, null);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "[ButtCap]";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,249 @@
|
|||
/*
|
||||
* Copyright (C) 2013-2017 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.model;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import org.microg.gms.common.PublicApi;
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
import org.microg.safeparcel.SafeParceled;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* An immutable class that aggregates all camera position parameters.
|
||||
*/
|
||||
@PublicApi
|
||||
public final class CameraPosition extends AutoSafeParcelable {
|
||||
@SafeParceled(1)
|
||||
private int versionCode = 1;
|
||||
/**
|
||||
* The location that the camera is pointing at.
|
||||
*/
|
||||
@SafeParceled(2)
|
||||
public final LatLng target;
|
||||
/**
|
||||
* Zoom level near the center of the screen.
|
||||
* See {@link Builder#zoom(float)} for the definition of the camera's zoom level.
|
||||
*/
|
||||
@SafeParceled(3)
|
||||
public final float zoom;
|
||||
/**
|
||||
* The angle, in degrees, of the camera angle from the nadir (directly facing the Earth).
|
||||
* See {@link Builder#tilt(float)} for details of restrictions on the range of values.
|
||||
*/
|
||||
@SafeParceled(4)
|
||||
public final float tilt;
|
||||
/**
|
||||
* Direction that the camera is pointing in, in degrees clockwise from north.
|
||||
*/
|
||||
@SafeParceled(5)
|
||||
public final float bearing;
|
||||
|
||||
/**
|
||||
* This constructor is dirty setting the final fields to make the compiler happy.
|
||||
* In fact, those are replaced by their real values later using SafeParcelUtil.
|
||||
*/
|
||||
private CameraPosition() {
|
||||
target = null;
|
||||
zoom = tilt = bearing = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a CameraPosition.
|
||||
*
|
||||
* @param target The target location to align with the center of the screen.
|
||||
* @param zoom Zoom level at target. See {@link #zoom} for details of restrictions.
|
||||
* @param tilt The camera angle, in degrees, from the nadir (directly down). See
|
||||
* {@link #tilt} for details of restrictions.
|
||||
* @param bearing Direction that the camera is pointing in, in degrees clockwise from north.
|
||||
* This value will be normalized to be within 0 degrees inclusive and 360
|
||||
* degrees exclusive.
|
||||
* @throws NullPointerException if {@code target} is {@code null}
|
||||
* @throws IllegalArgumentException if {@code tilt} is outside range of {@code 0} to {@code 90}
|
||||
* degrees inclusive
|
||||
*/
|
||||
public CameraPosition(LatLng target, float zoom, float tilt, float bearing)
|
||||
throws NullPointerException, IllegalArgumentException {
|
||||
if (target == null) {
|
||||
throw new NullPointerException("null camera target");
|
||||
}
|
||||
this.target = target;
|
||||
this.zoom = zoom;
|
||||
if (tilt < 0 || 90 < tilt) {
|
||||
throw new IllegalArgumentException("Tilt needs to be between 0 and 90 inclusive");
|
||||
}
|
||||
this.tilt = tilt;
|
||||
if (bearing <= 0) {
|
||||
bearing += 360;
|
||||
}
|
||||
this.bearing = bearing % 360;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a builder for a camera position.
|
||||
*/
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a builder for a camera position, initialized to a given position.
|
||||
*/
|
||||
public static Builder builder(CameraPosition camera) {
|
||||
return new Builder(camera);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a CameraPostion from the attribute set
|
||||
*
|
||||
* @throws UnsupportedOperationException
|
||||
*/
|
||||
public static CameraPosition createFromAttributes(Context context, AttributeSet attrs) {
|
||||
return null; // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (o == null || getClass() != o.getClass())
|
||||
return false;
|
||||
|
||||
CameraPosition that = (CameraPosition) o;
|
||||
|
||||
if (Float.compare(that.bearing, bearing) != 0)
|
||||
return false;
|
||||
if (Float.compare(that.tilt, tilt) != 0)
|
||||
return false;
|
||||
if (Float.compare(that.zoom, zoom) != 0)
|
||||
return false;
|
||||
if (!target.equals(that.target))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a CameraPosition pointed for a particular target and zoom level. The resultant
|
||||
* bearing is North, and the viewing angle is perpendicular to the Earth's surface. i.e.,
|
||||
* directly facing the Earth's surface, with the top of the screen pointing North.
|
||||
*
|
||||
* @param target The target location to align with the center of the screen.
|
||||
* @param zoom Zoom level at target. See {@link Builder#zoom(float)} for details on the range
|
||||
* the value will be clamped to. The larger the value the more zoomed in the
|
||||
* camera is.
|
||||
*/
|
||||
public static final CameraPosition fromLatLngZoom(LatLng target, float zoom) {
|
||||
return builder().target(target).zoom(zoom).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Arrays.hashCode(new Object[] { target, zoom, tilt, bearing });
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CameraPosition{" +
|
||||
"target=" + target +
|
||||
", zoom=" + zoom +
|
||||
", tilt=" + tilt +
|
||||
", bearing=" + bearing +
|
||||
'}';
|
||||
}
|
||||
|
||||
public static Creator<CameraPosition> CREATOR = new AutoCreator<CameraPosition>(CameraPosition.class);
|
||||
|
||||
/**
|
||||
* Builds camera position.
|
||||
*/
|
||||
public static final class Builder {
|
||||
private LatLng target;
|
||||
private float zoom;
|
||||
private float tilt;
|
||||
private float bearing;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(CameraPosition previous) {
|
||||
target = previous.target;
|
||||
zoom = previous.zoom;
|
||||
tilt = previous.tilt;
|
||||
bearing = previous.bearing;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the direction that the camera is pointing in, in degrees clockwise from north.
|
||||
*/
|
||||
public Builder bearing(float bearing) {
|
||||
this.bearing = bearing;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a {@link CameraPosition}.
|
||||
*/
|
||||
public CameraPosition build() {
|
||||
return new CameraPosition(target, zoom, tilt, bearing);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the location that the camera is pointing at.
|
||||
*/
|
||||
public Builder target(LatLng target) {
|
||||
this.target = target;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the angle, in degrees, of the camera from the nadir (directly facing the Earth).
|
||||
* When changing the camera position for a map, this value is restricted depending on the
|
||||
* zoom level of the camera. The restrictions are as follows:
|
||||
* <ul>
|
||||
* <li>For zoom levels less than 10 the maximum is 30.</li>
|
||||
* <li>For zoom levels from 10 to 14 the maximum increases linearly from 30 to 45 (e.g. at
|
||||
* zoom level 12, the maximum is 37.5).</li>
|
||||
* <li>For zoom levels from 14 to 15.5 the maximum increases linearly from 45 to 67.5.</li>
|
||||
* <li>For zoom levels greater than 15.5 the maximum is 67.5.</li>
|
||||
* </ul>
|
||||
* The minimum is always 0 (directly down). If you specify a value outside this range and try to move the camera to this camera position it will be clamped to these bounds.
|
||||
*/
|
||||
public Builder tilt(float tilt) {
|
||||
this.tilt = tilt;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the zoom level of the camera. Zoom level is defined such that at zoom level 0, the
|
||||
* whole world is approximately 256dp wide (assuming that the camera is not tilted).
|
||||
* Increasing the zoom level by 1 doubles the width of the world on the screen. Hence at
|
||||
* zoom level N, the width of the world is approximately 256 * 2 N dp, i.e., at zoom level
|
||||
* 2, the whole world is approximately 1024dp wide.
|
||||
* <p/>
|
||||
* When changing the camera position for a map, the zoom level of the camera is restricted
|
||||
* to a certain range depending on various factors including location, map type and map
|
||||
* size. Note that the camera zoom need not be an integer value.
|
||||
*/
|
||||
public Builder zoom(float zoom) {
|
||||
this.zoom = zoom;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.model;
|
||||
|
||||
import android.os.IBinder;
|
||||
|
||||
import android.os.Parcel;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Immutable cap that can be applied at the start or end vertex of a {@link Polyline}.
|
||||
*/
|
||||
public class Cap extends AutoSafeParcelable {
|
||||
@Field(2)
|
||||
public final int type;
|
||||
@Field(3)
|
||||
@Nullable
|
||||
private final IBinder bitmap;
|
||||
/**
|
||||
* Descriptor of the bitmap to be overlaid at the start or end vertex.
|
||||
*/
|
||||
@Nullable
|
||||
private final BitmapDescriptor bitmapDescriptor;
|
||||
/**
|
||||
* Reference stroke width (in pixels) - the stroke width for which the cap bitmap at its native dimension is designed.
|
||||
* The default reference stroke width is 10 pixels.
|
||||
*/
|
||||
@Field(4)
|
||||
@Nullable
|
||||
private final Float refWidth;
|
||||
|
||||
private Cap() {
|
||||
type = 0;
|
||||
bitmap = null;
|
||||
bitmapDescriptor = null;
|
||||
refWidth = 0.0f;
|
||||
}
|
||||
|
||||
protected Cap(int type, @Nullable BitmapDescriptor bitmapDescriptor, @Nullable Float refWidth) {
|
||||
this.type = type;
|
||||
this.bitmap = bitmapDescriptor == null ? null : bitmapDescriptor.getRemoteObject().asBinder();
|
||||
this.bitmapDescriptor = bitmapDescriptor;
|
||||
this.refWidth = refWidth;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "[Cap: type=" + type + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof Cap)) return false;
|
||||
|
||||
Cap cap = (Cap) o;
|
||||
|
||||
if (type != cap.type) return false;
|
||||
if (!Objects.equals(bitmapDescriptor, cap.bitmapDescriptor)) return false;
|
||||
return Objects.equals(refWidth, cap.refWidth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = type;
|
||||
result = 31 * result + (bitmapDescriptor != null ? bitmapDescriptor.hashCode() : 0);
|
||||
result = 31 * result + (refWidth != null ? refWidth.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final Creator<Cap> CREATOR = new AutoCreator<Cap>(Cap.class) {
|
||||
@Override
|
||||
public Cap createFromParcel(Parcel parcel) {
|
||||
Cap item = super.createFromParcel(parcel);
|
||||
switch (item.type) {
|
||||
case 0:
|
||||
return new ButtCap();
|
||||
case 1:
|
||||
return new SquareCap();
|
||||
case 2:
|
||||
return new RoundCap();
|
||||
case 3:
|
||||
if (item.refWidth != null) {
|
||||
return new CustomCap(item.bitmapDescriptor, item.refWidth);
|
||||
} else {
|
||||
return new CustomCap(item.bitmapDescriptor);
|
||||
}
|
||||
default:
|
||||
return item;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.model;
|
||||
|
||||
import android.os.RemoteException;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.gms.maps.model.internal.ICircleDelegate;
|
||||
import org.microg.gms.common.Hide;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A circle on the earth's surface (spherical cap).
|
||||
*/
|
||||
public class Circle {
|
||||
private final ICircleDelegate delegate;
|
||||
|
||||
@Hide
|
||||
public Circle(ICircleDelegate delegate) {
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public LatLng getCenter() {
|
||||
try {
|
||||
return this.delegate.getCenter();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public int getFillColor() {
|
||||
try {
|
||||
return this.delegate.getFillColor();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getId() {
|
||||
try {
|
||||
return this.delegate.getId();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public double getRadius() {
|
||||
try {
|
||||
return this.delegate.getRadius();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public List<PatternItem> getStrokePattern() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public int getStrokeColor() {
|
||||
try {
|
||||
return this.delegate.getStrokeColor();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public float getStrokeWidth() {
|
||||
try {
|
||||
return this.delegate.getStrokeWidth();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Object getTag() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public float getZIndex() {
|
||||
try {
|
||||
return this.delegate.getZIndex();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isClickable() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public boolean isVisible() {
|
||||
try {
|
||||
return this.delegate.isVisible();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
try {
|
||||
this.delegate.remove();
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setCenter(@NonNull LatLng center) {
|
||||
try {
|
||||
this.delegate.setCenter(center);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setClickable(boolean clickable) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void setFillColor(int color) {
|
||||
try {
|
||||
this.delegate.setFillColor(color);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setRadius(double radius) {
|
||||
try {
|
||||
this.delegate.setRadius(radius);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setStrokeColor(int color) {
|
||||
try {
|
||||
this.delegate.setStrokeColor(color);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setStrokePattern(@Nullable List<PatternItem> pattern) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void setStrokeWidth(float width) {
|
||||
try {
|
||||
this.delegate.setStrokeWidth(width);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setTag(@Nullable Object tag) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void setVisible(boolean visible) {
|
||||
try {
|
||||
this.delegate.setVisible(visible);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void setZIndex(float zIndex) {
|
||||
try {
|
||||
this.delegate.setZIndex(zIndex);
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeRemoteException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,268 @@
|
|||
/*
|
||||
* Copyright (C) 2013-2017 microG Project Team
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.model;
|
||||
|
||||
import android.graphics.Color;
|
||||
|
||||
import org.microg.gms.common.PublicApi;
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
import org.microg.safeparcel.SafeParceled;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Defines options for a Circle.
|
||||
*/
|
||||
@PublicApi
|
||||
public class CircleOptions extends AutoSafeParcelable {
|
||||
@Field(1)
|
||||
private int versionCode;
|
||||
@Field(2)
|
||||
private LatLng center;
|
||||
@Field(3)
|
||||
private double radius = 0.0d;
|
||||
@Field(4)
|
||||
private float strokeWidth = 10.0f;
|
||||
@Field(5)
|
||||
private int strokeColor = Color.BLACK;
|
||||
@Field(6)
|
||||
private int fillColor = Color.TRANSPARENT;
|
||||
@Field(7)
|
||||
private float zIndex = 0.0f;
|
||||
@Field(8)
|
||||
private boolean visible = true;
|
||||
@Field(9)
|
||||
private boolean clickable = false;
|
||||
@Field(10)
|
||||
private List<PatternItem> strokePattern = null;
|
||||
|
||||
/**
|
||||
* Creates circle options.
|
||||
*/
|
||||
public CircleOptions() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the center using a {@link LatLng}.
|
||||
* <p/>
|
||||
* The center must not be {@code null}.
|
||||
* <p/>
|
||||
* This method is mandatory because there is no default center.
|
||||
*
|
||||
* @param center The geographic center as a {@link LatLng}.
|
||||
* @return this {@link CircleOptions} object
|
||||
*/
|
||||
public CircleOptions center(LatLng center) {
|
||||
this.center = center;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the fill color.
|
||||
* <p/>
|
||||
* The fill color is the color inside the circle, in the integer format specified by
|
||||
* {@link Color}. If TRANSPARENT is used then no fill is drawn.
|
||||
* <p/>
|
||||
* By default the fill color is transparent ({@code 0x00000000}).
|
||||
*
|
||||
* @param color color in the {@link Color} format
|
||||
* @return this {@link CircleOptions} object
|
||||
*/
|
||||
public CircleOptions fillColor(int color) {
|
||||
this.fillColor = color;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the center as a {@link LatLng}.
|
||||
*
|
||||
* @return The geographic center as a {@link LatLng}.
|
||||
*/
|
||||
public LatLng getCenter() {
|
||||
return center;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the fill color.
|
||||
*
|
||||
* @return The color in the {@link Color} format.
|
||||
*/
|
||||
public int getFillColor() {
|
||||
return fillColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the circle's radius, in meters.
|
||||
*
|
||||
* @return The radius in meters.
|
||||
*/
|
||||
public double getRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the stroke color.
|
||||
*
|
||||
* @return The color in the {@link Color} format.
|
||||
*/
|
||||
public int getStrokeColor() {
|
||||
return strokeColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the stroke width.
|
||||
*
|
||||
* @return The width in screen pixels.
|
||||
*/
|
||||
public float getStrokeWidth() {
|
||||
return strokeWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the zIndex.
|
||||
*
|
||||
* @return The zIndex value.
|
||||
*/
|
||||
public float getZIndex() {
|
||||
return zIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the circle is visible.
|
||||
*
|
||||
* @return {code true} if the circle is visible; {@code false} if it is invisible.
|
||||
*/
|
||||
public boolean isVisible() {
|
||||
return visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the clickability setting for the circle.
|
||||
*
|
||||
* @return {@code true} if the circle is clickable; {@code false} if it is not.
|
||||
*/
|
||||
public boolean isClickable() {
|
||||
return clickable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the radius in meters.
|
||||
* <p/>
|
||||
* The radius must be zero or greater. The default radius is zero.
|
||||
*
|
||||
* @param radius radius in meters
|
||||
* @return this {@link CircleOptions} object
|
||||
*/
|
||||
public CircleOptions radius(double radius) {
|
||||
this.radius = radius;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the stroke color.
|
||||
* <p/>
|
||||
* The stroke color is the color of this circle's outline, in the integer format specified by
|
||||
* {@link Color}. If TRANSPARENT is used then no outline is drawn.
|
||||
* <p/>
|
||||
* By default the stroke color is black ({@code 0xff000000}).
|
||||
*
|
||||
* @param color color in the {@link Color} format
|
||||
* @return this {@link CircleOptions} object
|
||||
*/
|
||||
public CircleOptions strokeColor(int color) {
|
||||
this.strokeColor = color;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the stroke width.
|
||||
* <p/>
|
||||
* The stroke width is the width (in screen pixels) of the circle's outline. It must be zero or
|
||||
* greater. If it is zero then no outline is drawn.
|
||||
* <p/>
|
||||
* The default width is 10 pixels.
|
||||
*
|
||||
* @param width width in screen pixels
|
||||
* @return this {@link CircleOptions} object
|
||||
*/
|
||||
public CircleOptions strokeWidth(float width) {
|
||||
this.strokeWidth = width;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the visibility.
|
||||
* <p/>
|
||||
* If this circle is not visible then it is not drawn, but all other state is preserved.
|
||||
*
|
||||
* @param visible {@code false} to make this circle invisible
|
||||
* @return this {@link CircleOptions} object
|
||||
*/
|
||||
public CircleOptions visible(boolean visible) {
|
||||
this.visible = visible;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the zIndex.
|
||||
* <p/>
|
||||
* Overlays (such as circles) with higher zIndices are drawn above those with lower indices.
|
||||
* <p/>
|
||||
* By default the zIndex is {@code 0.0}.
|
||||
*
|
||||
* @param zIndex zIndex value
|
||||
* @return this {@link CircleOptions} object
|
||||
*/
|
||||
public CircleOptions zIndex(float zIndex) {
|
||||
this.zIndex = zIndex;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether this circle is clickable. The default setting is {@code false}.
|
||||
*
|
||||
* @param clickable
|
||||
* @return this {@code CircleOptions} object with a new clickability setting.
|
||||
*/
|
||||
public CircleOptions clickable(boolean clickable) {
|
||||
this.clickable = clickable;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies a stroke pattern for the circle's outline. The default stroke pattern is solid, represented by {@code null}.
|
||||
*
|
||||
* @return this {@link CircleOptions} object with a new stroke pattern set.
|
||||
*/
|
||||
public CircleOptions strokePattern(List<PatternItem> pattern) {
|
||||
this.strokePattern = pattern;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the stroke pattern set in this {@link CircleOptions} object for the circle's outline.
|
||||
*
|
||||
* @return the stroke pattern of the circle's outline.
|
||||
*/
|
||||
public List<PatternItem> getStrokePattern() {
|
||||
return strokePattern;
|
||||
}
|
||||
|
||||
public static Creator<CircleOptions> CREATOR = new AutoCreator<CircleOptions>(CircleOptions.class);
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.model;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* Bitmap overlay centered at the start or end vertex of a {@link Polyline}, orientated according to the direction of the line's first
|
||||
* or last edge and scaled with respect to the line's stroke width. {@code CustomCap} can be applied to {@link Polyline} with any stroke pattern.
|
||||
*/
|
||||
public class CustomCap extends Cap {
|
||||
@NonNull
|
||||
public final BitmapDescriptor bitmapDescriptor;
|
||||
public final Float refWidth;
|
||||
|
||||
/**
|
||||
* Constructs a new {@code CustomCap}.
|
||||
*
|
||||
* @param bitmapDescriptor Descriptor of the bitmap to be used. Must not be {@code null}.
|
||||
* @param refWidth Stroke width, in pixels, for which the cap bitmap at its native dimension is designed. Must be positive.
|
||||
*/
|
||||
public CustomCap(@NonNull BitmapDescriptor bitmapDescriptor, float refWidth) {
|
||||
super(3, bitmapDescriptor, refWidth);
|
||||
this.bitmapDescriptor = bitmapDescriptor;
|
||||
this.refWidth = refWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new {@code CustomCap} with default reference stroke width of 10 pixels (equal to the default stroke width, see
|
||||
* {@link PolylineOptions#width(float)}).
|
||||
*
|
||||
* @param bitmapDescriptor Descriptor of the bitmap to be used. Must not be {@code null}.
|
||||
*/
|
||||
public CustomCap(@NonNull BitmapDescriptor bitmapDescriptor) {
|
||||
super(3, bitmapDescriptor, null);
|
||||
this.bitmapDescriptor = bitmapDescriptor;
|
||||
this.refWidth = null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "[CustomCap bitmapDescriptor=" + bitmapDescriptor + " refWidth=" + refWidth + "]";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.maps.model;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.microg.gms.common.PublicApi;
|
||||
|
||||
/**
|
||||
* An immutable class representing a dash used in the stroke pattern for a Polyline or the outline of a Polygon or Circle.
|
||||
*/
|
||||
@PublicApi
|
||||
public final class Dash extends PatternItem {
|
||||
/**
|
||||
* Length in pixels (non-negative).
|
||||
*/
|
||||
public final float length;
|
||||
|
||||
/**
|
||||
* Constructs a {@code Dash}.
|
||||
* @param length Length in pixels. Negative value will be clamped to zero.
|
||||
*/
|
||||
public Dash(float length) {
|
||||
super(0, Math.max(length, 0));
|
||||
this.length = Math.max(length, 0);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "[Dash: length=" + length + "]";
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue