Merge "Update corner radius in app/split screen unfold animation" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a100480ad7
@@ -558,16 +558,18 @@ public abstract class WMShellModule {
|
||||
static FullscreenUnfoldTaskAnimator provideFullscreenUnfoldTaskAnimator(
|
||||
Context context,
|
||||
UnfoldBackgroundController unfoldBackgroundController,
|
||||
ShellController shellController,
|
||||
DisplayInsetsController displayInsetsController
|
||||
) {
|
||||
return new FullscreenUnfoldTaskAnimator(context, unfoldBackgroundController,
|
||||
displayInsetsController);
|
||||
shellController, displayInsetsController);
|
||||
}
|
||||
|
||||
@Provides
|
||||
static SplitTaskUnfoldAnimator provideSplitTaskUnfoldAnimatorBase(
|
||||
Context context,
|
||||
UnfoldBackgroundController backgroundController,
|
||||
ShellController shellController,
|
||||
@ShellMainThread ShellExecutor executor,
|
||||
Lazy<Optional<SplitScreenController>> splitScreenOptional,
|
||||
DisplayInsetsController displayInsetsController
|
||||
@@ -577,7 +579,7 @@ public abstract class WMShellModule {
|
||||
// controller directly once we refactor ShellTaskOrganizer to not depend on the unfold
|
||||
// animation controller directly.
|
||||
return new SplitTaskUnfoldAnimator(context, executor, splitScreenOptional,
|
||||
backgroundController, displayInsetsController);
|
||||
shellController, backgroundController, displayInsetsController);
|
||||
}
|
||||
|
||||
@WMSingleton
|
||||
|
||||
@@ -26,8 +26,10 @@ import android.animation.TypeEvaluator;
|
||||
import android.annotation.NonNull;
|
||||
import android.app.TaskInfo;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Trace;
|
||||
import android.util.SparseArray;
|
||||
import android.view.InsetsSource;
|
||||
import android.view.InsetsState;
|
||||
@@ -36,6 +38,8 @@ import android.view.SurfaceControl.Transaction;
|
||||
|
||||
import com.android.internal.policy.ScreenDecorationsUtils;
|
||||
import com.android.wm.shell.common.DisplayInsetsController;
|
||||
import com.android.wm.shell.sysui.ConfigurationChangeListener;
|
||||
import com.android.wm.shell.sysui.ShellController;
|
||||
import com.android.wm.shell.unfold.UnfoldAnimationController;
|
||||
import com.android.wm.shell.unfold.UnfoldBackgroundController;
|
||||
|
||||
@@ -51,7 +55,7 @@ import com.android.wm.shell.unfold.UnfoldBackgroundController;
|
||||
* instances of FullscreenUnfoldTaskAnimator.
|
||||
*/
|
||||
public class FullscreenUnfoldTaskAnimator implements UnfoldTaskAnimator,
|
||||
DisplayInsetsController.OnInsetsChangedListener {
|
||||
DisplayInsetsController.OnInsetsChangedListener, ConfigurationChangeListener {
|
||||
|
||||
private static final float[] FLOAT_9 = new float[9];
|
||||
private static final TypeEvaluator<Rect> RECT_EVALUATOR = new RectEvaluator(new Rect());
|
||||
@@ -63,17 +67,21 @@ public class FullscreenUnfoldTaskAnimator implements UnfoldTaskAnimator,
|
||||
|
||||
private final SparseArray<AnimationContext> mAnimationContextByTaskId = new SparseArray<>();
|
||||
private final int mExpandedTaskBarHeight;
|
||||
private final float mWindowCornerRadiusPx;
|
||||
private final DisplayInsetsController mDisplayInsetsController;
|
||||
private final UnfoldBackgroundController mBackgroundController;
|
||||
private final Context mContext;
|
||||
private final ShellController mShellController;
|
||||
|
||||
private InsetsSource mTaskbarInsetsSource;
|
||||
private float mWindowCornerRadiusPx;
|
||||
|
||||
public FullscreenUnfoldTaskAnimator(Context context,
|
||||
@NonNull UnfoldBackgroundController backgroundController,
|
||||
DisplayInsetsController displayInsetsController) {
|
||||
ShellController shellController, DisplayInsetsController displayInsetsController) {
|
||||
mContext = context;
|
||||
mDisplayInsetsController = displayInsetsController;
|
||||
mBackgroundController = backgroundController;
|
||||
mShellController = shellController;
|
||||
mExpandedTaskBarHeight = context.getResources().getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.taskbar_frame_height);
|
||||
mWindowCornerRadiusPx = ScreenDecorationsUtils.getWindowCornerRadius(context);
|
||||
@@ -81,6 +89,14 @@ public class FullscreenUnfoldTaskAnimator implements UnfoldTaskAnimator,
|
||||
|
||||
public void init() {
|
||||
mDisplayInsetsController.addInsetsChangedListener(DEFAULT_DISPLAY, this);
|
||||
mShellController.addConfigurationChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfiguration) {
|
||||
Trace.beginSection("FullscreenUnfoldTaskAnimator#onConfigurationChanged");
|
||||
mWindowCornerRadiusPx = ScreenDecorationsUtils.getWindowCornerRadius(mContext);
|
||||
Trace.endSection();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,8 +28,10 @@ import android.animation.RectEvaluator;
|
||||
import android.animation.TypeEvaluator;
|
||||
import android.app.TaskInfo;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Insets;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Trace;
|
||||
import android.util.SparseArray;
|
||||
import android.view.InsetsSource;
|
||||
import android.view.InsetsState;
|
||||
@@ -42,6 +44,8 @@ import com.android.wm.shell.common.split.SplitScreenConstants.SplitPosition;
|
||||
import com.android.wm.shell.splitscreen.SplitScreen;
|
||||
import com.android.wm.shell.splitscreen.SplitScreen.SplitScreenListener;
|
||||
import com.android.wm.shell.splitscreen.SplitScreenController;
|
||||
import com.android.wm.shell.sysui.ConfigurationChangeListener;
|
||||
import com.android.wm.shell.sysui.ShellController;
|
||||
import com.android.wm.shell.unfold.UnfoldAnimationController;
|
||||
import com.android.wm.shell.unfold.UnfoldBackgroundController;
|
||||
|
||||
@@ -62,16 +66,18 @@ import dagger.Lazy;
|
||||
* They use independent instances of SplitTaskUnfoldAnimator.
|
||||
*/
|
||||
public class SplitTaskUnfoldAnimator implements UnfoldTaskAnimator,
|
||||
DisplayInsetsController.OnInsetsChangedListener, SplitScreenListener {
|
||||
DisplayInsetsController.OnInsetsChangedListener, SplitScreenListener,
|
||||
ConfigurationChangeListener {
|
||||
|
||||
private static final TypeEvaluator<Rect> RECT_EVALUATOR = new RectEvaluator(new Rect());
|
||||
private static final float CROPPING_START_MARGIN_FRACTION = 0.05f;
|
||||
|
||||
private final Context mContext;
|
||||
private final Executor mExecutor;
|
||||
private final DisplayInsetsController mDisplayInsetsController;
|
||||
private final SparseArray<AnimationContext> mAnimationContextByTaskId = new SparseArray<>();
|
||||
private final int mExpandedTaskBarHeight;
|
||||
private final float mWindowCornerRadiusPx;
|
||||
private final ShellController mShellController;
|
||||
private final Lazy<Optional<SplitScreenController>> mSplitScreenController;
|
||||
private final UnfoldBackgroundController mUnfoldBackgroundController;
|
||||
|
||||
@@ -79,6 +85,7 @@ public class SplitTaskUnfoldAnimator implements UnfoldTaskAnimator,
|
||||
private final Rect mSideStageBounds = new Rect();
|
||||
private final Rect mRootStageBounds = new Rect();
|
||||
|
||||
private float mWindowCornerRadiusPx;
|
||||
private InsetsSource mTaskbarInsetsSource;
|
||||
|
||||
@SplitPosition
|
||||
@@ -88,10 +95,12 @@ public class SplitTaskUnfoldAnimator implements UnfoldTaskAnimator,
|
||||
|
||||
public SplitTaskUnfoldAnimator(Context context, Executor executor,
|
||||
Lazy<Optional<SplitScreenController>> splitScreenController,
|
||||
UnfoldBackgroundController unfoldBackgroundController,
|
||||
ShellController shellController, UnfoldBackgroundController unfoldBackgroundController,
|
||||
DisplayInsetsController displayInsetsController) {
|
||||
mDisplayInsetsController = displayInsetsController;
|
||||
mExecutor = executor;
|
||||
mContext = context;
|
||||
mShellController = shellController;
|
||||
mUnfoldBackgroundController = unfoldBackgroundController;
|
||||
mSplitScreenController = splitScreenController;
|
||||
mExpandedTaskBarHeight = context.getResources().getDimensionPixelSize(
|
||||
@@ -103,6 +112,14 @@ public class SplitTaskUnfoldAnimator implements UnfoldTaskAnimator,
|
||||
@Override
|
||||
public void init() {
|
||||
mDisplayInsetsController.addInsetsChangedListener(DEFAULT_DISPLAY, this);
|
||||
mShellController.addConfigurationChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfiguration) {
|
||||
Trace.beginSection("SplitTaskUnfoldAnimator#onConfigurationChanged");
|
||||
mWindowCornerRadiusPx = ScreenDecorationsUtils.getWindowCornerRadius(mContext);
|
||||
Trace.endSection();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user