summaryrefslogtreecommitdiff
path: root/platform/android/src
diff options
context:
space:
mode:
authorTobrun <tobrun@mapbox.com>2017-03-30 13:25:56 +0200
committerGitHub <noreply@github.com>2017-03-30 13:25:56 +0200
commita4959131b2cf5500a66c26ebd83ee3de44861feb (patch)
tree5344244f2731d9d5d0f9e3cdebb52e1be0a3cbcd /platform/android/src
parent152b48fd92f9c7c33b45b4b1974da43c55d35d42 (diff)
downloadqtlocation-mapboxgl-a4959131b2cf5500a66c26ebd83ee3de44861feb.tar.gz
[android] - transition options in milliseconds, added test cases, fixup test activity code (#8576)
Diffstat (limited to 'platform/android/src')
-rwxr-xr-xplatform/android/src/native_map_view.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp
index dd4cadbcfb..d9c24ba0f8 100755
--- a/platform/android/src/native_map_view.cpp
+++ b/platform/android/src/native_map_view.cpp
@@ -752,23 +752,23 @@ jdouble NativeMapView::getTopOffsetPixelsForAnnotationSymbol(JNIEnv& env, jni::S
jlong NativeMapView::getTransitionDuration(JNIEnv&) {
const auto transitionOptions = map->getTransitionOptions();
- return transitionOptions.duration.value_or(mbgl::Duration::zero()).count();
+ return std::chrono::duration_cast<std::chrono::milliseconds>(transitionOptions.duration.value_or(mbgl::Duration::zero())).count();
}
void NativeMapView::setTransitionDuration(JNIEnv&, jlong duration) {
auto transitionOptions = map->getTransitionOptions();
- transitionOptions.duration = std::chrono::duration_cast<mbgl::Duration>(std::chrono::duration<jlong>(duration));
+ transitionOptions.duration.emplace(mbgl::Milliseconds(duration));
map->setTransitionOptions(transitionOptions);
}
jlong NativeMapView::getTransitionDelay(JNIEnv&) {
const auto transitionOptions = map->getTransitionOptions();
- return transitionOptions.delay.value_or(mbgl::Duration::zero()).count();
+ return std::chrono::duration_cast<std::chrono::milliseconds>(transitionOptions.delay.value_or(mbgl::Duration::zero())).count();
}
void NativeMapView::setTransitionDelay(JNIEnv&, jlong delay) {
auto transitionOptions = map->getTransitionOptions();
- transitionOptions.delay = std::chrono::duration_cast<mbgl::Duration>(std::chrono::duration<jlong>(delay));
+ transitionOptions.delay.emplace(mbgl::Milliseconds(delay));
map->setTransitionOptions(transitionOptions);
}