SystemUI: Extend swipe helper (Part1)

I was not happy with long press on notifications and recents
to open apps in floating mode. The long press duration kinda
breaks the UI interaction flow, which prevented me from
actually using floating windows. Therefore, I've created a
private modification, which enables floating mode for
notifications and recents by swiping to the left. This
greatly improves usability without strongly deviating from
stock UI experience, in strict accordance with PA's
philosophy.  Changes are surgically implemented to keep the
probability of merge conflicts rather low. The code was
successfully tested on mako, hammerhead, tilapia, and manta.
Let the team discuss and decide whether or not this is a
worthy extension to PA.

Changes are split into two commits.

- Extending SwipeHelper:
SwipeHelper can now distinguish between directions LEFT,
RIGHT, UP, DOWN and can fire an abstract trigger 'event'. A
trigger direction can be specified and when a swipe in this
direction occurs dismissable children will not be dismissed,
instead they will be snapped back.  Whenever a child is
swiped far or fast enough in that direction an event is
triggered and the onChildTriggerd() callback is issued. This
callback was added to the SwipeHelper.Callback interface and
therefore requires all its implementations to realize this
method, such as probably Hover, which is sadly not open
source (yet?).

Change-Id: Ida06195913f022463d29ca22092e81fb8993ad50
SystemUI: Swipe to float for notifications and recents (Part2)

I was not happy with long press on notifications and recents
to open apps in floating mode. The long press duration kinda
breaks the UI interaction flow, which prevented me from
actually using floating windows. Therefore, I've created a
private modification, which enables floating mode for
notifications and recents by swiping to the left. This
greatly improves usability without strongly deviating from
stock UI experience, in strict accordance with PA's
philosophy. Changes are surgically implemented to keep the
probability of merge conflicts rather low. The code was
successfully tested on mako, hammerhead, tilapia, and manta.
Let the team discuss and decide whether or not this is a
worthy extension to PA.

Changes are split into two commits.

- Swipe recents for floating window:
Recents ScrollViews set separate trigger directions on
SwipeHelper (LEFT for vertical and DOWN for horizontal).
Directions are chosen as the opposite of the 'natural'
swipe-to-dismiss direction performed by the clear-all
button. onChildTriggered() will open the app in floating
window mode. To confirm this behavior for horizontal and
vertical recents views, separate settings confirmation
dialogs are shown with appropriate PA-style graphics (Gimp
sources on request).

- Swipe status bar notification for floating window:
Analogous to recents, here the NotificationRowLayout sets
the trigger direction to LEFT. It also got its own
confirmation dialog together with new hint graphics. After a
child is triggered, the app is started in floating window
mode by performing a click causing the notification to
disappear (exactly as it would anyway, if the app would have
been opened in 'normal' full-screen mode).

Change-Id: Ib32e2c88033b1c143bd8dc8fa7394b002060d526
Signed-off-by: anerikg <anerikgames@gmail.com>

Conflicts:
	core/java/android/provider/Settings.java
SystemUI: Stick Pie to edge on phones

Apply the same UX of AOSP's navbar on phones to Pie
controls. When rotating the phone, Pie now sticks to the
same physical screen edge, to which it was pinned before. As
most people start holding their phone with two hands in
landscape mode, keeping Pie at the right or left edge might
be more comfortable to reach by thumbs. The behavior on
tablets should not be affected in any way by this change.

Changes:

PieControlPanel stores only the absolute gravity (the
rotation independent position in portrait mode) of Pie.
PieMenu and PieController query the gravity from Panel.
Query methods (getOrientation(), getDegree(),
isGravityPossible()) only return the relative gravity (the
position depending on current rotation). Therfore, only the
PieControlPanel is aware of, whether and how gravity is
converted.

The amount of snap points is reduced in landscape mode,
because Pie cannot be pinned to the top edge of the screen.

Change-Id: I263f16e1c59e134f374b9a3a007ecdce2d54dc46