Fade back button in and out tied with the overview/shelf (1/2)

Back button changes opacity when moving the shelf during swipe up
between home screen and overview. The alpha changes depending on the
progress of the swipe up animation. When going from app to home and vice
versa, the fade animation does not tie with the swipe up progress. The
fade animation also masks the back button drawable when ime visibility
changes.

Change-Id: Idaf219923af58732715d0f0b59386dea7ab0d0ad
Fixes: 74581837
Fixes: 76900236
Test: swipe up from home screen to overview
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
index 2ddae74..2a37845 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
@@ -186,6 +186,13 @@
             mNavigationBarView.updateStates();
             updateScreenPinningGestures();
         }
+
+        @Override
+        public void onBackButtonAlphaChanged(float alpha, boolean animate) {
+            final ButtonDispatcher backButton = mNavigationBarView.getBackButton();
+            backButton.setVisibility(alpha > 0 ? View.VISIBLE : View.INVISIBLE);
+            backButton.setAlpha(alpha, animate);
+        }
     };
 
     // ----- Fragment Lifecycle Callbacks -----