Transforming notifications now based on the user dragging

The animation is not a canned animation anymore but base on
the finger movement of the user.

Bug: 19437552
Change-Id: I0f81ac2ff05a92673e3f3b9b72a5c2de238890d0
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/HybridNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/HybridNotificationView.java
index 81144d5..c80cad8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/HybridNotificationView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/HybridNotificationView.java
@@ -71,13 +71,13 @@
                 new ViewTransformationHelper.CustomTransformation() {
                     @Override
                     public boolean transformTo(TransformState ownState, TransformableView notification,
-                            Runnable endRunnable) {
+                            float transformationAmount) {
                         // We want to transform to the same y location as the title
                         TransformState otherState = notification.getCurrentState(
                                 TRANSFORMING_VIEW_TITLE);
-                        CrossFadeHelper.fadeOut(mTextView, endRunnable);
+                        CrossFadeHelper.fadeOut(mTextView, transformationAmount);
                         if (otherState != null) {
-                            ownState.animateViewVerticalTo(otherState, endRunnable);
+                            ownState.transformViewVerticalTo(otherState, transformationAmount);
                             otherState.recycle();
                         }
                         return true;
@@ -85,13 +85,13 @@
 
                     @Override
                     public boolean transformFrom(TransformState ownState,
-                            TransformableView notification) {
+                            TransformableView notification, float transformationAmount) {
                         // We want to transform from the same y location as the title
                         TransformState otherState = notification.getCurrentState(
                                 TRANSFORMING_VIEW_TITLE);
-                        CrossFadeHelper.fadeIn(mTextView);
+                        CrossFadeHelper.fadeIn(mTextView, transformationAmount);
                         if (otherState != null) {
-                            ownState.animateViewVerticalFrom(otherState);
+                            ownState.transformViewVerticalFrom(otherState, transformationAmount);
                             otherState.recycle();
                         }
                         return true;
@@ -133,11 +133,21 @@
     }
 
     @Override
+    public void transformTo(TransformableView notification, float transformationAmount) {
+        mTransformationHelper.transformTo(notification, transformationAmount);
+    }
+
+    @Override
     public void transformFrom(TransformableView notification) {
         mTransformationHelper.transformFrom(notification);
     }
 
     @Override
+    public void transformFrom(TransformableView notification, float transformationAmount) {
+        mTransformationHelper.transformFrom(notification, transformationAmount);
+    }
+
+    @Override
     public void setVisible(boolean visible) {
         setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
         mTransformationHelper.setVisible(visible);