diff options
author | Dianne Hackborn <hackbod@google.com> | 2012-04-04 12:48:24 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2012-04-04 16:00:45 -0700 |
commit | f87d19621dc2a30232bba1f51862a0b671eb9729 (patch) | |
tree | 8bf53cb17770100b6fd1c1f31f1b27eb7121ce3e /core | |
parent | 5b86de1e6b8f597ab2444de0f2274546321f1810 (diff) | |
download | frameworks_base-f87d19621dc2a30232bba1f51862a0b671eb9729.zip frameworks_base-f87d19621dc2a30232bba1f51862a0b671eb9729.tar.gz frameworks_base-f87d19621dc2a30232bba1f51862a0b671eb9729.tar.bz2 |
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
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/view/IWindowManager.aidl | 8 | ||||
-rw-r--r-- | core/java/android/view/ViewConfiguration.java | 2 | ||||
-rw-r--r-- | core/java/android/view/WindowManagerPolicy.java | 13 | ||||
-rw-r--r-- | core/res/res/anim/dock_bottom_enter.xml | 26 | ||||
-rw-r--r-- | core/res/res/anim/dock_bottom_exit.xml | 26 | ||||
-rw-r--r-- | core/res/res/anim/dock_left_enter.xml | 26 | ||||
-rw-r--r-- | core/res/res/anim/dock_left_exit.xml | 26 | ||||
-rw-r--r-- | core/res/res/anim/dock_right_enter.xml | 26 | ||||
-rw-r--r-- | core/res/res/anim/dock_right_exit.xml | 26 | ||||
-rw-r--r-- | core/res/res/anim/dock_top_enter.xml | 26 | ||||
-rw-r--r-- | core/res/res/anim/dock_top_exit.xml | 26 | ||||
-rw-r--r-- | core/res/res/values/dimens.xml | 6 | ||||
-rw-r--r-- | core/res/res/values/public.xml | 9 |
13 files changed, 233 insertions, 13 deletions
diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl index 14cd48f..eb030de 100644 --- a/core/java/android/view/IWindowManager.aidl +++ b/core/java/android/view/IWindowManager.aidl @@ -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 diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java index b9924c7..9d06145 100644 --- a/core/java/android/view/ViewConfiguration.java +++ b/core/java/android/view/ViewConfiguration.java @@ -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; diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index 75267bb..cf9cafc 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -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 diff --git a/core/res/res/anim/dock_bottom_enter.xml b/core/res/res/anim/dock_bottom_enter.xml new file mode 100644 index 0000000..7a2e94b --- /dev/null +++ b/core/res/res/anim/dock_bottom_enter.xml @@ -0,0 +1,26 @@ +<?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> diff --git a/core/res/res/anim/dock_bottom_exit.xml b/core/res/res/anim/dock_bottom_exit.xml new file mode 100644 index 0000000..c2fd15c --- /dev/null +++ b/core/res/res/anim/dock_bottom_exit.xml @@ -0,0 +1,26 @@ +<?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> diff --git a/core/res/res/anim/dock_left_enter.xml b/core/res/res/anim/dock_left_enter.xml new file mode 100644 index 0000000..b057f67 --- /dev/null +++ b/core/res/res/anim/dock_left_enter.xml @@ -0,0 +1,26 @@ +<?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 left of the screen is entering. --> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:interpolator="@android:interpolator/decelerate_quad"> + <translate android:fromXDelta="-75%" android:toXDelta="0" + android:duration="@android:integer/config_mediumAnimTime"/> + <alpha android:fromAlpha="0.0" android:toAlpha="1.0" + android:duration="@android:integer/config_mediumAnimTime" /> +</set> diff --git a/core/res/res/anim/dock_left_exit.xml b/core/res/res/anim/dock_left_exit.xml new file mode 100644 index 0000000..576b1aa --- /dev/null +++ b/core/res/res/anim/dock_left_exit.xml @@ -0,0 +1,26 @@ +<?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 right of the screen is exiting. --> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:interpolator="@android:interpolator/accelerate_quad"> + <translate android:fromXDelta="0" android:toXDelta="-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> diff --git a/core/res/res/anim/dock_right_enter.xml b/core/res/res/anim/dock_right_enter.xml new file mode 100644 index 0000000..e1bd190 --- /dev/null +++ b/core/res/res/anim/dock_right_enter.xml @@ -0,0 +1,26 @@ +<?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 right of the screen is entering. --> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:interpolator="@android:interpolator/decelerate_quad"> + <translate android:fromXDelta="75%" android:toXDelta="0" + android:duration="@android:integer/config_mediumAnimTime"/> + <alpha android:fromAlpha="0.0" android:toAlpha="1.0" + android:duration="@android:integer/config_mediumAnimTime" /> +</set> diff --git a/core/res/res/anim/dock_right_exit.xml b/core/res/res/anim/dock_right_exit.xml new file mode 100644 index 0000000..6d778fa --- /dev/null +++ b/core/res/res/anim/dock_right_exit.xml @@ -0,0 +1,26 @@ +<?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 right of the screen is exiting. --> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:interpolator="@android:interpolator/accelerate_quad"> + <translate android:fromXDelta="0" android:toXDelta="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> diff --git a/core/res/res/anim/dock_top_enter.xml b/core/res/res/anim/dock_top_enter.xml new file mode 100644 index 0000000..f2e4cae --- /dev/null +++ b/core/res/res/anim/dock_top_enter.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* Copyright 2007, 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 top 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> diff --git a/core/res/res/anim/dock_top_exit.xml b/core/res/res/anim/dock_top_exit.xml new file mode 100644 index 0000000..7373695 --- /dev/null +++ b/core/res/res/anim/dock_top_exit.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* Copyright 2007, 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 top 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> diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index 6d6b86b..0442be8 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -32,11 +32,9 @@ <dimen name="toast_y_offset">64dip</dimen> <!-- Height of the status bar --> <dimen name="status_bar_height">25dip</dimen> - <!-- Height of the system bar (combined status + navigation, used on large screens) --> - <dimen name="system_bar_height">48dip</dimen> - <!-- Height of the horizontal navigation bar on devices that require it --> + <!-- Height of the bottom navigation / system bar. --> <dimen name="navigation_bar_height">48dp</dimen> - <!-- Width of the vertical navigation bar on devices that require it --> + <!-- Width of the navigation bar when it is placed vertically on the screen --> <dimen name="navigation_bar_width">42dp</dimen> <!-- Height of notification icons in the status bar --> <dimen name="status_bar_icon_size">24dip</dimen> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index e5f049d..565d7d2 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1125,6 +1125,14 @@ <!-- From android.policy --> <java-symbol type="anim" name="app_starting_exit" /> <java-symbol type="anim" name="lock_screen_behind_enter" /> + <java-symbol type="anim" name="dock_top_enter" /> + <java-symbol type="anim" name="dock_top_exit" /> + <java-symbol type="anim" name="dock_bottom_enter" /> + <java-symbol type="anim" name="dock_bottom_exit" /> + <java-symbol type="anim" name="dock_left_enter" /> + <java-symbol type="anim" name="dock_left_exit" /> + <java-symbol type="anim" name="dock_right_enter" /> + <java-symbol type="anim" name="dock_right_exit" /> <java-symbol type="array" name="config_keyboardTapVibePattern" /> <java-symbol type="array" name="config_longPressVibePattern" /> <java-symbol type="array" name="config_safeModeDisabledVibePattern" /> @@ -1150,7 +1158,6 @@ <java-symbol type="dimen" name="navigation_bar_height" /> <java-symbol type="dimen" name="navigation_bar_width" /> <java-symbol type="dimen" name="status_bar_height" /> - <java-symbol type="dimen" name="system_bar_height" /> <java-symbol type="drawable" name="ic_jog_dial_sound_off" /> <java-symbol type="drawable" name="ic_jog_dial_sound_on" /> <java-symbol type="drawable" name="ic_jog_dial_unlock" /> |