summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/statusbar
diff options
context:
space:
mode:
authorLars Greiss <kufikugel@googlemail.com>2013-05-14 13:21:31 +0200
committerJens Doll <jens.doll@gmail.com>2013-05-14 20:58:34 +0200
commitcdd98977f5089eb829724579943dbe23480ea272 (patch)
tree2abdcc84601da73500b1bf5df0caedea2e0cab86 /packages/SystemUI/src/com/android/systemui/statusbar
parenta66f8caeb9a20aa3df90a4a32f9b095068b2449d (diff)
downloadframeworks_base-cdd98977f5089eb829724579943dbe23480ea272.zip
frameworks_base-cdd98977f5089eb829724579943dbe23480ea272.tar.gz
frameworks_base-cdd98977f5089eb829724579943dbe23480ea272.tar.bz2
Frameworks: Fix do not show snappoints if triggermask disables edge
as the title says do not show on lockscreen or notification drawer the snappoints on the disabled edges. Pass trigger slots and mask trough and take into account PatchSet 2: - some refactoring Change-Id: I0413ffe86169c5d1cb906598d6006bbf1463770b
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/pie/PieLayout.java18
2 files changed, 12 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 155bdce..7799ce9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -216,6 +216,8 @@ public abstract class BaseStatusBar extends SystemUI implements
// search light!
showSearchPanel();
} else {
+ // set the snap points depending on current trigger and mask
+ mPieContainer.setSnapPoints(mPieTriggerMask & ~mPieTriggerSlots);
// send the activation to the controller
mPieController.activateFromTrigger(v, event, tracker.position);
// forward a spoofed ACTION_DOWN event
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pie/PieLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/pie/PieLayout.java
index 2ed820c..c828dea 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pie/PieLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pie/PieLayout.java
@@ -239,7 +239,7 @@ public class PieLayout extends FrameLayout implements View.OnTouchListener {
public final Position position;
}
- private int mTriggerSlots;
+ private int mSnapPointMask = 0;
private SnapPoint[] mSnapPoints = new SnapPoint[Position.values().length];
private SnapPoint mActiveSnap = null;
@@ -265,15 +265,20 @@ public class PieLayout extends FrameLayout implements View.OnTouchListener {
getDimensions();
getColors();
-
- mTriggerSlots = Settings.System.getInt(mContext.getContentResolver(),
- Settings.System.PIE_POSITIONS, Position.BOTTOM.FLAG);
}
public void setOnSnapListener(OnSnapListener onSnapListener) {
mOnSnapListener = onSnapListener;
}
+ /**
+ * Tells the Layout where to show snap points.
+ * @param mask is a mask that corresponds to {@link Position}{@code .FLAG}.
+ */
+ public void setSnapPoints(int mask) {
+ mSnapPointMask = mask;
+ }
+
private void getDimensions() {
mPieScale = Settings.System.getFloat(mContext.getContentResolver(),
Settings.System.PIE_SIZE, 1f);
@@ -303,13 +308,10 @@ public class PieLayout extends FrameLayout implements View.OnTouchListener {
}
private void setupSnapPoints(int width, int height) {
- mTriggerSlots = Settings.System.getInt(mContext.getContentResolver(),
- Settings.System.PIE_POSITIONS, Position.BOTTOM.FLAG);
-
mActiveSnap = null;
// reuse already created snap points
for (Position g : Position.values()) {
- if ((mTriggerSlots & g.FLAG) == 0) {
+ if ((mSnapPointMask & g.FLAG) != 0) {
int x = width / 2;
int y = height / 2;
if (g == Position.LEFT || g == Position.RIGHT) {