Loading packages/SystemUI/src/com/android/systemui/bubbles/animation/StackAnimationController.java +2 −2 Original line number Diff line number Diff line Loading @@ -1034,13 +1034,13 @@ public class StackAnimationController extends mMagnetizedStack.getFlingToTargetMinVelocity() /* default */); final float maxVelocity = Settings.Secure.getFloat(contentResolver, "bubble_dismiss_stick_max_velocity", mMagnetizedStack.getStickToTargetMaxVelocity() /* default */); mMagnetizedStack.getStickToTargetMaxXVelocity() /* default */); final float targetWidth = Settings.Secure.getFloat(contentResolver, "bubble_dismiss_target_width_percent", mMagnetizedStack.getFlingToTargetWidthPercent() /* default */); mMagnetizedStack.setFlingToTargetMinVelocity(minVelocity); mMagnetizedStack.setStickToTargetMaxVelocity(maxVelocity); mMagnetizedStack.setStickToTargetMaxXVelocity(maxVelocity); mMagnetizedStack.setFlingToTargetWidthPercent(targetWidth); return mMagnetizedStack; Loading packages/SystemUI/src/com/android/systemui/util/magnetictarget/MagnetizedObject.kt +5 −4 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import androidx.dynamicanimation.animation.DynamicAnimation import androidx.dynamicanimation.animation.FloatPropertyCompat import androidx.dynamicanimation.animation.SpringForce import com.android.systemui.util.animation.PhysicsAnimator import kotlin.math.abs import kotlin.math.hypot /** Loading Loading @@ -231,11 +232,11 @@ abstract class MagnetizedObject<T : Any>( var flingUnstuckFromTargetMinVelocity = 1000f /** * Sets the maximum velocity above which the object will not stick to the target. Even if the * Sets the maximum X velocity above which the object will not stick to the target. Even if the * object is dragged through the magnetic field, it will not stick to the target until the * velocity is below this value. * horizontal velocity is below this value. */ var stickToTargetMaxVelocity = 2000f var stickToTargetMaxXVelocity = 2000f /** * Enable or disable haptic vibration effects when the object interacts with the magnetic field. Loading Loading @@ -363,7 +364,7 @@ abstract class MagnetizedObject<T : Any>( // If the object is moving too quickly within the magnetic field, do not stick it. This // only applies to objects newly stuck to a target. If the object is moved into a new // target, it wasn't moving at all (since it was stuck to the previous one). if (objectNewlyStuckToTarget && hypot(velX, velY) > stickToTargetMaxVelocity) { if (objectNewlyStuckToTarget && abs(velX) > stickToTargetMaxXVelocity) { return false } Loading Loading
packages/SystemUI/src/com/android/systemui/bubbles/animation/StackAnimationController.java +2 −2 Original line number Diff line number Diff line Loading @@ -1034,13 +1034,13 @@ public class StackAnimationController extends mMagnetizedStack.getFlingToTargetMinVelocity() /* default */); final float maxVelocity = Settings.Secure.getFloat(contentResolver, "bubble_dismiss_stick_max_velocity", mMagnetizedStack.getStickToTargetMaxVelocity() /* default */); mMagnetizedStack.getStickToTargetMaxXVelocity() /* default */); final float targetWidth = Settings.Secure.getFloat(contentResolver, "bubble_dismiss_target_width_percent", mMagnetizedStack.getFlingToTargetWidthPercent() /* default */); mMagnetizedStack.setFlingToTargetMinVelocity(minVelocity); mMagnetizedStack.setStickToTargetMaxVelocity(maxVelocity); mMagnetizedStack.setStickToTargetMaxXVelocity(maxVelocity); mMagnetizedStack.setFlingToTargetWidthPercent(targetWidth); return mMagnetizedStack; Loading
packages/SystemUI/src/com/android/systemui/util/magnetictarget/MagnetizedObject.kt +5 −4 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import androidx.dynamicanimation.animation.DynamicAnimation import androidx.dynamicanimation.animation.FloatPropertyCompat import androidx.dynamicanimation.animation.SpringForce import com.android.systemui.util.animation.PhysicsAnimator import kotlin.math.abs import kotlin.math.hypot /** Loading Loading @@ -231,11 +232,11 @@ abstract class MagnetizedObject<T : Any>( var flingUnstuckFromTargetMinVelocity = 1000f /** * Sets the maximum velocity above which the object will not stick to the target. Even if the * Sets the maximum X velocity above which the object will not stick to the target. Even if the * object is dragged through the magnetic field, it will not stick to the target until the * velocity is below this value. * horizontal velocity is below this value. */ var stickToTargetMaxVelocity = 2000f var stickToTargetMaxXVelocity = 2000f /** * Enable or disable haptic vibration effects when the object interacts with the magnetic field. Loading Loading @@ -363,7 +364,7 @@ abstract class MagnetizedObject<T : Any>( // If the object is moving too quickly within the magnetic field, do not stick it. This // only applies to objects newly stuck to a target. If the object is moved into a new // target, it wasn't moving at all (since it was stuck to the previous one). if (objectNewlyStuckToTarget && hypot(velX, velY) > stickToTargetMaxVelocity) { if (objectNewlyStuckToTarget && abs(velX) > stickToTargetMaxXVelocity) { return false } Loading