Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] clean up remaining deprecated methods for 7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasPaczos committed Dec 19, 2018
1 parent d26d2f6 commit a45aab4
Show file tree
Hide file tree
Showing 13 changed files with 170 additions and 245 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,6 @@ public static CameraUpdate newLatLngZoom(@NonNull LatLng latLng, double zoom) {
return new CameraPositionUpdate(-1, latLng, -1, zoom);
}

/**
* Returns a CameraUpdate that scrolls the camera over the map,
* shifting the center of view by the specified number of pixels in the x and y directions.
*
* @param xPixel Amount of pixels to scroll to in x direction
* @param yPixel Amount of pixels to scroll to in y direction
* @return CameraUpdate Final Camera Position
* @deprecated use {@link MapboxMap#scrollBy(float, float)} for more precise displacements when using a padded map.
*/
@Deprecated
public static CameraUpdate scrollBy(float xPixel, float yPixel) {
return new CameraMoveUpdate(xPixel, yPixel);
}

/**
* Returns a CameraUpdate that shifts the zoom level of the current camera viewpoint.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,4 @@ public interface CompassEngine {
* @return last accuracy status
*/
int getLastAccuracySensorStatus();

/**
* Lifecycle method that can be used for adding or releasing resources.
*
* @deprecated Use {@link #addCompassListener(CompassListener)}
*/
@Deprecated
void onStart();

/**
* Lifecycle method that can be used for adding or releasing resources.
*
* @deprecated Use {@link #removeCompassListener(CompassListener)}
*/
@Deprecated
void onStop();
}
Original file line number Diff line number Diff line change
Expand Up @@ -780,48 +780,6 @@ public Location getLastKnownLocation() {
return lastLocation;
}

/**
* Return the last known {@link CompassEngine} accuracy status of the location component.
* <p>
* The last known accuracy of the compass sensor, one of SensorManager.SENSOR_STATUS_*
*
* @return the last know compass accuracy bearing
* @deprecated Use {@link #getCompassEngine()}
*/
@Deprecated
public float getLastKnownCompassAccuracyStatus() {
return compassEngine != null ? compassEngine.getLastAccuracySensorStatus() : 0;
}

/**
* Add a compass listener to get heading updates every second. Once the first listener gets added,
* the sensor gets initiated and starts returning values.
*
* @param compassListener a {@link CompassListener} for listening into compass heading and
* accuracy changes
* @deprecated Use {@link #getCompassEngine()}
*/
@Deprecated
public void addCompassListener(@NonNull CompassListener compassListener) {
if (compassEngine != null) {
compassEngine.addCompassListener(compassListener);
}
}

/**
* Remove a compass listener.
*
* @param compassListener the {@link CompassListener} which you'd like to remove from the listener
* list.
* @deprecated Use {@link #getCompassEngine()}
*/
@Deprecated
public void removeCompassListener(@NonNull CompassListener compassListener) {
if (compassEngine != null) {
compassEngine.removeCompassListener(compassListener);
}
}

/**
* Adds a listener that gets invoked when the user clicks the displayed location.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,6 @@ public float getLastHeading() {
return lastHeading;
}

@Override
public void onStart() {
if (!compassListeners.isEmpty()) {
registerSensorListeners();
}
}

@Override
public void onStop() {
if (!compassListeners.isEmpty()) {
unregisterSensorListeners();
}
}

@Override
public void onSensorChanged(@NonNull SensorEvent event) {
// check when the last time the compass was updated, return if too soon.
Expand Down
Loading

0 comments on commit a45aab4

Please sign in to comment.