Snap for 13294094 from 73818a634d to 25Q3-release
Change-Id: I2323d85b264dd56ece973b6a742bbbb8145aee93
This commit is contained in:
commit
bde7ad1a32
20 files changed
+221
-230
No files matched your search
@@ -43,6 +43,7 @@ import android.view.WindowManager
|
||||
import android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD
|
||||
import android.view.WindowManager.LayoutParams.TYPE_VOICE_INTERACTION
|
||||
import androidx.core.graphics.toRegion
|
||||
import com.android.app.tracing.traceSection
|
||||
import com.android.internal.policy.GestureNavigationSettingsObserver
|
||||
import com.android.launcher3.DeviceProfile
|
||||
import com.android.launcher3.R
|
||||
@@ -61,6 +62,7 @@ class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTas
|
||||
companion object {
|
||||
private const val INDEX_LEFT = 0
|
||||
private const val INDEX_RIGHT = 1
|
||||
private const val TAG = "TaskbarInsetsController"
|
||||
|
||||
private fun Region.addBoundsToRegion(bounds: Rect?) {
|
||||
bounds?.let { op(it, Region.Op.UNION) }
|
||||
@@ -102,76 +104,82 @@ class TaskbarInsetsController(val context: TaskbarActivityContext) : LoggableTas
|
||||
gestureNavSettingsObserver.unregister()
|
||||
}
|
||||
|
||||
fun onTaskbarOrBubblebarWindowHeightOrInsetsChanged() {
|
||||
val taskbarStashController = controllers.taskbarStashController
|
||||
val tappableHeight = taskbarStashController.tappableHeightToReportToApps
|
||||
// We only report tappableElement height for unstashed, persistent taskbar,
|
||||
// which is also when we draw the rounded corners above taskbar.
|
||||
val insetsRoundedCornerFlag =
|
||||
if (tappableHeight > 0) {
|
||||
FLAG_INSETS_ROUNDED_CORNER
|
||||
} else {
|
||||
0
|
||||
fun onTaskbarOrBubblebarWindowHeightOrInsetsChanged() =
|
||||
traceSection("$TAG.onTaskbarOrBubblebarWindowHeightOrInsetsChanged") {
|
||||
val taskbarStashController = controllers.taskbarStashController
|
||||
val tappableHeight = taskbarStashController.tappableHeightToReportToApps
|
||||
// We only report tappableElement height for unstashed, persistent taskbar,
|
||||
// which is also when we draw the rounded corners above taskbar.
|
||||
val insetsRoundedCornerFlag =
|
||||
if (tappableHeight > 0) {
|
||||
FLAG_INSETS_ROUNDED_CORNER
|
||||
} else {
|
||||
0
|
||||
}
|
||||
|
||||
windowLayoutParams.providedInsets =
|
||||
if (enableTaskbarNoRecreate() && controllers.sharedState != null) {
|
||||
getProvidedInsets(
|
||||
controllers.sharedState!!.insetsFrameProviders,
|
||||
insetsRoundedCornerFlag,
|
||||
)
|
||||
} else {
|
||||
getProvidedInsets(insetsRoundedCornerFlag)
|
||||
}
|
||||
|
||||
if (windowLayoutParams.paramsForRotation != null) {
|
||||
for (layoutParams in windowLayoutParams.paramsForRotation) {
|
||||
layoutParams.providedInsets = getProvidedInsets(insetsRoundedCornerFlag)
|
||||
}
|
||||
}
|
||||
|
||||
windowLayoutParams.providedInsets =
|
||||
if (enableTaskbarNoRecreate() && controllers.sharedState != null) {
|
||||
getProvidedInsets(
|
||||
controllers.sharedState!!.insetsFrameProviders,
|
||||
insetsRoundedCornerFlag,
|
||||
)
|
||||
} else {
|
||||
getProvidedInsets(insetsRoundedCornerFlag)
|
||||
val bubbleControllers = controllers.bubbleControllers.getOrNull()
|
||||
val taskbarTouchableHeight = taskbarStashController.touchableHeight
|
||||
val bubblesTouchableHeight =
|
||||
bubbleControllers?.bubbleStashController?.getTouchableHeight() ?: 0
|
||||
// reset touch bounds
|
||||
defaultTouchableRegion.setEmpty()
|
||||
if (bubbleControllers != null) {
|
||||
val bubbleBarViewController = bubbleControllers.bubbleBarViewController
|
||||
val isBubbleBarVisible =
|
||||
bubbleControllers.bubbleStashController.isBubbleBarVisible()
|
||||
val isAnimatingNewBubble = bubbleBarViewController.isAnimatingNewBubble
|
||||
// if bubble bar is visible or animating new bubble, add bar bounds to the touch
|
||||
// region
|
||||
if (isBubbleBarVisible || isAnimatingNewBubble) {
|
||||
defaultTouchableRegion.addBoundsToRegion(
|
||||
bubbleBarViewController.bubbleBarBounds
|
||||
)
|
||||
defaultTouchableRegion.addBoundsToRegion(bubbleBarViewController.flyoutBounds)
|
||||
}
|
||||
}
|
||||
if (
|
||||
taskbarStashController.isInApp ||
|
||||
controllers.uiController.isInOverviewUi ||
|
||||
context.showLockedTaskbarOnHome()
|
||||
) {
|
||||
// only add the taskbar touch region if not on home
|
||||
val bottom = windowLayoutParams.height
|
||||
val top = bottom - taskbarTouchableHeight
|
||||
val right = context.deviceProfile.widthPx
|
||||
defaultTouchableRegion.addBoundsToRegion(Rect(/* left= */ 0, top, right, bottom))
|
||||
}
|
||||
|
||||
if (windowLayoutParams.paramsForRotation != null) {
|
||||
for (layoutParams in windowLayoutParams.paramsForRotation) {
|
||||
layoutParams.providedInsets = getProvidedInsets(insetsRoundedCornerFlag)
|
||||
// Pre-calculate insets for different providers across different rotations for this
|
||||
// gravity
|
||||
for (rotation in Surface.ROTATION_0..Surface.ROTATION_270) {
|
||||
// Add insets for navbar rotated params
|
||||
val layoutParams = windowLayoutParams.paramsForRotation[rotation]
|
||||
for (provider in layoutParams.providedInsets) {
|
||||
setProviderInsets(provider, layoutParams.gravity, rotation)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val bubbleControllers = controllers.bubbleControllers.getOrNull()
|
||||
val taskbarTouchableHeight = taskbarStashController.touchableHeight
|
||||
val bubblesTouchableHeight =
|
||||
bubbleControllers?.bubbleStashController?.getTouchableHeight() ?: 0
|
||||
// reset touch bounds
|
||||
defaultTouchableRegion.setEmpty()
|
||||
if (bubbleControllers != null) {
|
||||
val bubbleBarViewController = bubbleControllers.bubbleBarViewController
|
||||
val isBubbleBarVisible = bubbleControllers.bubbleStashController.isBubbleBarVisible()
|
||||
val isAnimatingNewBubble = bubbleBarViewController.isAnimatingNewBubble
|
||||
// if bubble bar is visible or animating new bubble, add bar bounds to the touch region
|
||||
if (isBubbleBarVisible || isAnimatingNewBubble) {
|
||||
defaultTouchableRegion.addBoundsToRegion(bubbleBarViewController.bubbleBarBounds)
|
||||
defaultTouchableRegion.addBoundsToRegion(bubbleBarViewController.flyoutBounds)
|
||||
// Also set the parent providers (i.e. not in paramsForRotation).
|
||||
for (provider in windowLayoutParams.providedInsets) {
|
||||
setProviderInsets(provider, windowLayoutParams.gravity, context.display.rotation)
|
||||
}
|
||||
context.notifyUpdateLayoutParams()
|
||||
}
|
||||
if (
|
||||
taskbarStashController.isInApp ||
|
||||
controllers.uiController.isInOverviewUi ||
|
||||
context.showLockedTaskbarOnHome()
|
||||
) {
|
||||
// only add the taskbar touch region if not on home
|
||||
val bottom = windowLayoutParams.height
|
||||
val top = bottom - taskbarTouchableHeight
|
||||
val right = context.deviceProfile.widthPx
|
||||
defaultTouchableRegion.addBoundsToRegion(Rect(/* left= */ 0, top, right, bottom))
|
||||
}
|
||||
|
||||
// Pre-calculate insets for different providers across different rotations for this gravity
|
||||
for (rotation in Surface.ROTATION_0..Surface.ROTATION_270) {
|
||||
// Add insets for navbar rotated params
|
||||
val layoutParams = windowLayoutParams.paramsForRotation[rotation]
|
||||
for (provider in layoutParams.providedInsets) {
|
||||
setProviderInsets(provider, layoutParams.gravity, rotation)
|
||||
}
|
||||
}
|
||||
// Also set the parent providers (i.e. not in paramsForRotation).
|
||||
for (provider in windowLayoutParams.providedInsets) {
|
||||
setProviderInsets(provider, windowLayoutParams.gravity, context.display.rotation)
|
||||
}
|
||||
context.notifyUpdateLayoutParams()
|
||||
}
|
||||
|
||||
/**
|
||||
* This is for when ENABLE_TASKBAR_NO_RECREATION is enabled. We generate one instance of
|
||||
|
||||
@@ -1768,8 +1768,10 @@ public abstract class AbsSwipeUpHandler<
|
||||
mLauncherTransitionController = null;
|
||||
|
||||
if (mRecentsView != null) {
|
||||
mRecentsView.onPrepareGestureEndAnimation(null, mGestureState.getEndTarget(),
|
||||
mRemoteTargetHandles);
|
||||
AnimatorSet animatorSet = new AnimatorSet();
|
||||
mRecentsView.onPrepareGestureEndAnimation(animatorSet, mGestureState.getEndTarget(),
|
||||
mRemoteTargetHandles, /* isHandlingAtomicEvent= */ true);
|
||||
animatorSet.setDuration(0).start();
|
||||
}
|
||||
} else {
|
||||
AnimatorSet animatorSet = new AnimatorSet();
|
||||
@@ -1811,9 +1813,10 @@ public abstract class AbsSwipeUpHandler<
|
||||
animatorSet.play(windowAnim);
|
||||
if (mRecentsView != null) {
|
||||
mRecentsView.onPrepareGestureEndAnimation(
|
||||
mGestureState.isHandlingAtomicEvent() ? null : animatorSet,
|
||||
animatorSet,
|
||||
mGestureState.getEndTarget(),
|
||||
mRemoteTargetHandles);
|
||||
mRemoteTargetHandles,
|
||||
mGestureState.isHandlingAtomicEvent());
|
||||
}
|
||||
animatorSet.setDuration(duration).setInterpolator(interpolator);
|
||||
animatorSet.start();
|
||||
|
||||
@@ -102,7 +102,7 @@ import java.util.List;
|
||||
* See {@link com.android.quickstep.views.RecentsView}.
|
||||
*/
|
||||
public final class RecentsActivity extends StatefulActivity<RecentsState> implements
|
||||
RecentsViewContainer {
|
||||
RecentsViewContainer, InvariantDeviceProfile.OnIDPChangeListener {
|
||||
private static final String TAG = "RecentsActivity";
|
||||
|
||||
public static final ContextTracker.ActivityTracker<RecentsActivity> ACTIVITY_TRACKER =
|
||||
@@ -378,6 +378,7 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> implem
|
||||
mStateManager = new StateManager<>(this, RecentsState.BG_LAUNCHER);
|
||||
|
||||
initDeviceProfile();
|
||||
InvariantDeviceProfile.INSTANCE.get(this).addOnChangeListener(this);
|
||||
setupViews();
|
||||
|
||||
getSystemUiController().updateUiState(SystemUiController.UI_STATE_BASE_WINDOW,
|
||||
@@ -463,6 +464,7 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> implem
|
||||
mActivityLaunchAnimationRunner = null;
|
||||
mSplitSelectStateController.onDestroy();
|
||||
mTISBindHelper.onDestroy();
|
||||
InvariantDeviceProfile.INSTANCE.get(this).removeOnChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -555,4 +557,9 @@ public final class RecentsActivity extends StatefulActivity<RecentsState> implem
|
||||
public boolean isRecentsViewVisible() {
|
||||
return getStateManager().getState().isRecentsViewVisible();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIdpChanged(boolean modelPropertiesChanged) {
|
||||
onHandleConfigurationChanged();
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,8 @@ public abstract class SwipeUpAnimationLogic implements
|
||||
PendingAnimation pendingAnimation = new PendingAnimation(mTransitionDragLength * 2);
|
||||
TaskViewSimulator taskViewSimulator = remoteHandle.getTaskViewSimulator();
|
||||
taskViewSimulator.setDp(dp);
|
||||
taskViewSimulator.addAppToCarouselAnim(pendingAnimation, LINEAR);
|
||||
taskViewSimulator.addAppToCarouselAnim(pendingAnimation, LINEAR,
|
||||
mGestureState.isHandlingAtomicEvent());
|
||||
AnimatorPlaybackController playbackController =
|
||||
pendingAnimation.createPlaybackController();
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import static com.android.quickstep.fallback.RecentsState.DEFAULT;
|
||||
import static com.android.quickstep.fallback.RecentsState.MODAL_TASK;
|
||||
import static com.android.quickstep.fallback.RecentsState.OVERVIEW_SPLIT_SELECT;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorSet;
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
@@ -134,9 +133,10 @@ public class FallbackRecentsView<CONTAINER_TYPE extends Context & RecentsViewCon
|
||||
*/
|
||||
@Override
|
||||
public void onPrepareGestureEndAnimation(
|
||||
@Nullable AnimatorSet animatorSet, GestureState.GestureEndTarget endTarget,
|
||||
RemoteTargetHandle[] remoteTargetHandles) {
|
||||
super.onPrepareGestureEndAnimation(animatorSet, endTarget, remoteTargetHandles);
|
||||
AnimatorSet animatorSet, GestureState.GestureEndTarget endTarget,
|
||||
RemoteTargetHandle[] remoteTargetHandles, boolean isHandlingAtomicEvent) {
|
||||
super.onPrepareGestureEndAnimation(animatorSet, endTarget, remoteTargetHandles,
|
||||
isHandlingAtomicEvent);
|
||||
if (mHomeTask != null && endTarget == RECENTS) {
|
||||
TaskView homeTaskView = getTaskViewByTaskId(mHomeTask.key.id);
|
||||
if (homeTaskView != null) {
|
||||
@@ -147,12 +147,7 @@ public class FallbackRecentsView<CONTAINER_TYPE extends Context & RecentsViewCon
|
||||
pendingAnimation.addEndListener(e -> setCurrentTask(-1));
|
||||
AnimatorPlaybackController controller = pendingAnimation.createPlaybackController();
|
||||
controller.dispatchOnStart();
|
||||
Animator homeDismissAnimator = controller.getAnimationPlayer();
|
||||
if (animatorSet != null) {
|
||||
animatorSet.play(homeDismissAnimator);
|
||||
} else {
|
||||
homeDismissAnimator.setDuration(0).start();
|
||||
}
|
||||
animatorSet.play(controller.getAnimationPlayer());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,11 +87,6 @@ class TaskThumbnailView : FrameLayout, ViewPool.Reusable {
|
||||
defStyleAttr: Int,
|
||||
) : super(context, attrs, defStyleAttr)
|
||||
|
||||
override fun onFinishInflate() {
|
||||
super.onFinishInflate()
|
||||
maybeCreateHeader()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
clipToOutline = true
|
||||
@@ -198,6 +193,7 @@ class TaskThumbnailView : FrameLayout, ViewPool.Reusable {
|
||||
liveTileView.isInvisible = false
|
||||
|
||||
if (liveTile is LiveTile.WithHeader) {
|
||||
maybeCreateHeader()
|
||||
taskThumbnailViewHeader?.isInvisible = false
|
||||
taskThumbnailViewHeader?.setHeader(liveTile.header)
|
||||
}
|
||||
@@ -213,6 +209,7 @@ class TaskThumbnailView : FrameLayout, ViewPool.Reusable {
|
||||
|
||||
private fun drawSnapshot(snapshot: Snapshot) {
|
||||
if (snapshot is Snapshot.WithHeader) {
|
||||
maybeCreateHeader()
|
||||
taskThumbnailViewHeader?.isInvisible = false
|
||||
taskThumbnailViewHeader?.setHeader(snapshot.header)
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public class BaseDepthController {
|
||||
|
||||
public BaseDepthController(Launcher activity) {
|
||||
mLauncher = activity;
|
||||
if (Flags.allAppsBlur()) {
|
||||
if (Flags.allAppsBlur() || enableOverviewBackgroundWallpaperBlur()) {
|
||||
mMaxBlurRadius = activity.getResources().getDimensionPixelSize(
|
||||
R.dimen.max_depth_blur_radius_enhanced);
|
||||
} else {
|
||||
|
||||
@@ -253,6 +253,7 @@ class ScalingWorkspaceRevealAnim(
|
||||
Animations.setOngoingAnimation(launcher.workspace, animators)
|
||||
Animations.setOngoingAnimation(launcher.hotseat, animators)
|
||||
}
|
||||
launcher.stateManager.setCurrentAnimation(animators, LauncherState.NORMAL)
|
||||
animators.start()
|
||||
}
|
||||
}
|
||||
@@ -317,9 +317,10 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
|
||||
/**
|
||||
* Adds animation for all the components corresponding to transition from an app to carousel.
|
||||
*/
|
||||
public void addAppToCarouselAnim(PendingAnimation pa, Interpolator interpolator) {
|
||||
public void addAppToCarouselAnim(PendingAnimation pa, Interpolator interpolator,
|
||||
boolean isHandlingAtomicEvent) {
|
||||
pa.addFloat(fullScreenProgress, AnimatedFloat.VALUE, 1, 0, interpolator);
|
||||
if (enableGridOnlyOverview() && mDp.isTablet && mDp.isGestureMode) {
|
||||
if (enableGridOnlyOverview() && mDp.isTablet && !isHandlingAtomicEvent) {
|
||||
mIsAnimatingToCarousel = true;
|
||||
carouselScale.value = mCarouselTaskSize.width() / (float) mFullTaskSize.width();
|
||||
}
|
||||
|
||||
@@ -101,8 +101,8 @@ constructor(
|
||||
resources.getDimensionPixelSize(R.dimen.task_thumbnail_icon_view_start_margin)
|
||||
private val appIconSize =
|
||||
resources.getDimensionPixelSize(R.dimen.task_thumbnail_icon_menu_app_icon_collapsed_size)
|
||||
private val expandedMaxTextWidth =
|
||||
resources.getDimensionPixelSize(R.dimen.task_thumbnail_icon_menu_text_expanded_max_width)
|
||||
private val iconMenuElevation =
|
||||
resources.getDimension(R.dimen.task_thumbnail_icon_menu_elevation)
|
||||
private val arrowSize =
|
||||
resources.getDimensionPixelSize(R.dimen.task_thumbnail_icon_menu_arrow_size)
|
||||
private val iconViewDrawableExpandedSize =
|
||||
@@ -507,19 +507,19 @@ constructor(
|
||||
|
||||
override fun bringToFront() {
|
||||
super.bringToFront()
|
||||
z += Z_INDEX_FRONT
|
||||
z = iconMenuElevation + Z_INDEX_FRONT
|
||||
updateParentZIndex(Z_INDEX_FRONT)
|
||||
}
|
||||
|
||||
private fun sendToBack() {
|
||||
z -= Z_INDEX_FRONT
|
||||
updateParentZIndex(-Z_INDEX_FRONT)
|
||||
z = iconMenuElevation
|
||||
updateParentZIndex(0f)
|
||||
}
|
||||
|
||||
private fun updateParentZIndex(zIndex: Float) {
|
||||
val parentView = parent as? TaskView
|
||||
if (parentView?.isOnGridBottomRow == true) {
|
||||
parentView.z += zIndex
|
||||
parentView.z = zIndex
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2970,87 +2970,10 @@ public abstract class RecentsView<
|
||||
* Called when a gesture from an app has finished, and an end target has been determined.
|
||||
*/
|
||||
public void onPrepareGestureEndAnimation(
|
||||
@Nullable AnimatorSet animatorSet, GestureState.GestureEndTarget endTarget,
|
||||
RemoteTargetHandle[] remoteTargetHandles) {
|
||||
Log.d(TAG, "onPrepareGestureEndAnimation - endTarget: " + endTarget);
|
||||
mCurrentGestureEndTarget = endTarget;
|
||||
boolean isOverviewEndTarget = endTarget == GestureState.GestureEndTarget.RECENTS;
|
||||
if (isOverviewEndTarget) {
|
||||
updateGridProperties();
|
||||
}
|
||||
|
||||
BaseState<?> endState = mSizeStrategy.stateFromGestureEndTarget(endTarget);
|
||||
// Starting the desk exploded animation when the gesture from an app is released.
|
||||
if (enableDesktopExplodedView()) {
|
||||
if (animatorSet == null) {
|
||||
mUtils.setDeskExplodeProgress(endState.showExplodedDesktopView() ? 1f : 0f);
|
||||
} else {
|
||||
animatorSet.play(
|
||||
ObjectAnimator.ofFloat(this, DESK_EXPLODE_PROGRESS,
|
||||
endState.showExplodedDesktopView() ? 1f : 0f));
|
||||
}
|
||||
|
||||
for (TaskView taskView : getTaskViews()) {
|
||||
if (taskView instanceof DesktopTaskView desktopTaskView) {
|
||||
desktopTaskView.setRemoteTargetHandles(remoteTargetHandles);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (endState.displayOverviewTasksAsGrid(mContainer.getDeviceProfile())) {
|
||||
TaskView runningTaskView = getRunningTaskView();
|
||||
float runningTaskGridTranslationX = 0;
|
||||
float runningTaskGridTranslationY = 0;
|
||||
if (runningTaskView != null) {
|
||||
// Apply the grid translation to running task unless it's being snapped to
|
||||
// and removes the current translation applied to the running task.
|
||||
runningTaskGridTranslationX = runningTaskView.getGridTranslationX()
|
||||
- runningTaskView.getNonGridTranslationX();
|
||||
runningTaskGridTranslationY = runningTaskView.getGridTranslationY();
|
||||
}
|
||||
for (RemoteTargetHandle remoteTargetHandle : remoteTargetHandles) {
|
||||
TaskViewSimulator tvs = remoteTargetHandle.getTaskViewSimulator();
|
||||
if (animatorSet == null) {
|
||||
setGridProgress(1);
|
||||
if (enableGridOnlyOverview()) {
|
||||
tvs.taskGridTranslationX.value = runningTaskGridTranslationX;
|
||||
tvs.taskGridTranslationY.value = runningTaskGridTranslationY;
|
||||
} else {
|
||||
tvs.taskPrimaryTranslation.value = runningTaskGridTranslationX;
|
||||
tvs.taskSecondaryTranslation.value = runningTaskGridTranslationY;
|
||||
}
|
||||
} else {
|
||||
animatorSet.play(ObjectAnimator.ofFloat(this, RECENTS_GRID_PROGRESS, 1));
|
||||
if (enableGridOnlyOverview()) {
|
||||
animatorSet.play(tvs.carouselScale.animateToValue(1));
|
||||
animatorSet.play(tvs.taskGridTranslationX.animateToValue(
|
||||
runningTaskGridTranslationX));
|
||||
animatorSet.play(tvs.taskGridTranslationY.animateToValue(
|
||||
runningTaskGridTranslationY));
|
||||
} else {
|
||||
animatorSet.play(tvs.taskPrimaryTranslation.animateToValue(
|
||||
runningTaskGridTranslationX));
|
||||
animatorSet.play(tvs.taskSecondaryTranslation.animateToValue(
|
||||
runningTaskGridTranslationY));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
int splashAlpha = endState.showTaskThumbnailSplash() ? 1 : 0;
|
||||
if (animatorSet == null) {
|
||||
setTaskThumbnailSplashAlpha(splashAlpha);
|
||||
} else {
|
||||
animatorSet.play(
|
||||
ObjectAnimator.ofFloat(this, TASK_THUMBNAIL_SPLASH_ALPHA, splashAlpha));
|
||||
}
|
||||
if (enableLargeDesktopWindowingTile()) {
|
||||
if (animatorSet != null) {
|
||||
animatorSet.play(
|
||||
ObjectAnimator.ofFloat(this, DESKTOP_CAROUSEL_DETACH_PROGRESS, 0f));
|
||||
} else {
|
||||
DESKTOP_CAROUSEL_DETACH_PROGRESS.set(this, 0f);
|
||||
}
|
||||
}
|
||||
AnimatorSet animatorSet, GestureState.GestureEndTarget endTarget,
|
||||
RemoteTargetHandle[] remoteTargetHandles, boolean isHandlingAtomicEvent) {
|
||||
mUtils.onPrepareGestureEndAnimation(animatorSet, endTarget, remoteTargetHandles,
|
||||
isHandlingAtomicEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3299,7 +3222,7 @@ public abstract class RecentsView<
|
||||
*
|
||||
* Skips rebalance.
|
||||
*/
|
||||
private void updateGridProperties() {
|
||||
protected void updateGridProperties() {
|
||||
updateGridProperties(null);
|
||||
}
|
||||
|
||||
@@ -4707,7 +4630,7 @@ public abstract class RecentsView<
|
||||
|
||||
/** Dismisses the entire [taskView]. */
|
||||
public void dismissTaskView(TaskView taskView, boolean animateTaskView, boolean removeTask) {
|
||||
if (enableExpressiveDismissTaskMotion()) {
|
||||
if (enableExpressiveDismissTaskMotion() && (!showAsGrid() || enableGridOnlyOverview())) {
|
||||
mDismissUtils.createTaskDismissSettlingSpringAnimation(taskView);
|
||||
} else {
|
||||
PendingAnimation pa = new PendingAnimation(DISMISS_TASK_DURATION);
|
||||
@@ -4813,6 +4736,8 @@ public abstract class RecentsView<
|
||||
if (alpha == mContentAlpha) {
|
||||
return;
|
||||
}
|
||||
|
||||
traceBegin(Trace.TRACE_TAG_APP, "RecentsView.setContentAlpha");
|
||||
alpha = Utilities.boundToRange(alpha, 0, 1);
|
||||
mContentAlpha = alpha;
|
||||
|
||||
@@ -4834,6 +4759,7 @@ public abstract class RecentsView<
|
||||
} else if (!mFreezeViewVisibility) {
|
||||
setVisibility(INVISIBLE);
|
||||
}
|
||||
traceEnd(Trace.TRACE_TAG_APP);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,10 +16,13 @@
|
||||
|
||||
package com.android.quickstep.views
|
||||
|
||||
import android.animation.AnimatorSet
|
||||
import android.animation.ObjectAnimator
|
||||
import android.graphics.PointF
|
||||
import android.graphics.Rect
|
||||
import android.util.FloatProperty
|
||||
import android.util.Log
|
||||
import android.util.Property
|
||||
import android.view.KeyEvent
|
||||
import android.view.View
|
||||
import android.view.View.LAYOUT_DIRECTION_LTR
|
||||
@@ -27,6 +30,7 @@ import android.view.View.LAYOUT_DIRECTION_RTL
|
||||
import androidx.core.view.children
|
||||
import com.android.launcher3.AbstractFloatingView.TYPE_TASK_MENU
|
||||
import com.android.launcher3.AbstractFloatingView.getTopOpenViewWithType
|
||||
import com.android.launcher3.Flags.enableDesktopExplodedView
|
||||
import com.android.launcher3.Flags.enableGridOnlyOverview
|
||||
import com.android.launcher3.Flags.enableLargeDesktopWindowingTile
|
||||
import com.android.launcher3.Flags.enableOverviewIconMenu
|
||||
@@ -34,14 +38,20 @@ import com.android.launcher3.Flags.enableSeparateExternalDisplayTasks
|
||||
import com.android.launcher3.Utilities.getPivotsForScalingRectToRect
|
||||
import com.android.launcher3.statehandlers.DesktopVisibilityController
|
||||
import com.android.launcher3.statehandlers.DesktopVisibilityController.Companion.INACTIVE_DESK_ID
|
||||
import com.android.launcher3.statemanager.BaseState
|
||||
import com.android.launcher3.util.IntArray
|
||||
import com.android.launcher3.util.window.WindowManagerProxy.DesktopVisibilityListener
|
||||
import com.android.quickstep.GestureState
|
||||
import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle
|
||||
import com.android.quickstep.util.DesksUtils.Companion.areMultiDesksFlagsEnabled
|
||||
import com.android.quickstep.util.DesktopTask
|
||||
import com.android.quickstep.util.GroupTask
|
||||
import com.android.quickstep.util.isExternalDisplay
|
||||
import com.android.quickstep.views.RecentsView.DESKTOP_CAROUSEL_DETACH_PROGRESS
|
||||
import com.android.quickstep.views.RecentsView.RECENTS_GRID_PROGRESS
|
||||
import com.android.quickstep.views.RecentsView.RUNNING_TASK_ATTACH_ALPHA
|
||||
import com.android.quickstep.views.RecentsView.TAG
|
||||
import com.android.quickstep.views.RecentsView.TASK_THUMBNAIL_SPLASH_ALPHA
|
||||
import com.android.systemui.shared.recents.model.Task
|
||||
import com.android.systemui.shared.recents.model.ThumbnailData
|
||||
import com.android.wm.shell.shared.GroupedTaskInfo
|
||||
@@ -563,6 +573,97 @@ class RecentsViewUtils(private val recentsView: RecentsView<*, *>) : DesktopVisi
|
||||
return matchingTaskView == null
|
||||
}
|
||||
|
||||
fun onPrepareGestureEndAnimation(
|
||||
animatorSet: AnimatorSet,
|
||||
endTarget: GestureState.GestureEndTarget,
|
||||
remoteTargetHandles: Array<RemoteTargetHandle>,
|
||||
isHandlingAtomicEvent: Boolean,
|
||||
) {
|
||||
// Create ObjectAnimator that immediately settles on [endStateValue] when
|
||||
// [isHandlingAtomicEvent] is true.
|
||||
fun <T> immediateObjectAnimator(
|
||||
target: T,
|
||||
property: Property<T, Float>,
|
||||
endStateValue: Float,
|
||||
) =
|
||||
if (isHandlingAtomicEvent)
|
||||
ObjectAnimator.ofFloat(target, property, endStateValue, endStateValue)
|
||||
else ObjectAnimator.ofFloat(target, property, endStateValue)
|
||||
|
||||
with(recentsView) {
|
||||
Log.d(TAG, "onPrepareGestureEndAnimation - endTarget: $endTarget")
|
||||
mCurrentGestureEndTarget = endTarget
|
||||
val endState: BaseState<*> = mSizeStrategy.stateFromGestureEndTarget(endTarget)
|
||||
|
||||
// Starting the desk exploded animation when the gesture from an app is released.
|
||||
if (enableDesktopExplodedView()) {
|
||||
animatorSet.play(
|
||||
ObjectAnimator.ofFloat(
|
||||
this,
|
||||
DESK_EXPLODE_PROGRESS,
|
||||
if (endState.showExplodedDesktopView()) 1f else 0f,
|
||||
)
|
||||
)
|
||||
taskViews.filterIsInstance<DesktopTaskView>().forEach {
|
||||
it.remoteTargetHandles = remoteTargetHandles
|
||||
}
|
||||
}
|
||||
|
||||
if (endState.displayOverviewTasksAsGrid(getDeviceProfile())) {
|
||||
updateGridProperties()
|
||||
animatorSet.play(immediateObjectAnimator(this, RECENTS_GRID_PROGRESS, 1f))
|
||||
|
||||
val runningTaskView = runningTaskView
|
||||
var runningTaskGridTranslationX = 0f
|
||||
var runningTaskGridTranslationY = 0f
|
||||
if (runningTaskView != null) {
|
||||
// Apply the grid translation to running task unless it's being snapped to
|
||||
// and removes the current translation applied to the running task.
|
||||
runningTaskGridTranslationX =
|
||||
(runningTaskView.gridTranslationX - runningTaskView.nonGridTranslationX)
|
||||
runningTaskGridTranslationY = runningTaskView.gridTranslationY
|
||||
}
|
||||
remoteTargetHandles.forEach { remoteTargetHandle ->
|
||||
val taskViewSimulator = remoteTargetHandle.taskViewSimulator
|
||||
if (enableGridOnlyOverview()) {
|
||||
animatorSet.play(taskViewSimulator.carouselScale.animateToValue(1f))
|
||||
animatorSet.play(
|
||||
taskViewSimulator.taskGridTranslationX.animateToValue(
|
||||
runningTaskGridTranslationX
|
||||
)
|
||||
)
|
||||
animatorSet.play(
|
||||
taskViewSimulator.taskGridTranslationY.animateToValue(
|
||||
runningTaskGridTranslationY
|
||||
)
|
||||
)
|
||||
} else {
|
||||
animatorSet.play(
|
||||
taskViewSimulator.taskPrimaryTranslation.animateToValue(
|
||||
runningTaskGridTranslationX
|
||||
)
|
||||
)
|
||||
animatorSet.play(
|
||||
taskViewSimulator.taskSecondaryTranslation.animateToValue(
|
||||
runningTaskGridTranslationY
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
animatorSet.play(
|
||||
immediateObjectAnimator(
|
||||
this,
|
||||
TASK_THUMBNAIL_SPLASH_ALPHA,
|
||||
if (endState.showTaskThumbnailSplash()) 1f else 0f,
|
||||
)
|
||||
)
|
||||
if (enableLargeDesktopWindowingTile()) {
|
||||
animatorSet.play(ObjectAnimator.ofFloat(this, DESKTOP_CAROUSEL_DETACH_PROGRESS, 0f))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
class RecentsViewFloatProperty(
|
||||
private val utilsProperty: KMutableProperty1<RecentsViewUtils, Float>
|
||||
|
||||
@@ -426,7 +426,7 @@ constructor(
|
||||
}
|
||||
|
||||
// The following grid translations scales with mGridProgress.
|
||||
protected var gridTranslationX = 0f
|
||||
var gridTranslationX = 0f
|
||||
set(value) {
|
||||
field = value
|
||||
applyTranslationX()
|
||||
@@ -447,7 +447,7 @@ constructor(
|
||||
|
||||
// Applied as a complement to gridTranslation, for adjusting the carousel overview and quick
|
||||
// switch.
|
||||
protected var nonGridTranslationX = 0f
|
||||
var nonGridTranslationX = 0f
|
||||
set(value) {
|
||||
field = value
|
||||
applyTranslationX()
|
||||
|
||||
@@ -73,7 +73,8 @@ public abstract class BaseActivity extends Activity implements ActivityContext,
|
||||
DisplayInfoChangeListener {
|
||||
|
||||
private static final String TAG = "BaseActivity";
|
||||
static final boolean DEBUG = false;
|
||||
// TODO(b/406230491): Trun DEBUG back to false once done with investigation.
|
||||
static final boolean DEBUG = true;
|
||||
|
||||
public static final int INVISIBLE_BY_STATE_HANDLER = 1 << 0;
|
||||
public static final int INVISIBLE_BY_APP_TRANSITIONS = 1 << 1;
|
||||
|
||||
@@ -129,7 +129,6 @@ constructor(
|
||||
iconMask = iconMask,
|
||||
folderShapeMask = folderShapeMask,
|
||||
themeController = iconControllerFactory.createThemeController(),
|
||||
iconScale = shapeModel?.iconScale ?: 1f,
|
||||
iconShape = iconShape,
|
||||
folderShape = folderShape,
|
||||
)
|
||||
@@ -140,7 +139,6 @@ constructor(
|
||||
val folderShapeMask: String,
|
||||
val themeController: IconThemeController?,
|
||||
val themeCode: String = themeController?.themeID ?: "no-theme",
|
||||
val iconScale: Float = 1f,
|
||||
val iconShape: ShapeDelegate,
|
||||
val folderShape: ShapeDelegate,
|
||||
) {
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
package com.android.launcher3.icons
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Color
|
||||
import android.graphics.Path
|
||||
import android.graphics.Rect
|
||||
import android.graphics.drawable.AdaptiveIconDrawable
|
||||
@@ -50,8 +48,6 @@ internal constructor(
|
||||
@Assisted private val pool: ConcurrentLinkedQueue<LauncherIcons>,
|
||||
) : BaseIconFactory(context, idp.fillResIconDpi, idp.iconBitmapSize), AutoCloseable {
|
||||
|
||||
private val iconScale = themeManager.iconState.iconScale
|
||||
|
||||
init {
|
||||
mThemeController = themeManager.themeController
|
||||
}
|
||||
@@ -71,38 +67,6 @@ internal constructor(
|
||||
return themeManager.iconShape.getPath(iconBounds)
|
||||
}
|
||||
|
||||
override fun getIconScale(): Float {
|
||||
if (!Flags.enableLauncherIconShapes()) return super.getIconScale()
|
||||
return themeManager.iconState.iconScale
|
||||
}
|
||||
|
||||
override fun drawAdaptiveIcon(
|
||||
canvas: Canvas,
|
||||
drawable: AdaptiveIconDrawable,
|
||||
overridePath: Path,
|
||||
) {
|
||||
if (!Flags.enableLauncherIconShapes()) {
|
||||
super.drawAdaptiveIcon(canvas, drawable, overridePath)
|
||||
return
|
||||
}
|
||||
canvas.clipPath(overridePath)
|
||||
canvas.drawColor(Color.BLACK)
|
||||
canvas.save()
|
||||
canvas.scale(
|
||||
iconScale,
|
||||
iconScale,
|
||||
drawable.bounds.exactCenterX(),
|
||||
drawable.bounds.exactCenterY(),
|
||||
)
|
||||
if (drawable.background != null) {
|
||||
drawable.background.draw(canvas)
|
||||
}
|
||||
if (drawable.foreground != null) {
|
||||
drawable.foreground.draw(canvas)
|
||||
}
|
||||
canvas.restore()
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
recycle()
|
||||
}
|
||||
|
||||
@@ -23,5 +23,4 @@ data class IconShapeModel(
|
||||
@StringRes val titleId: Int,
|
||||
val pathString: String,
|
||||
val folderPathString: String = pathString,
|
||||
val iconScale: Float = 1f,
|
||||
)
|
||||
@@ -64,14 +64,12 @@ object ShapesProvider {
|
||||
titleId = R.string.four_sided_cookie_shape_title,
|
||||
pathString = FOUR_SIDED_COOKIE_PATH,
|
||||
folderPathString = FOLDER_COMPLEX_CLOVER_PATH,
|
||||
iconScale = 72f / 83.4f,
|
||||
),
|
||||
IconShapeModel(
|
||||
key = SEVEN_SIDED_COOKIE_KEY,
|
||||
titleId = R.string.seven_sided_cookie_shape_title,
|
||||
pathString = SEVEN_SIDED_COOKIE_PATH,
|
||||
folderPathString = FOLDER_CLOVER_PATH,
|
||||
iconScale = 72f / 80f,
|
||||
),
|
||||
IconShapeModel(
|
||||
key = ARCH_KEY,
|
||||
|
||||
@@ -71,7 +71,6 @@ public class ClipIconView extends View implements ClipPathView {
|
||||
private boolean mIsFolderIcon = false;
|
||||
|
||||
private ValueAnimator mRevealAnimator;
|
||||
private float mIconScale;
|
||||
|
||||
private final Rect mStartRevealRect = new Rect();
|
||||
private final Rect mEndRevealRect = new Rect();
|
||||
@@ -178,7 +177,6 @@ public class ClipIconView extends View implements ClipPathView {
|
||||
mTaskCornerRadius = cornerRadius / scale;
|
||||
if (mIsAdaptiveIcon) {
|
||||
final ThemeManager themeManager = ThemeManager.INSTANCE.get(getContext());
|
||||
mIconScale = themeManager.getIconState().getIconScale();
|
||||
if ((!isOpening || Flags.enableLauncherIconShapes())
|
||||
&& progress >= shapeProgressStart) {
|
||||
if (mRevealAnimator == null) {
|
||||
@@ -322,13 +320,6 @@ public class ClipIconView extends View implements ClipPathView {
|
||||
canvas.clipPath(mClipPath);
|
||||
}
|
||||
int count2 = canvas.save();
|
||||
if (!mIsFolderIcon) {
|
||||
float iconCenterX =
|
||||
(mFinalDrawableBounds.right - mFinalDrawableBounds.left) / 2f * mIconScale;
|
||||
float iconCenterY =
|
||||
(mFinalDrawableBounds.bottom - mFinalDrawableBounds.top) / 2f * mIconScale;
|
||||
canvas.scale(mIconScale, mIconScale, iconCenterX, iconCenterY);
|
||||
}
|
||||
if (mBackground != null) {
|
||||
mBackground.draw(canvas);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
android:minResizeWidth="1dp"
|
||||
android:maxResizeWidth="3000dp"
|
||||
android:targetCellHeight="1"
|
||||
android:targetCellWidth="5"
|
||||
android:targetCellWidth="4"
|
||||
android:updatePeriodMillis="86400000"
|
||||
android:initialLayout="@layout/test_layout_appwidget_red"
|
||||
android:previewLayout="@layout/test_layout_appwidget_red"
|
||||
|
||||
Reference in new issue
Block a user