diff options
author | Chris Loer <chris.loer@gmail.com> | 2018-12-06 13:31:42 +0200 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2018-12-11 11:46:16 -0800 |
commit | 70c2d5a4cabcd87bc4e6e564fcd6dfa10bd4c521 (patch) | |
tree | 5e514c52d9709d3f89263f53dd005aa7287e9b00 /platform/android/src | |
parent | 13e117b5016769f77dc6b3d3023f6c068e5a92ff (diff) | |
download | qtlocation-mapboxgl-70c2d5a4cabcd87bc4e6e564fcd6dfa10bd4c521.tar.gz |
[core, darwin, android] Add onDidEnterIdle to MapObserver.
didEnterIdle fires whenever render completes and no repaint is scheduled.
Diffstat (limited to 'platform/android/src')
-rwxr-xr-x | platform/android/src/native_map_view.cpp | 9 | ||||
-rwxr-xr-x | platform/android/src/native_map_view.hpp | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index a750baa62c..d724afa923 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -186,6 +186,15 @@ void NativeMapView::onDidFinishRenderingMap(MapObserver::RenderMode mode) { javaPeer.get(*_env).Call(*_env, onDidFinishRenderingMap, (jboolean) (mode != MapObserver::RenderMode::Partial)); } +void NativeMapView::onDidEnterIdle() { + 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); +} + void NativeMapView::onDidFinishLoadingStyle() { assert(vm != nullptr); diff --git a/platform/android/src/native_map_view.hpp b/platform/android/src/native_map_view.hpp index b1f8354d46..44e9259b2a 100755 --- a/platform/android/src/native_map_view.hpp +++ b/platform/android/src/native_map_view.hpp @@ -67,6 +67,7 @@ public: void onDidFinishRenderingFrame(MapObserver::RenderMode) override; void onWillStartRenderingMap() override; void onDidFinishRenderingMap(MapObserver::RenderMode) override; + void onDidEnterIdle() override; void onDidFinishLoadingStyle() override; void onSourceChanged(mbgl::style::Source&) override; |