Simplify wallpaper strip animation.

Bug: 10852554
Bug: 11010469
Change-Id: I0330ab125097f7d2a6c0c584161cee646c6b757d
diff --git a/src/com/android/launcher3/WallpaperPickerActivity.java b/src/com/android/launcher3/WallpaperPickerActivity.java
index d3e1c7b..950957d 100644
--- a/src/com/android/launcher3/WallpaperPickerActivity.java
+++ b/src/com/android/launcher3/WallpaperPickerActivity.java
@@ -16,6 +16,7 @@
 
 package com.android.launcher3;
 
+import android.animation.Animator;
 import android.animation.LayoutTransition;
 import android.app.ActionBar;
 import android.app.Activity;
@@ -53,6 +54,7 @@
 import android.view.ViewTreeObserver;
 import android.view.ViewTreeObserver.OnGlobalLayoutListener;
 import android.view.accessibility.AccessibilityEvent;
+import android.view.animation.AccelerateInterpolator;
 import android.view.animation.DecelerateInterpolator;
 import android.widget.BaseAdapter;
 import android.widget.FrameLayout;
@@ -210,12 +212,21 @@
                 if (mAnim != null) {
                     mAnim.cancel();
                 }
-                if (mWallpaperStrip.getTranslationY() == 0) {
+                if (mWallpaperStrip.getAlpha() == 1f) {
                     mIgnoreNextTap = true;
                 }
                 mAnim = new LauncherViewPropertyAnimator(mWallpaperStrip);
-                mAnim.translationY(mWallpaperStrip.getHeight()).alpha(0f)
-                        .setInterpolator(new DecelerateInterpolator(0.75f));
+                mAnim.alpha(0f)
+                     .setDuration(150)
+                     .addListener(new Animator.AnimatorListener() {
+                         public void onAnimationStart(Animator animator) { }
+                         public void onAnimationEnd(Animator animator) {
+                             mWallpaperStrip.setVisibility(View.INVISIBLE);
+                         }
+                         public void onAnimationCancel(Animator animator) { }
+                         public void onAnimationRepeat(Animator animator) { }
+                     });
+                mAnim.setInterpolator(new AccelerateInterpolator(0.75f));
                 mAnim.start();
             }
             @Override
@@ -230,9 +241,11 @@
                     if (mAnim != null) {
                         mAnim.cancel();
                     }
+                    mWallpaperStrip.setVisibility(View.VISIBLE);
                     mAnim = new LauncherViewPropertyAnimator(mWallpaperStrip);
-                    mAnim.translationY(0f).alpha(1f)
-                            .setInterpolator(new DecelerateInterpolator(0.75f));
+                    mAnim.alpha(1f)
+                         .setDuration(150)
+                         .setInterpolator(new DecelerateInterpolator(0.75f));
                     mAnim.start();
                 }
             }
@@ -484,9 +497,9 @@
     protected void onStop() {
         super.onStop();
         mWallpaperStrip = findViewById(R.id.wallpaper_strip);
-        if (mWallpaperStrip.getTranslationY() > 0f) {
-            mWallpaperStrip.setTranslationY(0f);
+        if (mWallpaperStrip.getAlpha() < 1f) {
             mWallpaperStrip.setAlpha(1f);
+            mWallpaperStrip.setVisibility(View.VISIBLE);
         }
     }