From 6c7e594d06bda791fda266c9dadd17b327ac03c4 Mon Sep 17 00:00:00 2001 From: Sreyas Date: Thu, 4 Feb 2021 17:05:40 -0800 Subject: [PATCH] Updating Chips UI Old Screenshot: https://drive.google.com/file/d/1_ptMdXCQGTz_vafOMbB-BZVZ_EP1LsaN/view?usp=sharing New Screenshot: https://drive.google.com/file/d/1bM6Ur5H5OJdG22XU0MdRfVlNBAf_8aUy/view?usp=sharing Test: Manual Bug: 179490983 Change-Id: I14715b07a412239535b4916ba9cb355a0f0cf09e --- .../res/drawable/chip_scrim_gradient.xml | 8 ------- quickstep/res/layout/task.xml | 1 + .../com/android/quickstep/views/TaskView.java | 24 +------------------ 3 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 quickstep/res/drawable/chip_scrim_gradient.xml diff --git a/quickstep/res/drawable/chip_scrim_gradient.xml b/quickstep/res/drawable/chip_scrim_gradient.xml deleted file mode 100644 index 5a2dfb7b4a..0000000000 --- a/quickstep/res/drawable/chip_scrim_gradient.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/quickstep/res/layout/task.xml b/quickstep/res/layout/task.xml index f9bb2f2b14..c90706b703 100644 --- a/quickstep/res/layout/task.xml +++ b/quickstep/res/layout/task.xml @@ -17,6 +17,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" + android:clipChildren="false" android:defaultFocusHighlightEnabled="false" android:elevation="4dp" android:focusable="true"> diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index 59cf3b2b8b..c7924fdd5f 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -50,8 +50,6 @@ import android.graphics.Outline; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.Drawable; -import android.graphics.drawable.GradientDrawable; -import android.graphics.drawable.InsetDrawable; import android.os.Bundle; import android.os.Handler; import android.util.AttributeSet; @@ -401,9 +399,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { mContextualChip.setScaleX(comp(modalness)); mContextualChip.setScaleY(comp(modalness)); } - if (mContextualChipWrapper != null) { - mContextualChipWrapper.setAlpha(comp(modalness)); - } mDigitalWellBeingToast.updateBannerOffset(modalness); } @@ -736,30 +731,16 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { layoutParams.gravity = BOTTOM | CENTER_HORIZONTAL; int expectedChipHeight = getExpectedViewHeight(view); float chipOffset = getResources().getDimension(R.dimen.chip_hint_vertical_offset); - layoutParams.bottomMargin = (int) - (((MarginLayoutParams) mSnapshotView.getLayoutParams()).bottomMargin - - expectedChipHeight + chipOffset); + layoutParams.bottomMargin = -expectedChipHeight - (int) chipOffset; mContextualChip = ((FrameLayout) mContextualChipWrapper).getChildAt(0); mContextualChip.setScaleX(0f); mContextualChip.setScaleY(0f); - GradientDrawable scrimDrawable = (GradientDrawable) getResources().getDrawable( - R.drawable.chip_scrim_gradient, mActivity.getTheme()); - float cornerRadius = getTaskCornerRadius(); - scrimDrawable.setCornerRadii( - new float[]{0, 0, 0, 0, cornerRadius, cornerRadius, cornerRadius, - cornerRadius}); - InsetDrawable scrimDrawableInset = new InsetDrawable(scrimDrawable, 0, 0, 0, - (int) (expectedChipHeight - chipOffset)); - mContextualChipWrapper.setBackground(scrimDrawableInset); - mContextualChipWrapper.setPadding(0, 0, 0, 0); - mContextualChipWrapper.setAlpha(0f); addView(view, getChildCount(), layoutParams); if (mContextualChip != null) { mContextualChip.animate().scaleX(1f).scaleY(1f).setDuration(50); } if (mContextualChipWrapper != null) { mChipTouchDelegate = new TransformingTouchDelegate(mContextualChipWrapper); - mContextualChipWrapper.animate().alpha(1f).setDuration(50); } } } @@ -982,10 +963,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable { public void setFullscreenProgress(float progress) { progress = Utilities.boundToRange(progress, 0, 1); mFullscreenProgress = progress; - boolean isFullscreen = mFullscreenProgress > 0; mIconView.setVisibility(progress < 1 ? VISIBLE : INVISIBLE); - setClipChildren(!isFullscreen); - setClipToPadding(!isFullscreen); TaskThumbnailView thumbnail = getThumbnail(); updateCurrentFullscreenParams(thumbnail.getPreviewPositionHelper());