Adding start delay to the task view transforms.
- Adding slight delay to task bar buttons to allow touch feedback to show
Change-Id: I9f31ca378541fc34c7b741840c7f038340684b13
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
index 0b19162..cfba74c 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java
@@ -202,7 +202,7 @@
if (useLayers) {
anim.withLayer();
}
- anim.setStartDelay(0)
+ anim.setStartDelay(toTransform.startDelay)
.setDuration(duration)
.setInterpolator(mConfig.fastOutSlowInInterpolator)
.start();
@@ -248,6 +248,7 @@
// Fade the view out and slide it away
toTransform.alpha = 0f;
toTransform.translationY += 200;
+ toTransform.translationZ = 0;
}
/**
@@ -585,19 +586,25 @@
}
@Override
- public void onClick(View v) {
- if (v == mBarView.mApplicationIcon) {
- mCb.onTaskIconClicked(this);
- } else if (v == mBarView.mDismissButton) {
- // Animate out the view and call the callback
- final TaskView tv = this;
- startDeleteTaskAnimation(new Runnable() {
- @Override
- public void run() {
- mCb.onTaskDismissed(tv);
+ public void onClick(final View v) {
+ // We purposely post the handler delayed to allow for the touch feedback to draw
+ final TaskView tv = this;
+ postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ if (v == mBarView.mApplicationIcon) {
+ mCb.onTaskIconClicked(tv);
+ } else if (v == mBarView.mDismissButton) {
+ // Animate out the view and call the callback
+ startDeleteTaskAnimation(new Runnable() {
+ @Override
+ public void run() {
+ mCb.onTaskDismissed(tv);
+ }
+ });
}
- });
- }
+ }
+ }, 125);
}
@Override