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

Commit f87d1962 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Clean up status bar, system bar, navigation bar management.

The status bar and navigation bar are two completely separate
elements, with their own semantics.  The system bar now classifies
itself as a navigation bar, since that is really how it behaves.

This required rewriting the HDMI resizing code, so that it is
all done by PhoneWindowManager since that is what is responsible
for the size of the navigation bar (and thus now system bar).  This
actually gets rid of a fair amount of code, and means we can also
do the same thing for a pure navigation bar.

Likewise the system bar now has the navigation bar ability to be
hidden when requested by system UI flags.  To get the behavior
we want on Xoom, we only allow the nav bar to be hidden when it
will help provide a better aspect ratio for showing widescreen
videos.

Finally the nav/system bar now animates when hidden and shown.

Change-Id: Ie927154b68376a0b61802f99171ff56b8da92e7a
parent 5b86de1e
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -62,8 +62,8 @@ interface IWindowManager
    void setForcedDisplaySize(int longDimen, int shortDimen);
    void clearForcedDisplaySize();

    // Is device configured with a hideable status bar or a tablet system bar?
    boolean canStatusBarHide();
    // Is the device configured to have a full system bar for larger screens?
    boolean hasSystemNavBar();

    // These can only be called when injecting events to your own window,
    // or by holding the INJECT_EVENTS permission.  These methods may block
@@ -171,8 +171,10 @@ interface IWindowManager
     * @param alwaysSendConfiguration Flag to force a new configuration to
     * be evaluated.  This can be used when there are other parameters in
     * configuration that are changing.
     * @param forceRelayout If true, the window manager will always do a relayout
     * of its windows even if the rotation hasn't changed.
     */
    void updateRotation(boolean alwaysSendConfiguration);
    void updateRotation(boolean alwaysSendConfiguration, boolean forceRelayout);

    /**
     * Retrieve the current screen orientation, constants as per
+1 −1
Original line number Diff line number Diff line
@@ -315,7 +315,7 @@ public class ViewConfiguration {
        if (!sHasPermanentMenuKeySet) {
            IWindowManager wm = Display.getWindowManager();
            try {
                sHasPermanentMenuKey = wm.canStatusBarHide() && !wm.hasNavigationBar();
                sHasPermanentMenuKey = !wm.hasSystemNavBar() && !wm.hasNavigationBar();
                sHasPermanentMenuKeySet = true;
            } catch (RemoteException ex) {
                sHasPermanentMenuKey = false;
+9 −4
Original line number Diff line number Diff line
@@ -326,6 +326,11 @@ public interface WindowManagerPolicy {
         * Returns true if {@link #hideLw} was last called for the window.
         */
        public boolean showLw(boolean doAnimation);

        /**
         * Check whether the process hosting this window is currently alive.
         */
        public boolean isAlive();
    }

    /**
@@ -447,7 +452,7 @@ public interface WindowManagerPolicy {
     * Called by window manager once it has the initial, default native
     * display dimensions.
     */
    public void setInitialDisplaySize(int width, int height);
    public void setInitialDisplaySize(Display display, int width, int height);

    /**
     * Check permissions when adding a window.
@@ -514,10 +519,10 @@ public interface WindowManagerPolicy {
    public int getMaxWallpaperLayer();
    
    /**
     * Return true if the policy allows the status bar to hide.  Otherwise,
     * it is a tablet-style system bar.
     * Return true if the policy desires a full unified system nav bar.  Otherwise,
     * it is a phone-style status bar with optional nav bar.
     */
    public boolean canStatusBarHide();
    public boolean hasSystemNavBar();

    /**
     * Return the display width available after excluding any screen
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/* Copyright 2012, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License"); 
** you may not use this file except in compliance with the License. 
** You may obtain a copy of the License at 
**
**     http://www.apache.org/licenses/LICENSE-2.0 
**
** Unless required by applicable law or agreed to in writing, software 
** distributed under the License is distributed on an "AS IS" BASIS, 
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
** See the License for the specific language governing permissions and 
** limitations under the License.
*/
-->

<!-- Animation for when a dock window at the bottom of the screen is entering. -->
<set xmlns:android="http://schemas.android.com/apk/res/android"
        android:interpolator="@android:interpolator/decelerate_quad">
    <translate android:fromYDelta="75%" android:toYDelta="0"
        android:duration="@android:integer/config_mediumAnimTime"/>
    <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
        android:duration="@android:integer/config_mediumAnimTime" />
</set>
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/* Copyright 2012, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License"); 
** you may not use this file except in compliance with the License. 
** You may obtain a copy of the License at 
**
**     http://www.apache.org/licenses/LICENSE-2.0 
**
** Unless required by applicable law or agreed to in writing, software 
** distributed under the License is distributed on an "AS IS" BASIS, 
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
** See the License for the specific language governing permissions and 
** limitations under the License.
*/
-->

<!-- Animation for when a dock window at the bottom of the screen is exiting. -->
<set xmlns:android="http://schemas.android.com/apk/res/android"
        android:interpolator="@android:interpolator/accelerate_quad">
    <translate android:fromYDelta="0" android:toYDelta="75%"
        android:startOffset="100" android:duration="@android:integer/config_mediumAnimTime"/>
    <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
        android:startOffset="100" android:duration="@android:integer/config_mediumAnimTime" />
</set>
Loading