Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4180ef08 authored by Liran Binyamin's avatar Liran Binyamin
Browse files

Move PhysicsAnimator to wm/shell/shared

Flag: NONE
Bug: 280605790
Bug: 322791067
Test: no behavior change. relying on presubmits
Change-Id: I84f488f058f3e2f069a3fb8683cd2169fb896745
parent abade65a
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -45,7 +45,6 @@ filegroup {
    name: "wm_shell_util-sources",
    name: "wm_shell_util-sources",
    srcs: [
    srcs: [
        "src/com/android/wm/shell/animation/Interpolators.java",
        "src/com/android/wm/shell/animation/Interpolators.java",
        "src/com/android/wm/shell/animation/PhysicsAnimator.kt",
        "src/com/android/wm/shell/common/bubbles/*.kt",
        "src/com/android/wm/shell/common/bubbles/*.kt",
        "src/com/android/wm/shell/common/bubbles/*.java",
        "src/com/android/wm/shell/common/bubbles/*.java",
        "src/com/android/wm/shell/common/magnetictarget/MagnetizedObject.kt",
        "src/com/android/wm/shell/common/magnetictarget/MagnetizedObject.kt",
@@ -169,7 +168,13 @@ java_library {
java_library {
java_library {
    name: "WindowManager-Shell-shared",
    name: "WindowManager-Shell-shared",


    srcs: ["shared/**/*.java"],
    srcs: [
        "shared/**/*.java",
        "shared/**/*.kt",
    ],
    static_libs: [
        "androidx.dynamicanimation_dynamicanimation",
    ],
}
}


android_library {
android_library {
+1 −1
Original line number Original line Diff line number Diff line
@@ -34,11 +34,11 @@ import com.android.internal.logging.testing.UiEventLoggerFake
import com.android.internal.protolog.common.ProtoLog
import com.android.internal.protolog.common.ProtoLog
import com.android.launcher3.icons.BubbleIconFactory
import com.android.launcher3.icons.BubbleIconFactory
import com.android.wm.shell.R
import com.android.wm.shell.R
import com.android.wm.shell.animation.PhysicsAnimatorTestUtils
import com.android.wm.shell.bubbles.Bubbles.SysuiProxy
import com.android.wm.shell.bubbles.Bubbles.SysuiProxy
import com.android.wm.shell.bubbles.animation.AnimatableScaleMatrix
import com.android.wm.shell.bubbles.animation.AnimatableScaleMatrix
import com.android.wm.shell.common.FloatingContentCoordinator
import com.android.wm.shell.common.FloatingContentCoordinator
import com.android.wm.shell.common.ShellExecutor
import com.android.wm.shell.common.ShellExecutor
import com.android.wm.shell.shared.animation.PhysicsAnimatorTestUtils
import com.android.wm.shell.taskview.TaskView
import com.android.wm.shell.taskview.TaskView
import com.android.wm.shell.taskview.TaskViewTaskController
import com.android.wm.shell.taskview.TaskViewTaskController
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertThat
+4 −4
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 * limitations under the License.
 */
 */


package com.android.wm.shell.animation
package com.android.wm.shell.shared.animation


import android.util.ArrayMap
import android.util.ArrayMap
import android.util.Log
import android.util.Log
@@ -25,7 +25,7 @@ import androidx.dynamicanimation.animation.FloatPropertyCompat
import androidx.dynamicanimation.animation.SpringAnimation
import androidx.dynamicanimation.animation.SpringAnimation
import androidx.dynamicanimation.animation.SpringForce
import androidx.dynamicanimation.animation.SpringForce


import com.android.wm.shell.animation.PhysicsAnimator.Companion.getInstance
import com.android.wm.shell.shared.animation.PhysicsAnimator.Companion.getInstance
import java.lang.ref.WeakReference
import java.lang.ref.WeakReference
import java.util.WeakHashMap
import java.util.WeakHashMap
import kotlin.math.abs
import kotlin.math.abs
@@ -874,7 +874,7 @@ class PhysicsAnimator<T> private constructor (target: T) {
     *
     *
     * @param <T> The type of the object being animated.
     * @param <T> The type of the object being animated.
    </T> */
    </T> */
    interface UpdateListener<T> {
    fun interface UpdateListener<T> {


        /**
        /**
         * Called on each animation frame with the target object, and a map of FloatPropertyCompat
         * Called on each animation frame with the target object, and a map of FloatPropertyCompat
@@ -904,7 +904,7 @@ class PhysicsAnimator<T> private constructor (target: T) {
     *
     *
     * @param <T> The type of the object being animated.
     * @param <T> The type of the object being animated.
    </T> */
    </T> */
    interface EndListener<T> {
    fun interface EndListener<T> {


        /**
        /**
         * Called with the final animation values as each property animation ends. This can be used
         * Called with the final animation values as each property animation ends. This can be used
+2 −2
Original line number Original line Diff line number Diff line
@@ -13,13 +13,13 @@
 * See the License for the specific language governing permissions and
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * limitations under the License.
 */
 */
package com.android.wm.shell.animation
package com.android.wm.shell.shared.animation


import android.os.Handler
import android.os.Handler
import android.os.Looper
import android.os.Looper
import android.util.ArrayMap
import android.util.ArrayMap
import androidx.dynamicanimation.animation.FloatPropertyCompat
import androidx.dynamicanimation.animation.FloatPropertyCompat
import com.android.wm.shell.animation.PhysicsAnimatorTestUtils.prepareForTest
import com.android.wm.shell.shared.animation.PhysicsAnimatorTestUtils.prepareForTest
import java.util.*
import java.util.*
import java.util.concurrent.CountDownLatch
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeUnit
+1 −1
Original line number Original line Diff line number Diff line
@@ -82,7 +82,6 @@ import com.android.internal.protolog.common.ProtoLog;
import com.android.internal.util.FrameworkStatsLog;
import com.android.internal.util.FrameworkStatsLog;
import com.android.wm.shell.R;
import com.android.wm.shell.R;
import com.android.wm.shell.animation.Interpolators;
import com.android.wm.shell.animation.Interpolators;
import com.android.wm.shell.animation.PhysicsAnimator;
import com.android.wm.shell.bubbles.BubblesNavBarMotionEventHandler.MotionEventListener;
import com.android.wm.shell.bubbles.BubblesNavBarMotionEventHandler.MotionEventListener;
import com.android.wm.shell.bubbles.animation.AnimatableScaleMatrix;
import com.android.wm.shell.bubbles.animation.AnimatableScaleMatrix;
import com.android.wm.shell.bubbles.animation.ExpandedAnimationController;
import com.android.wm.shell.bubbles.animation.ExpandedAnimationController;
@@ -95,6 +94,7 @@ import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.bubbles.DismissView;
import com.android.wm.shell.common.bubbles.DismissView;
import com.android.wm.shell.common.bubbles.RelativeTouchListener;
import com.android.wm.shell.common.bubbles.RelativeTouchListener;
import com.android.wm.shell.common.magnetictarget.MagnetizedObject;
import com.android.wm.shell.common.magnetictarget.MagnetizedObject;
import com.android.wm.shell.shared.animation.PhysicsAnimator;


import java.io.PrintWriter;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigDecimal;
Loading