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

Commit 86bf28a3 authored by Todd Lee's avatar Todd Lee
Browse files

Refactor animation lib to supprot wear-sdk origin transitions

This change refactors the lib to create the required dependencies
for clients that will use it through the wear-sdk (or any
java_sdk_library).

Bug: b/352680005
Test: manual build/run
Flag: NONE exempt, build refactor

Change-Id: Ic49fc9978eb2948c6e8c3de8198b57058d16d663
parent 3b6aba8f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -156,6 +156,13 @@ java_library {
    },
}

filegroup {
    name: "wm_shell-shared-utils",
    srcs: [
        "shared/src/com/android/wm/shell/shared/TransitionUtil.java",
    ],
}

filegroup {
    name: "wm_shell-shared-aidls",

+13 −0
Original line number Diff line number Diff line
@@ -47,6 +47,19 @@ java_library {
    ],
}

filegroup {
    name: "PlatformAnimationLib-client-srcs",
    srcs: [
        "src/com/android/systemui/animation/OriginRemoteTransition.java",
        "src/com/android/systemui/animation/OriginTransitionSession.java",
        "src/com/android/systemui/animation/SurfaceUIComponent.java",
        "src/com/android/systemui/animation/Transactions.java",
        "src/com/android/systemui/animation/UIComponent.java",
        "src/com/android/systemui/animation/ViewUIComponent.java",
        ":PlatformAnimationLib-aidl",
    ],
}

filegroup {
    name: "PlatformAnimationLib-aidl",
    srcs: [
+4 −1
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import java.util.List;
/**
 * An implementation of {@link IRemoteTransition} that accepts a {@link UIComponent} as the origin
 * and automatically attaches it to the transition leash before the transition starts.
 * @hide
 */
public class OriginRemoteTransition extends IRemoteTransition.Stub {
    private static final String TAG = "OriginRemoteTransition";
@@ -328,7 +329,9 @@ public class OriginRemoteTransition extends IRemoteTransition.Stub {
                /* baseBounds= */ maxBounds);
    }

    /** An interface that represents an origin transitions. */
    /** An interface that represents an origin transitions.
     * @hide
     */
    public interface TransitionPlayer {

        /**
+5 −1
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import java.util.function.Supplier;
/**
 * A session object that holds origin transition states for starting an activity from an on-screen
 * UI component and smoothly transitioning back from the activity to the same UI component.
 * @hide
 */
public class OriginTransitionSession {
    private static final String TAG = "OriginTransitionSession";
@@ -179,7 +180,10 @@ public class OriginTransitionSession {
        }
    }

    /** A builder to build a {@link OriginTransitionSession}. */
    /**
     * A builder to build a {@link OriginTransitionSession}.
     * @hide
     */
    public static class Builder {
        private final Context mContext;
        @Nullable private final IOriginTransitions mOriginTransitions;
+8 −2
Original line number Diff line number Diff line
@@ -26,7 +26,10 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.concurrent.Executor;

/** A {@link UIComponent} representing a {@link SurfaceControl}. */
/**
 * A {@link UIComponent} representing a {@link SurfaceControl}.
 * @hide
 */
public class SurfaceUIComponent implements UIComponent {
    private final Collection<SurfaceControl> mSurfaces;
    private final Rect mBaseBounds;
@@ -89,7 +92,10 @@ public class SurfaceUIComponent implements UIComponent {
                + "}";
    }

    /** A {@link Transaction} wrapping a {@link SurfaceControl.Transaction}. */
    /**
     * A {@link Transaction} wrapping a {@link SurfaceControl.Transaction}.
     * @hide
     */
    public static class Transaction implements UIComponent.Transaction<SurfaceUIComponent> {
        private final SurfaceControl.Transaction mTransaction;
        private final ArrayList<Runnable> mChanges = new ArrayList<>();
Loading