Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 784d816e authored by Pakkapon Phongthawee's avatar Pakkapon Phongthawee Committed by Steve Kondik
Browse files

Expanded Desktop : Fix Left handed navbar during landscape mode

from http://review.cyanogenmod.org/#/c/57454
when you enable expanded desktop and left handed navbar.
you need to swipe from right edge to show navbar.
but this patch will change to swipe from left edge to show navbar.
Video avalible at http://youtu.be/rUy14LQj9iE

Patchset2 : change tab to whitespace
Patchset3 : remove \r after @override in PhoneWindowManager.java
Patchset4 : Update commit message
Patchset5 : Address code formating comments
Patchset6 : Whitespace

Altaf-Mahdi
Add left gesture for edge gesture service

Change-Id: I65a15c6f5e662e429a818484de6b71e81c7ae713
parent d62b2251
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -924,6 +924,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                target = mStatusBar;
            } else if (position == EdgeGesturePosition.BOTTOM  && mNavigationBarOnBottom) {
                target = mNavigationBar;
            } else if (position == EdgeGesturePosition.LEFT
                    && !mNavigationBarOnBottom && mNavigationBarLeftInLandscape) {
                target = mNavigationBar;
            } else if (position == EdgeGesturePosition.RIGHT && !mNavigationBarOnBottom) {
                target = mNavigationBar;
            }
@@ -952,6 +955,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            if (mNavigationBar != null && !mNavigationBar.isVisibleLw() && !isStatusBarKeyguard()) {
                if (mNavigationBarOnBottom) {
                    flags |= EdgeGesturePosition.BOTTOM.FLAG;
                } else if (mNavigationBarLeftInLandscape) {
                    flags |= EdgeGesturePosition.LEFT.FLAG;
                } else {
                    flags |= EdgeGesturePosition.RIGHT.FLAG;
                }
@@ -1624,7 +1629,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    }
                    @Override
                    public void onSwipeFromRight() {
                        if (mNavigationBar != null && !mNavigationBarOnBottom) {
                        if (mNavigationBar != null && !mNavigationBarOnBottom &&
                                !mNavigationBarLeftInLandscape) {
                            requestTransientBars(mNavigationBar);
                        }
                    }
                    @Override
                    public void onSwipeFromLeft() {
                        if (mNavigationBar != null && !mNavigationBarOnBottom &&
                                mNavigationBarLeftInLandscape) {
                            requestTransientBars(mNavigationBar);
                        }
                    }
+10 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ public class SystemGesturesPointerEventListener implements PointerEventListener
    private static final int SWIPE_FROM_TOP = 1;
    private static final int SWIPE_FROM_BOTTOM = 2;
    private static final int SWIPE_FROM_RIGHT = 3;
    private static final int SWIPE_FROM_LEFT = 4;

    private final int mSwipeStartThreshold;
    private final int mSwipeDistanceThreshold;
@@ -99,6 +100,9 @@ public class SystemGesturesPointerEventListener implements PointerEventListener
                    } else if (swipe == SWIPE_FROM_RIGHT) {
                        if (DEBUG) Slog.d(TAG, "Firing onSwipeFromRight");
                        mCallbacks.onSwipeFromRight();
                    } else if (swipe == SWIPE_FROM_LEFT) {
                        if (DEBUG) Slog.d(TAG, "Firing onSwipeFromLeft");
                        mCallbacks.onSwipeFromLeft();
                    }
                }
                break;
@@ -180,6 +184,11 @@ public class SystemGesturesPointerEventListener implements PointerEventListener
                && elapsed < SWIPE_TIMEOUT_MS) {
            return SWIPE_FROM_BOTTOM;
        }
        if (fromX <= mSwipeStartThreshold
                && x > fromX + mSwipeDistanceThreshold
                && elapsed < SWIPE_TIMEOUT_MS) {
            return SWIPE_FROM_LEFT;
        }
        if (fromX >= screenWidth - mSwipeStartThreshold
                && x < fromX - mSwipeDistanceThreshold
                && elapsed < SWIPE_TIMEOUT_MS) {
@@ -192,6 +201,7 @@ public class SystemGesturesPointerEventListener implements PointerEventListener
        void onSwipeFromTop();
        void onSwipeFromBottom();
        void onSwipeFromRight();
        void onSwipeFromLeft();
        void onDebug();
    }
}