summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2016-11-30 14:21:10 +0100
committerGitHub <noreply@github.com>2016-11-30 14:21:10 +0100
commitb3ec26f2828cf19f7262cbe5af03d9cd39ec8fb3 (patch)
tree5b89e109de8813ca6114ecf9e19e70bf73fc3315
parentdcd246c05a6058c141962fb0b2798d00ff1e8ac5 (diff)
downloadqtlocation-mapboxgl-b3ec26f2828cf19f7262cbe5af03d9cd39ec8fb3.tar.gz
[android] - setting tilt value when animating visibility. (#7240)
Allow updating model even if MarkerView isn't in current viewport.
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java6
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view_scale.xml1
2 files changed, 6 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java
index 0b1e03bf7e..8560232ef5 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MarkerViewManager.java
@@ -120,6 +120,10 @@ public class MarkerViewManager {
View convertView = markerViewMap.get(marker);
if (convertView != null) {
convertView.setVisibility(visible ? View.VISIBLE : View.GONE);
+ if(visible && marker.isFlat()){
+ // apply tilting after visible change
+ convertView.setRotationX(marker.getTilt());
+ }
}
}
@@ -173,8 +177,8 @@ public class MarkerViewManager {
for (MarkerView markerView : markerViewMap.keySet()) {
if (markerView.isFlat()) {
convertView = markerViewMap.get(markerView);
+ markerView.setTilt(tilt);
if (convertView != null) {
- markerView.setTilt(tilt);
convertView.setRotationX(tilt);
}
}
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view_scale.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view_scale.xml
index f3d22cf663..fe5589b4fe 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view_scale.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_marker_view_scale.xml
@@ -55,6 +55,7 @@
android:layout_below="@id/toolbar"
app:center_latitude="38.907192"
app:center_longitude="-77.036871"
+ app:tilt="60"
app:style_url="@string/style_mapbox_streets"
app:zoom="12" />