SystemUI: Pull down QS if x > 70% width

Change-Id: Ic41d331e8f0166484b124e91a8ed8e904ff38edb

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
Quick Settings Pulldown: Left or Right side option (1/2)

Patch set 2 : Fix defaults from upgrading
Patch set 3 : Change percentages

Change-Id: I1f74043865e2670430da7c90ddc8aacc8e5267be
Quick Settings: Swipe to switch

Adds the ability to switch to/from Quick Settings, using a sideways
swipe gesture.

Video demonstration: http://www.youtube.com/watch?v=jZaDVBIFAuA
(Video for the initial Patch Set only)

Patch Set 2: Flip animation follows your finger
Patch Set 3: Fix commit message
Patch Set 4: Fix commit message (again)
Patch Set 5: Pin down the statusbar during swipe
Patch Set 6: Smooth out animation after releasing swipe
Patch Set 7: Swipe in any direction to switch views
Patch Set 8: Ensure the statusbar is properly pinned down
Patch Set 9: Fix logic and event handling issues
Patch Set 10: Refactor for readability
Patch Set 11: Limit swipe detection to the bottom bar

Change-Id: I3cab45f72fe3c5fa40d4631fc6a84ea7bfe51bd1

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
Fix the flipping animation sometimes being played when pulling the quick
settings with two fingers.

Commit c5e8dca7f11d3c085dd1e98692fcc21f1bcc0f6f already tried to fix
this before, but was incomplete (and incorrect). The actual issue is
that on the first pointer down event, a 'peek' animation runs and
expands the notification panel by some pixels (on mako: 160). This
amount of pixels is significantly larger than the handle height (on
mako: 72). Depending on the timing between peek animation and the second
pointer down event, the flip animation would play (if animation already
revealed more than 72 pixels) or not.

Fix that by not playing the flip animation if only peeking, as the
actual panel content is not visible at that point anyway. Also remove
the previous incomplete fix in the process.

Change-Id: I8997dc7b70143940a519f41da29ffd4d738d8d0c
Finally fix incorrect flipping to quick settings.

Commit f6685c5ca84a42f5a47bf40827d6229dd998dee4 fixed this for the
two-finger pulldown. It reverted commit
c5e8dca7f11d3c085dd1e98692fcc21f1bcc0f6f in the process, which was
incorrect, but fixed another condition of this problem occuring
nevertheless. The actual problem the latter fix tried to fix was that
the flip decision was dependant on the timing of the view layout:
getMeasuredHeight() returned whatever was set in the last layout, which
might not have happened when hiding the view, so at the time of the next
ACTION_DOWN getMeasuredHeight() returned the height from the time the
panel was last visible.
Fix that problem by using the height scheduled for the next layout, so
we're always up-to-date.

Change-Id: Ib97f34f9aa0a6f28d48b4ec3e16c82a814cda0d0
Quick Settings: Fix flip-to-settings animation

Bug is reproduced as follows:

1. close the notification area while Quick Settings is showing
2. open the notification area, so that the notifications show
3. click the button on the top, to switch to quick settings.

Notice that only half of the animation is played. Having some
notifications shown helps visualizing it.

This bug was introduced by

I3cab45f72fe3c5fa40d4631fc6a84ea7bfe51bd1
http://review.cyanogenmod.org/29118
(Yes, it was me. Sorry.)

Change-Id: I31510617bf7e78fa09305a9c323b6ce30c058218