Improved the usablility of the lockscreen affordances

Bug: 19563694
Change-Id: I47c24eae432ae168f6a3eaaed57fbcc59a411f8a
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index 96e9543..03e5746 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -1836,29 +1836,6 @@
     }
 
     @Override
-    protected void onEdgeClicked(boolean right) {
-        if ((right && getRightIcon().getVisibility() != View.VISIBLE)
-                || (!right && getLeftIcon().getVisibility() != View.VISIBLE)
-                || isDozing()) {
-            return;
-        }
-        mHintAnimationRunning = true;
-        mAfforanceHelper.startHintAnimation(right, new Runnable() {
-            @Override
-            public void run() {
-                mHintAnimationRunning = false;
-                mStatusBar.onHintFinished();
-            }
-        });
-        boolean start = getLayoutDirection() == LAYOUT_DIRECTION_RTL ? right : !right;
-        if (start) {
-            mStatusBar.onPhoneHintStarted();
-        } else {
-            mStatusBar.onCameraHintStarted();
-        }
-    }
-
-    @Override
     protected void startUnlockHintAnimation() {
         super.startUnlockHintAnimation();
         startHighlightIconAnimation(getCenterIcon());
@@ -1880,8 +1857,8 @@
     }
 
     @Override
-    public float getPageWidth() {
-        return getWidth();
+    public float getMaxTranslationDistance() {
+        return (float) Math.hypot(getWidth(), getHeight());
     }
 
     @Override
@@ -1903,6 +1880,27 @@
     }
 
     @Override
+    public void onIconClicked(boolean rightIcon) {
+        if (mHintAnimationRunning) {
+            return;
+        }
+        mHintAnimationRunning = true;
+        mAfforanceHelper.startHintAnimation(rightIcon, new Runnable() {
+            @Override
+            public void run() {
+                mHintAnimationRunning = false;
+                mStatusBar.onHintFinished();
+            }
+        });
+        rightIcon = getLayoutDirection() == LAYOUT_DIRECTION_RTL ? !rightIcon : rightIcon;
+        if (rightIcon) {
+            mStatusBar.onCameraHintStarted();
+        } else {
+            mStatusBar.onPhoneHintStarted();
+        }
+    }
+
+    @Override
     public KeyguardAffordanceView getLeftIcon() {
         return getLayoutDirection() == LAYOUT_DIRECTION_RTL
                 ? mKeyguardBottomArea.getCameraView()