From 71c527126b4832f564a60b71f0ad3cd7d11fa579 Mon Sep 17 00:00:00 2001 From: Zak Cohen Date: Wed, 29 Sep 2021 14:13:08 -0700 Subject: [PATCH] Overview - Remove Chips code The proactive chips code has bit rotted and doesn't work properly anymore. The product direction is not being pursued, so remove the code. Bug: 201568600 Test: local Change-Id: Ia00ceb027719c841bed665c1c50a132230bffe89 --- .../quickstep/BaseActivityInterface.java | 20 +---- .../com/android/quickstep/views/TaskView.java | 84 ------------------- .../launcher3/config/FeatureFlags.java | 5 -- 3 files changed, 2 insertions(+), 107 deletions(-) diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index 9fa0f1a45c..8a1b3916f8 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -221,7 +221,7 @@ public abstract class BaseActivityInterface SYSTEM_GESTURE_EXCLUSION_RECT = Collections.singletonList(new Rect()); @@ -421,9 +412,7 @@ public class TaskView extends FrameLayout implements Reusable { private boolean mEndQuickswitchCuj; - private View mContextualChipWrapper; private final float[] mIconCenterCoords = new float[2]; - private final float[] mChipCenterCoords = new float[2]; private boolean mIsClickableAsLiveTile = true; @@ -490,14 +479,10 @@ public class TaskView extends FrameLayout implements Reusable { public boolean offerTouchToChildren(MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { computeAndSetIconTouchDelegate(mIconView, mIconCenterCoords, mIconTouchDelegate); - computeAndSetChipTouchDelegate(); } if (mIconTouchDelegate != null && mIconTouchDelegate.onTouchEvent(event)) { return true; } - if (mChipTouchDelegate != null && mChipTouchDelegate.onTouchEvent(event)) { - return true; - } return false; } @@ -514,23 +499,6 @@ public class TaskView extends FrameLayout implements Reusable { (int) (tempCenterCoords[1] + iconHalfSize)); } - private void computeAndSetChipTouchDelegate() { - if (mContextualChipWrapper != null) { - float chipHalfWidth = mContextualChipWrapper.getWidth() / 2f; - float chipHalfHeight = mContextualChipWrapper.getHeight() / 2f; - mChipCenterCoords[0] = chipHalfWidth; - mChipCenterCoords[1] = chipHalfHeight; - getDescendantCoordRelativeToAncestor(mContextualChipWrapper, mActivity.getDragLayer(), - mChipCenterCoords, - false); - mChipTouchDelegate.setBounds( - (int) (mChipCenterCoords[0] - chipHalfWidth), - (int) (mChipCenterCoords[1] - chipHalfHeight), - (int) (mChipCenterCoords[0] + chipHalfWidth), - (int) (mChipCenterCoords[1] + chipHalfHeight)); - } - } - /** * The modalness of this view is how it should be displayed when it is shown on its own in the * modal state of overview. @@ -543,10 +511,6 @@ public class TaskView extends FrameLayout implements Reusable { } mModalness = modalness; mIconView.setAlpha(comp(modalness)); - if (mContextualChipWrapper != null) { - mContextualChipWrapper.setScaleX(comp(modalness)); - mContextualChipWrapper.setScaleY(comp(modalness)); - } mDigitalWellBeingToast.updateBannerOffset(modalness, mCurrentFullscreenParams.mCurrentDrawnInsets.top + mCurrentFullscreenParams.mCurrentDrawnInsets.bottom); @@ -910,11 +874,6 @@ public class TaskView extends FrameLayout implements Reusable { float scale = Interpolators.clampToProgress(FAST_OUT_SLOW_IN, lowerClamp, upperClamp) .getInterpolation(progress); mIconView.setAlpha(scale); - if (mContextualChipWrapper != null && mContextualChipWrapper != null) { - mContextualChipWrapper.setAlpha(scale); - mContextualChipWrapper.setScaleX(Math.min(scale, comp(mModalness))); - mContextualChipWrapper.setScaleY(Math.min(scale, comp(mModalness))); - } mDigitalWellBeingToast.updateBannerOffset(1f - scale, mCurrentFullscreenParams.mCurrentDrawnInsets.top + mCurrentFullscreenParams.mCurrentDrawnInsets.bottom); @@ -988,53 +947,10 @@ public class TaskView extends FrameLayout implements Reusable { onTaskListVisibilityChanged(false); } - /** - * Sets the contextual chip. - * - * @param view Wrapper view containing contextual chip. - */ - public void setContextualChip(View view) { - if (mContextualChipWrapper != null) { - removeView(mContextualChipWrapper); - } - if (view != null) { - mContextualChipWrapper = view; - LayoutParams layoutParams = new LayoutParams(((View) getParent()).getMeasuredWidth(), - LayoutParams.WRAP_CONTENT); - layoutParams.gravity = BOTTOM | CENTER_HORIZONTAL; - int expectedChipHeight = getExpectedViewHeight(view); - float chipOffset = getResources().getDimension(R.dimen.chip_hint_vertical_offset); - layoutParams.bottomMargin = -expectedChipHeight - (int) chipOffset; - mContextualChipWrapper.setScaleX(0f); - mContextualChipWrapper.setScaleY(0f); - addView(view, getChildCount(), layoutParams); - if (mContextualChipWrapper != null) { - float scale = comp(mModalness); - mContextualChipWrapper.animate().scaleX(scale).scaleY(scale).setDuration(50); - mChipTouchDelegate = new TransformingTouchDelegate(mContextualChipWrapper); - } - } - } - public float getTaskCornerRadius() { return TaskCornerRadius.get(mActivity); } - /** - * Clears the contextual chip from TaskView. - * - * @return The contextual chip wrapper view to be recycled. - */ - public View clearContextualChip() { - if (mContextualChipWrapper != null) { - removeView(mContextualChipWrapper); - } - View oldContextualChipWrapper = mContextualChipWrapper; - mContextualChipWrapper = null; - mChipTouchDelegate = null; - return oldContextualChipWrapper; - } - @Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index f230648ac3..9d27bbdd0e 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -94,11 +94,6 @@ public final class FeatureFlags { "ENABLE_QUICKSTEP_WIDGET_APP_START", true, "Enable Quickstep animation when launching activities from an app widget"); - // Keep as DeviceFlag to allow remote disable in emergency. - public static final BooleanFlag ENABLE_SUGGESTED_ACTIONS_OVERVIEW = new DeviceFlag( - "ENABLE_SUGGESTED_ACTIONS_OVERVIEW", false, "Show chip hints on the overview screen"); - - public static final BooleanFlag ENABLE_DEVICE_SEARCH = new DeviceFlag( "ENABLE_DEVICE_SEARCH", true, "Allows on device search in all apps");