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

Commit 0129b31f authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Create an XML config flag to turn the navbar off.

This will eventually be replaced by something else, probably
in Configuration, that allows the WM to tell everyone
(including the status bar) whether there exist hardware
home/back/etc. keys.

Change-Id: I21e9629ed43de4a944ad75e5b9d6d4ada8aba23f
parent 1d4d30ae
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -38,5 +38,9 @@
    <!-- Whether or not we show the number in the bar. -->
    <bool name="config_statusBarShowNumber">true</bool>

    <!-- Whether a software navigation bar should be shown. NOTE: in the future this may be
         autodetected from the Configuration. -->
    <bool name="config_showNavigationBar">true</bool>

</resources>
+14 −3
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ public class PhoneStatusBar extends StatusBar {
    private View mIntruderAlertView;

    // on-screen navigation buttons
    private NavigationBarView mNavigationBarView;
    private NavigationBarView mNavigationBarView = null;

    // the tracker view
    TrackingView mTrackingView;
@@ -236,8 +236,15 @@ public class PhoneStatusBar extends StatusBar {
        mIntruderAlertView.setVisibility(View.GONE);
        mIntruderAlertView.setClickable(true);

        try {
            boolean showNav = res.getBoolean(R.bool.config_showNavigationBar);
            if (showNav) {
                mNavigationBarView = 
                    (NavigationBarView) View.inflate(context, R.layout.navigation_bar, null);
            }
        } catch (Resources.NotFoundException ex) {
            // no nav bar for you
        }

        PhoneStatusBarView sb = (PhoneStatusBarView)View.inflate(context,
                R.layout.status_bar, null);
@@ -310,12 +317,16 @@ public class PhoneStatusBar extends StatusBar {

    // For small-screen devices (read: phones) that lack hardware navigation buttons
    private void addNavigationBar() {
        if (mNavigationBarView == null) return;
        
        mNavigationBarView.reorient();
        WindowManagerImpl.getDefault().addView(
                mNavigationBarView, getNavigationBarLayoutParams());
    }

    private void repositionNavigationBar() {
        if (mNavigationBarView == null) return;
        
        mNavigationBarView.reorient();
        WindowManagerImpl.getDefault().updateViewLayout(
                mNavigationBarView, getNavigationBarLayoutParams());
+5 −3
Original line number Diff line number Diff line
@@ -2870,10 +2870,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            }
        }

        if (mStatusBarService != null) {
            try {
                mStatusBarService.userActivity();
            } catch (RemoteException ex) {}
        }
    }

    Runnable mScreenLockTimeout = new Runnable() {
        public void run() {