summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2018-12-09 13:30:18 +0200
committerChris Loer <chris.loer@mapbox.com>2018-12-11 11:46:16 -0800
commit662a4955615d201f6d1525dcbf3cc08da3d546b4 (patch)
treeda1ab00d49c7c9102bfcb66c00c0bb75bdff7a1e
parent70c2d5a4cabcd87bc4e6e564fcd6dfa10bd4c521 (diff)
downloadqtlocation-mapboxgl-662a4955615d201f6d1525dcbf3cc08da3d546b4.tar.gz
[docs] EnterIdle -> BecomeIdle
-rw-r--r--include/mbgl/map/map_observer.hpp2
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapChangeReceiver.java22
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java14
-rwxr-xr-xplatform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java6
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/maps/MapChangeReceiverTest.java28
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapChangeActivity.java2
-rwxr-xr-xplatform/android/src/native_map_view.cpp6
-rwxr-xr-xplatform/android/src/native_map_view.hpp2
-rw-r--r--platform/ios/src/MGLMapViewDelegate.h2
-rw-r--r--platform/ios/test/MGLMapViewDelegateIntegrationTests.swift2
-rw-r--r--platform/macos/src/MGLMapView.mm10
-rw-r--r--platform/macos/src/MGLMapViewDelegate.h2
-rw-r--r--platform/macos/test/MGLMapViewDelegateIntegrationTests.swift2
-rw-r--r--src/mbgl/map/map.cpp2
14 files changed, 52 insertions, 50 deletions
diff --git a/include/mbgl/map/map_observer.hpp b/include/mbgl/map/map_observer.hpp
index 9c3345d614..98b218f8f0 100644
--- a/include/mbgl/map/map_observer.hpp
+++ b/include/mbgl/map/map_observer.hpp
@@ -39,7 +39,7 @@ public:
virtual void onDidFinishRenderingMap(RenderMode) {}
virtual void onDidFinishLoadingStyle() {}
virtual void onSourceChanged(style::Source&) {}
- virtual void onDidEnterIdle() {}
+ virtual void onDidBecomeIdle() {}
};
} // namespace mbgl
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapChangeReceiver.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapChangeReceiver.java
index f569ae3af9..7eebd27d62 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapChangeReceiver.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapChangeReceiver.java
@@ -26,7 +26,7 @@ class MapChangeReceiver implements NativeMapView.StateCallback {
= new CopyOnWriteArrayList<>();
private final List<MapView.OnDidFinishRenderingMapListener> onDidFinishRenderingMapListenerList
= new CopyOnWriteArrayList<>();
- private final List<MapView.OnDidEnterIdleListener> onDidEnterIdleListenerList
+ private final List<MapView.OnDidBecomeIdleListener> onDidBecomeIdleListenerList
= new CopyOnWriteArrayList<>();
private final List<MapView.OnDidFinishLoadingStyleListener> onDidFinishLoadingStyleListenerList
= new CopyOnWriteArrayList<>();
@@ -173,15 +173,15 @@ class MapChangeReceiver implements NativeMapView.StateCallback {
}
@Override
- public void onDidEnterIdle() {
+ public void onDidBecomeIdle() {
try {
- if (!onDidEnterIdleListenerList.isEmpty()) {
- for (MapView.OnDidEnterIdleListener listener : onDidEnterIdleListenerList) {
- listener.onDidEnterIdle();
+ if (!onDidBecomeIdleListenerList.isEmpty()) {
+ for (MapView.OnDidBecomeIdleListener listener : onDidBecomeIdleListenerList) {
+ listener.onDidBecomeIdle();
}
}
} catch (Throwable err) {
- Logger.e(TAG, "Exception in onDidEnterIdle", err);
+ Logger.e(TAG, "Exception in onDidBecomeIdle", err);
throw err;
}
}
@@ -294,12 +294,12 @@ class MapChangeReceiver implements NativeMapView.StateCallback {
onDidFinishRenderingMapListenerList.remove(listener);
}
- void addOnDidEnterIdleListener(MapView.OnDidEnterIdleListener listener) {
- onDidEnterIdleListenerList.add(listener);
+ void addOnDidBecomeIdleListener(MapView.OnDidBecomeIdleListener listener) {
+ onDidBecomeIdleListenerList.add(listener);
}
- void removeOnDidEnterIdleListener(MapView.OnDidEnterIdleListener listener) {
- onDidEnterIdleListenerList.remove(listener);
+ void removeOnDidBecomeIdleListener(MapView.OnDidBecomeIdleListener listener) {
+ onDidBecomeIdleListenerList.remove(listener);
}
void addOnDidFinishLoadingStyleListener(MapView.OnDidFinishLoadingStyleListener listener) {
@@ -329,7 +329,7 @@ class MapChangeReceiver implements NativeMapView.StateCallback {
onDidFinishRenderingFrameList.clear();
onWillStartRenderingMapListenerList.clear();
onDidFinishRenderingMapListenerList.clear();
- onDidEnterIdleListenerList.clear();
+ onDidBecomeIdleListenerList.clear();
onDidFinishLoadingStyleListenerList.clear();
onSourceChangedListenerList.clear();
}
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
index 8a29ae8070..83948efe4c 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
@@ -702,8 +702,8 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
*
* @param listener The callback that's invoked when the map has entered the idle state.
*/
- public void addOnDidEnterIdleListener(OnDidEnterIdleListener listener) {
- mapChangeReceiver.addOnDidEnterIdleListener(listener);
+ public void addOnDidBecomeIdleListener(OnDidBecomeIdleListener listener) {
+ mapChangeReceiver.addOnDidBecomeIdleListener(listener);
}
/**
@@ -711,8 +711,8 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
*
* @param listener The callback that's invoked when the map has entered the idle state.
*/
- public void removeOnDidEnterIdleListener(OnDidEnterIdleListener listener) {
- mapChangeReceiver.removeOnDidEnterIdleListener(listener);
+ public void removeOnDidBecomeIdleListener(OnDidBecomeIdleListener listener) {
+ mapChangeReceiver.removeOnDidBecomeIdleListener(listener);
}
/**
@@ -893,14 +893,14 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
/**
* Interface definition for a callback to be invoked when the map has entered the idle state.
* <p>
- * {@link MapView#addOnDidEnterIdleListener(OnDidEnterIdleListener)}
+ * {@link MapView#addOnDidBecomeIdleListener(OnDidBecomeIdleListener)}
* </p>
*/
- public interface OnDidEnterIdleListener {
+ public interface OnDidBecomeIdleListener {
/**
* Called when the map has entered the idle state.
*/
- void onDidEnterIdle();
+ void onDidBecomeIdle();
}
/**
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java
index 59840f5bf3..b0137615d0 100755
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/NativeMapView.java
@@ -1010,8 +1010,8 @@ final class NativeMapView {
}
@Keep
- private void onDidEnterIdle() {
- stateCallback.onDidEnterIdle();
+ private void onDidBecomeIdle() {
+ stateCallback.onDidBecomeIdle();
}
@Keep
@@ -1477,7 +1477,7 @@ final class NativeMapView {
void onDidFinishRenderingMap(boolean fully);
- void onDidEnterIdle();
+ void onDidBecomeIdle();
void onSourceChanged(String sourceId);
}
diff --git a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/maps/MapChangeReceiverTest.java b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/maps/MapChangeReceiverTest.java
index 848cf4a804..025f06752c 100644
--- a/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/maps/MapChangeReceiverTest.java
+++ b/platform/android/MapboxGLAndroidSDK/src/test/java/com/mapbox/mapboxsdk/maps/MapChangeReceiverTest.java
@@ -56,7 +56,7 @@ public class MapChangeReceiverTest {
private MapView.OnDidFinishRenderingMapListener onDidFinishRenderingMapListener;
@Mock
- private MapView.OnDidEnterIdleListener onDidEnterIdleListener;
+ private MapView.OnDidBecomeIdleListener onDidBecomeIdleListener;
@Mock
private MapView.OnDidFinishLoadingStyleListener onDidFinishLoadingStyleListener;
@@ -495,29 +495,29 @@ public class MapChangeReceiverTest {
}
@Test
- public void testOnDidEnterIdleListener() {
- mapChangeEventManager.addOnDidEnterIdleListener(onDidEnterIdleListener);
- mapChangeEventManager.onDidEnterIdle();
- verify(onDidEnterIdleListener).onDidEnterIdle();
- mapChangeEventManager.removeOnDidEnterIdleListener(onDidEnterIdleListener);
- mapChangeEventManager.onDidEnterIdle();
- verify(onDidEnterIdleListener).onDidEnterIdle();
-
- mapChangeEventManager.addOnDidEnterIdleListener(onDidEnterIdleListener);
+ public void testOnDidBecomeIdleListener() {
+ mapChangeEventManager.addOnDidBecomeIdleListener(onDidBecomeIdleListener);
+ mapChangeEventManager.onDidBecomeIdle();
+ verify(onDidBecomeIdleListener).onDidBecomeIdle();
+ mapChangeEventManager.removeOnDidBecomeIdleListener(onDidBecomeIdleListener);
+ mapChangeEventManager.onDidBecomeIdle();
+ verify(onDidBecomeIdleListener).onDidBecomeIdle();
+
+ mapChangeEventManager.addOnDidBecomeIdleListener(onDidBecomeIdleListener);
Logger.setLoggerDefinition(loggerDefinition);
Exception exc = new RuntimeException();
- doThrow(exc).when(onDidEnterIdleListener).onDidEnterIdle();
+ doThrow(exc).when(onDidBecomeIdleListener).onDidBecomeIdle();
try {
- mapChangeEventManager.onDidEnterIdle();
+ mapChangeEventManager.onDidBecomeIdle();
Assert.fail("The exception should've been re-thrown.");
} catch (RuntimeException throwable) {
verify(loggerDefinition).e(anyString(), anyString(), eq(exc));
}
Error err = new ExecutionError("", new Error());
- doThrow(err).when(onDidEnterIdleListener).onDidEnterIdle();
+ doThrow(err).when(onDidBecomeIdleListener).onDidBecomeIdle();
try {
- mapChangeEventManager.onDidEnterIdle();
+ mapChangeEventManager.onDidBecomeIdle();
Assert.fail("The exception should've been re-thrown.");
} catch (ExecutionError throwable) {
verify(loggerDefinition).e(anyString(), anyString(), eq(err));
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapChangeActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapChangeActivity.java
index 7fe4a47217..ee10d39dba 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapChangeActivity.java
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/MapChangeActivity.java
@@ -32,7 +32,7 @@ public class MapChangeActivity extends AppCompatActivity {
mapView.addOnDidFinishLoadingStyleListener(() -> Timber.v("OnDidFinishLoadingStyle"));
mapView.addOnDidFinishRenderingFrameListener(fully -> Timber.v("OnDidFinishRenderingFrame: fully: %s", fully));
mapView.addOnDidFinishRenderingMapListener(fully -> Timber.v("OnDidFinishRenderingMap: fully: %s", fully));
- mapView.addOnDidEnterIdleListener(() -> Timber.v("OnDidEnterIdle"));
+ mapView.addOnDidBecomeIdleListener(() -> Timber.v("OnDidBecomeIdle"));
mapView.addOnSourceChangedListener(sourceId -> Timber.v("OnSourceChangedListener: source with id: %s", sourceId));
mapView.addOnWillStartLoadingMapListener(() -> Timber.v("OnWillStartLoadingMap"));
mapView.addOnWillStartRenderingFrameListener(() -> Timber.v("OnWillStartRenderingFrame"));
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp
index d724afa923..5b23076441 100755
--- a/platform/android/src/native_map_view.cpp
+++ b/platform/android/src/native_map_view.cpp
@@ -186,13 +186,13 @@ void NativeMapView::onDidFinishRenderingMap(MapObserver::RenderMode mode) {
javaPeer.get(*_env).Call(*_env, onDidFinishRenderingMap, (jboolean) (mode != MapObserver::RenderMode::Partial));
}
-void NativeMapView::onDidEnterIdle() {
+void NativeMapView::onDidBecomeIdle() {
assert(vm != nullptr);
android::UniqueEnv _env = android::AttachEnv();
static auto& javaClass = jni::Class<NativeMapView>::Singleton(*_env);
- static auto onDidEnterIdle = javaClass.GetMethod<void ()>(*_env, "onDidEnterIdle");
- javaPeer.get(*_env).Call(*_env, onDidEnterIdle);
+ static auto onDidBecomeIdle = javaClass.GetMethod<void ()>(*_env, "onDidBecomeIdle");
+ javaPeer.get(*_env).Call(*_env, onDidBecomeIdle);
}
void NativeMapView::onDidFinishLoadingStyle() {
diff --git a/platform/android/src/native_map_view.hpp b/platform/android/src/native_map_view.hpp
index 44e9259b2a..82666a2475 100755
--- a/platform/android/src/native_map_view.hpp
+++ b/platform/android/src/native_map_view.hpp
@@ -67,7 +67,7 @@ public:
void onDidFinishRenderingFrame(MapObserver::RenderMode) override;
void onWillStartRenderingMap() override;
void onDidFinishRenderingMap(MapObserver::RenderMode) override;
- void onDidEnterIdle() override;
+ void onDidBecomeIdle() override;
void onDidFinishLoadingStyle() override;
void onSourceChanged(mbgl::style::Source&) override;
diff --git a/platform/ios/src/MGLMapViewDelegate.h b/platform/ios/src/MGLMapViewDelegate.h
index 8c1d3d98c0..ffc460b995 100644
--- a/platform/ios/src/MGLMapViewDelegate.h
+++ b/platform/ios/src/MGLMapViewDelegate.h
@@ -250,7 +250,7 @@ NS_ASSUME_NONNULL_BEGIN
@param mapView The map view that has just entered the idle state.
*/
-- (void)mapViewDidEnterIdle:(MGLMapView *)mapView;
+- (void)mapViewDidBecomeIdle:(MGLMapView *)mapView;
/**
Tells the delegate that the map has just finished loading a style.
diff --git a/platform/ios/test/MGLMapViewDelegateIntegrationTests.swift b/platform/ios/test/MGLMapViewDelegateIntegrationTests.swift
index 4904cb185b..2bf3dc06bd 100644
--- a/platform/ios/test/MGLMapViewDelegateIntegrationTests.swift
+++ b/platform/ios/test/MGLMapViewDelegateIntegrationTests.swift
@@ -52,6 +52,8 @@ extension MGLMapViewDelegateIntegrationTests: MGLMapViewDelegate {
func mapView(_ mapView: MGLMapView, didUpdate userLocation: MGLUserLocation?) {}
func mapViewDidFinishRenderingMap(_ mapView: MGLMapView, fullyRendered: Bool) {}
+
+ func mapViewDidBecomeIdle(_ mapView: MGLMapView) {}
func mapView(_ mapView: MGLMapView, didFailToLocateUserWithError error: Error) {}
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm
index eb877216d2..1ba2483d52 100644
--- a/platform/macos/src/MGLMapView.mm
+++ b/platform/macos/src/MGLMapView.mm
@@ -934,13 +934,13 @@ public:
}
}
-- (void)mapViewDidEnterIdle {
+- (void)mapViewDidBecomeIdle {
if (!_mbglMap) {
return;
}
- if ([self.delegate respondsToSelector:@selector(mapViewDidEnterIdle)]) {
- [self.delegate mapViewDidEnterIdle:self];
+ if ([self.delegate respondsToSelector:@selector(mapViewDidBecomeIdle)]) {
+ [self.delegate mapViewDidBecomeIdle:self];
}
}
@@ -3061,8 +3061,8 @@ public:
[nativeView mapViewDidFinishRenderingMapFullyRendered:fullyRendered];
}
- void onDidEnterIdle() override {
- [nativeView mapViewDidEnterIdle];
+ void onDidBecomeIdle() override {
+ [nativeView mapViewDidBecomeIdle];
}
void onDidFinishLoadingStyle() override {
diff --git a/platform/macos/src/MGLMapViewDelegate.h b/platform/macos/src/MGLMapViewDelegate.h
index ad59f5bd39..c7d6786666 100644
--- a/platform/macos/src/MGLMapViewDelegate.h
+++ b/platform/macos/src/MGLMapViewDelegate.h
@@ -162,7 +162,7 @@ NS_ASSUME_NONNULL_BEGIN
@param mapView The map view that has just entered the idle state.
*/
-- (void)mapViewDidEnterIdle:(MGLMapView *)mapView;
+- (void)mapViewDidBecomeIdle:(MGLMapView *)mapView;
/**
Tells the delegate that the map has just finished loading a style.
diff --git a/platform/macos/test/MGLMapViewDelegateIntegrationTests.swift b/platform/macos/test/MGLMapViewDelegateIntegrationTests.swift
index 109c279a09..83c7160fde 100644
--- a/platform/macos/test/MGLMapViewDelegateIntegrationTests.swift
+++ b/platform/macos/test/MGLMapViewDelegateIntegrationTests.swift
@@ -25,7 +25,7 @@ extension MGLMapViewDelegateIntegrationTests: MGLMapViewDelegate {
func mapViewDidFinishRenderingMap(_ mapView: MGLMapView, fullyRendered: Bool) {}
- func mapViewDidEnterIdle(_ mapView: MGLMapView) {}
+ func mapViewDidBecomeIdle(_ mapView: MGLMapView) {}
func mapViewDidFailLoadingMap(_ mapView: MGLMapView, withError error: Error) {}
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index 5e80f1512b..1b4176db7a 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -210,7 +210,7 @@ void Map::Impl::onDidFinishRenderingFrame(RenderMode renderMode, bool needsRepai
if (needsRepaint || transform.inTransition()) {
onUpdate();
} else if (rendererFullyLoaded) {
- observer.onDidEnterIdle();
+ observer.onDidBecomeIdle();
}
} else if (stillImageRequest && rendererFullyLoaded) {
auto request = std::move(stillImageRequest);