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

Commit

Permalink
[android] - deprecate onMapChange, provide dedicated callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun committed Oct 26, 2017
1 parent 91eb595 commit 8847b41
Show file tree
Hide file tree
Showing 12 changed files with 1,297 additions and 177 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import com.mapbox.mapboxsdk.R;
import com.mapbox.mapboxsdk.constants.MapboxConstants;
import com.mapbox.mapboxsdk.maps.MapView;
import com.mapbox.mapboxsdk.maps.MapboxMap;
import com.mapbox.mapboxsdk.utils.AnimatorUtils;

Expand All @@ -34,7 +33,7 @@
* SDK views to be used as a symbol see https://github.com/mapbox/mapbox-gl-native/blob/68f32bc104422207c64da8d90e8411b138d87f04/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/style/SymbolGeneratorActivity.java
*/
@Deprecated
public class MarkerViewManager implements MapView.OnMapChangedListener {
public class MarkerViewManager {

private final ViewGroup markerViewContainer;
private final ViewTreeObserver.OnPreDrawListener markerViewPreDrawObserver =
Expand Down Expand Up @@ -75,9 +74,8 @@ public void bind(MapboxMap mapboxMap) {
this.mapboxMap = mapboxMap;
}

@Override
public void onMapChanged(@MapView.MapChange int change) {
if (isWaitingForRenderInvoke && change == MapView.DID_FINISH_RENDERING_FRAME_FULLY_RENDERED) {
public void onDidFinishRenderingFrameFully() {
if (isWaitingForRenderInvoke) {
isWaitingForRenderInvoke = false;
invalidateViewMarkersInVisibleRegion();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class AnnotationManager {
private Polygons polygons;
private Polylines polylines;

AnnotationManager(NativeMapView view, MapView mapView, LongSparseArray<Annotation> annotationsArray,
AnnotationManager(MapView mapView, LongSparseArray<Annotation> annotationsArray,
MarkerViewManager markerViewManager, IconManager iconManager, Annotations annotations,
Markers markers, Polygons polygons, Polylines polylines) {
this.mapView = mapView;
Expand All @@ -73,10 +73,6 @@ class AnnotationManager {
this.markers = markers;
this.polygons = polygons;
this.polylines = polylines;
if (view != null) {
// null checking needed for unit tests
view.addOnMapChangedListener(markerViewManager);
}
}

// TODO refactor MapboxMap out for Projection and Transform
Expand Down
Loading

0 comments on commit 8847b41

Please sign in to comment.