Dismiss all layout updates.

Bug: 14826666
Change-Id: I19773d0afaf34f92d987a5292de861b5963a7d8a
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/DismissView.java b/packages/SystemUI/src/com/android/systemui/statusbar/DismissView.java
index 9712ee2..f674b06 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/DismissView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/DismissView.java
@@ -19,23 +19,18 @@
 import android.content.Context;
 import android.util.AttributeSet;
 import android.view.View;
-import android.view.animation.AnimationUtils;
 import android.view.animation.Interpolator;
-import android.view.animation.PathInterpolator;
-import android.widget.Button;
-import android.widget.TextView;
+
 import com.android.systemui.R;
+import com.android.systemui.statusbar.phone.PhoneStatusBar;
 
 public class DismissView extends ExpandableView {
 
-    private Button mClearAllText;
+    private View mClearAllIcon;
     private boolean mIsVisible;
     private boolean mAnimating;
     private boolean mWillBeGone;
 
-    private final Interpolator mAppearInterpolator = new PathInterpolator(0f, 0.2f, 1f, 1f);
-    private final Interpolator mDisappearInterpolator = new PathInterpolator(0f, 0f, 0.8f, 1f);
-
     public DismissView(Context context, AttributeSet attrs) {
         super(context, attrs);
     }
@@ -43,7 +38,7 @@
     @Override
     protected void onFinishInflate() {
         super.onFinishInflate();
-        mClearAllText = (Button) findViewById(R.id.dismiss_text);
+        mClearAllIcon = findViewById(R.id.dismiss_text);
         setInvisible();
     }
 
@@ -83,12 +78,12 @@
             float endValue = nowVisible ? 1.0f : 0.0f;
             Interpolator interpolator;
             if (nowVisible) {
-                interpolator = mAppearInterpolator;
+                interpolator = PhoneStatusBar.ALPHA_IN;
             } else {
-                interpolator = mDisappearInterpolator;
+                interpolator = PhoneStatusBar.ALPHA_OUT;
             }
             mAnimating = true;
-            mClearAllText.animate()
+            mClearAllIcon.animate()
                     .alpha(endValue)
                     .setInterpolator(interpolator)
                     .setDuration(260)
@@ -111,7 +106,7 @@
     }
 
     public void setInvisible() {
-        mClearAllText.setAlpha(0.0f);
+        mClearAllIcon.setAlpha(0.0f);
         mIsVisible = false;
     }
 
@@ -134,7 +129,7 @@
     }
 
     public void setOnButtonClickListener(OnClickListener onClickListener) {
-        mClearAllText.setOnClickListener(onClickListener);
+        mClearAllIcon.setOnClickListener(onClickListener);
     }
 
     @Override
@@ -143,7 +138,7 @@
     }
 
     public void cancelAnimation() {
-        mClearAllText.animate().cancel();
+        mClearAllIcon.animate().cancel();
     }
 
     public boolean willBeGone() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index 3ec2395..3c111b6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -501,31 +501,11 @@
             @Override
             public void onAnimationEnd(Animator animation) {
                 if (clearAllExpandHack && !mCancelled) {
-                    mHeightAnimator = createHeightAnimator(getMaxPanelHeight());
-                    mHeightAnimator.setInterpolator(mLinearOutSlowInInterpolator);
-                    mHeightAnimator.setDuration(350);
-                    mHeightAnimator.addListener(new AnimatorListenerAdapter() {
-                        private boolean mCancelled;
-
-                        @Override
-                        public void onAnimationCancel(Animator animation) {
-                            mCancelled = true;
-                        }
-
-                        @Override
-                        public void onAnimationEnd(Animator animation) {
-                            mHeightAnimator = null;
-                            if (!mCancelled) {
-                                notifyExpandingFinished();
-                            }
-                        }
-                    });
-                    mHeightAnimator.start();
-                } else {
-                    mHeightAnimator = null;
-                    if (!mCancelled) {
-                        notifyExpandingFinished();
-                    }
+                    setExpandedHeightInternal(getMaxPanelHeight());
+                }
+                mHeightAnimator = null;
+                if (!mCancelled) {
+                    notifyExpandingFinished();
                 }
             }
         });