diff options
author | Łukasz Paczos <lukas.paczos@gmail.com> | 2019-07-16 18:20:43 +0200 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2019-08-15 18:08:29 +0300 |
commit | acc6079b088c75d279b4e55bd8687edf8916144c (patch) | |
tree | 0bb6a6f5d65da1129e6d137dc5882a8a6c5e800f /platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MapboxConstants.java | |
parent | 3e73e4d49fd4239d8dc12584294e6ea3d200facf (diff) | |
download | qtlocation-mapboxgl-acc6079b088c75d279b4e55bd8687edf8916144c.tar.gz |
[android] improve rotation inertia, adjust velocity ratios for screen density
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MapboxConstants.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MapboxConstants.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MapboxConstants.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MapboxConstants.java index d5c5c4d999..015260322c 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MapboxConstants.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MapboxConstants.java @@ -74,11 +74,6 @@ public class MapboxConstants { public static final long VELOCITY_THRESHOLD_IGNORE_FLING = 1000; /** - * Value by which the default rotation threshold will be increased when scaling - */ - public static final float ROTATION_THRESHOLD_INCREASE_WHEN_SCALING = 25f; - - /** * Maximum absolute zoom change for multi-pointer scale velocity animation */ public static final double MAX_ABSOLUTE_SCALE_VELOCITY_CHANGE = 2.5; @@ -89,19 +84,24 @@ public class MapboxConstants { public static final double SCALE_VELOCITY_ANIMATION_DURATION_MULTIPLIER = 150; /** - * Time within which user needs to lift fingers for velocity animation to start. + * Last scale span delta to XY velocity ratio required to execute scale velocity animation. */ - public static final long SCHEDULED_ANIMATION_TIMEOUT = 150L; + public static final double SCALE_VELOCITY_RATIO_THRESHOLD = 4 * 1e-3; /** - * Minimum angular velocity for rotation animation + * Last rotation delta to XY velocity ratio required to execute rotation velocity animation. */ - public static final float MINIMUM_ANGULAR_VELOCITY = 1.5f; + public static final double ROTATE_VELOCITY_RATIO_THRESHOLD = 2.2 * 1e-4; + + /** + * Time within which user needs to lift fingers for velocity animation to start. + */ + public static final long SCHEDULED_ANIMATION_TIMEOUT = 150L; /** * Maximum angular velocity for rotation animation */ - public static final float MAXIMUM_ANGULAR_VELOCITY = 20f; + public static final float MAXIMUM_ANGULAR_VELOCITY = 30f; /** * Factor to calculate tilt change based on pixel change during shove gesture. |