diff --git a/quickstep/recents_ui_overrides/res/drawable/chip_scrim_gradient.xml b/quickstep/recents_ui_overrides/res/drawable/chip_scrim_gradient.xml
new file mode 100644
index 0000000000..5a2dfb7b4a
--- /dev/null
+++ b/quickstep/recents_ui_overrides/res/drawable/chip_scrim_gradient.xml
@@ -0,0 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/quickstep/recents_ui_overrides/res/values/colors.xml b/quickstep/recents_ui_overrides/res/values/colors.xml
index 361f5f70c0..f03f118f38 100644
--- a/quickstep/recents_ui_overrides/res/values/colors.xml
+++ b/quickstep/recents_ui_overrides/res/values/colors.xml
@@ -15,6 +15,7 @@
-->
#fff
+ #39000000
#61000000
#61FFFFFF
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java
index ad49bfa29f..4275933ae0 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java
@@ -42,6 +42,8 @@ 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.os.Process;
@@ -256,14 +258,21 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
footer.animateHide();
}
}
+ if (mContextualChipWrapper != null) {
+ mContextualChipWrapper.animate().alpha(0f).setDuration(300);
+ }
if (mContextualChip != null) {
mContextualChip.animate().scaleX(0f).scaleY(0f).setDuration(300);
}
+
mIconView.animate().alpha(0.0f);
} else {
if (mContextualChip != null) {
mContextualChip.animate().scaleX(1f).scaleY(1f).setDuration(300);
}
+ if (mContextualChipWrapper != null) {
+ mContextualChipWrapper.animate().alpha(1f).setDuration(300);
+ }
mIconView.animate().alpha(1.0f);
}
@@ -690,20 +699,33 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
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
- - getExpectedViewHeight(view) + getResources().getDimension(
- R.dimen.chip_hint_vertical_offset));
+ - expectedChipHeight + 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 = TaskCornerRadius.get(mActivity);
+ 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);
- view.setAlpha(mFooterAlpha);
if (mContextualChip != null) {
mContextualChip.animate().scaleX(1f).scaleY(1f).setDuration(50);
}
+ if (mContextualChipWrapper != null) {
+ mContextualChipWrapper.animate().alpha(1f).setDuration(50);
+ }
}
-
}
/**