summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.xml11
-rw-r--r--core/res/res/layout/action_mode_bar.xml22
-rw-r--r--core/res/res/layout/screen.xml10
-rw-r--r--core/res/res/layout/screen_custom_title.xml10
-rw-r--r--core/res/res/layout/screen_progress.xml10
-rw-r--r--core/res/res/layout/screen_simple.xml10
-rw-r--r--core/res/res/layout/screen_title.xml10
-rw-r--r--core/res/res/layout/screen_title_icons.xml10
-rw-r--r--core/res/res/values/public.xml1
-rw-r--r--core/res/res/values/themes.xml9
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindow.java13
11 files changed, 83 insertions, 33 deletions
diff --git a/api/current.xml b/api/current.xml
index 5b17c2b..04b4b8a 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -16619,6 +16619,17 @@
visibility="public"
>
</field>
+<field name="Theme_NoTitleBar_OverlayActionModes"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="16973973"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="Theme_Panel"
type="int"
transient="false"
diff --git a/core/res/res/layout/action_mode_bar.xml b/core/res/res/layout/action_mode_bar.xml
new file mode 100644
index 0000000..8e2e69d
--- /dev/null
+++ b/core/res/res/layout/action_mode_bar.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, 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.
+*/
+-->
+<com.android.internal.widget.ActionBarContextView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
diff --git a/core/res/res/layout/screen.xml b/core/res/res/layout/screen.xml
index 0269bf1..72f7392 100644
--- a/core/res/res/layout/screen.xml
+++ b/core/res/res/layout/screen.xml
@@ -26,11 +26,11 @@ This is the basic layout for a screen, with all of its features enabled.
android:layout_height="match_parent"
>
<!-- Popout bar for action modes -->
- <com.android.internal.widget.ActionBarContextView
- android:id="@+id/action_mode_bar"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="gone" />
+ <ViewStub android:id="@+id/action_mode_bar_stub"
+ android:inflatedId="@+id/action_mode_bar"
+ android:layout="@layout/action_mode_bar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
<!-- Title bar -->
<RelativeLayout android:id="@android:id/title_container"
diff --git a/core/res/res/layout/screen_custom_title.xml b/core/res/res/layout/screen_custom_title.xml
index fe06ddd..c62a06a 100644
--- a/core/res/res/layout/screen_custom_title.xml
+++ b/core/res/res/layout/screen_custom_title.xml
@@ -22,11 +22,11 @@ This is an custom layout for a screen.
android:orientation="vertical"
android:fitsSystemWindows="true">
<!-- Popout bar for action modes -->
- <com.android.internal.widget.ActionBarContextView
- android:id="@+id/action_mode_bar"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="gone" />
+ <ViewStub android:id="@+id/action_mode_bar_stub"
+ android:inflatedId="@+id/action_mode_bar"
+ android:layout="@layout/action_mode_bar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
<FrameLayout android:id="@android:id/title_container"
android:layout_width="match_parent"
diff --git a/core/res/res/layout/screen_progress.xml b/core/res/res/layout/screen_progress.xml
index 9669533..c3f41fa 100644
--- a/core/res/res/layout/screen_progress.xml
+++ b/core/res/res/layout/screen_progress.xml
@@ -27,11 +27,11 @@ This is the basic layout for a screen, with all of its features enabled.
android:layout_height="match_parent"
>
<!-- Popout bar for action modes -->
- <com.android.internal.widget.ActionBarContextView
- android:id="@+id/action_mode_bar"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="gone" />
+ <ViewStub android:id="@+id/action_mode_bar_stub"
+ android:inflatedId="@+id/action_mode_bar"
+ android:layout="@layout/action_mode_bar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
<RelativeLayout android:id="@android:id/title_container"
style="?android:attr/windowTitleBackgroundStyle"
diff --git a/core/res/res/layout/screen_simple.xml b/core/res/res/layout/screen_simple.xml
index 16af890..87c29f6 100644
--- a/core/res/res/layout/screen_simple.xml
+++ b/core/res/res/layout/screen_simple.xml
@@ -24,11 +24,11 @@ enabled.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:fitsSystemWindows="true"
android:orientation="vertical">
- <com.android.internal.widget.ActionBarContextView
- android:id="@+id/action_mode_bar"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="gone" />
+ <ViewStub android:id="@+id/action_mode_bar_stub"
+ android:inflatedId="@+id/action_mode_bar"
+ android:layout="@layout/action_mode_bar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/content"
android:layout_width="match_parent"
diff --git a/core/res/res/layout/screen_title.xml b/core/res/res/layout/screen_title.xml
index 26597af..f5134f9 100644
--- a/core/res/res/layout/screen_title.xml
+++ b/core/res/res/layout/screen_title.xml
@@ -23,11 +23,11 @@ enabled.
android:orientation="vertical"
android:fitsSystemWindows="true">
<!-- Popout bar for action modes -->
- <com.android.internal.widget.ActionBarContextView
- android:id="@+id/action_mode_bar"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="gone" />
+ <ViewStub android:id="@+id/action_mode_bar_stub"
+ android:inflatedId="@+id/action_mode_bar"
+ android:layout="@layout/action_mode_bar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="?android:attr/windowTitleSize"
diff --git a/core/res/res/layout/screen_title_icons.xml b/core/res/res/layout/screen_title_icons.xml
index c8cf334..51d6a15 100644
--- a/core/res/res/layout/screen_title_icons.xml
+++ b/core/res/res/layout/screen_title_icons.xml
@@ -24,11 +24,11 @@ This is the basic layout for a screen, with all of its features enabled.
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Popout bar for action modes -->
- <com.android.internal.widget.ActionBarContextView
- android:id="@+id/action_mode_bar"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="gone" />
+ <ViewStub android:id="@+id/action_mode_bar_stub"
+ android:inflatedId="@+id/action_mode_bar"
+ android:layout="@layout/action_mode_bar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
<RelativeLayout android:id="@android:id/title_container"
style="?android:attr/windowTitleBackgroundStyle"
android:layout_width="match_parent"
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index fc207ca..99263d7 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1325,6 +1325,7 @@
<public type="style" name="Widget.Spinner.DropDown" />
<public type="style" name="Widget.ActionButton" />
<public type="style" name="Theme.Dialog.NoFrame" />
+ <public type="style" name="Theme.NoTitleBar.OverlayActionModes" />
<!-- Standard content view for a {@link android.app.ListFragment}.
If you are implementing a subclass of ListFragment with your
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 998480d..739912a 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -116,6 +116,7 @@
<item name="android:windowAnimationStyle">@android:style/Animation.Activity</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustUnspecified</item>
<item name="windowActionBar">false</item>
+ <item name="windowActionModeOverlay">false</item>
<item name="windowActionBarStyle">@android:style/ActionBar</item>
<!-- Dialog attributes -->
@@ -544,8 +545,14 @@
<item name="android:textColor">@android:color/secondary_text_nofocus</item>
</style>
+ <!-- Default theme with an Action Bar. -->
<style name="Theme.WithActionBar">
<item name="android:windowActionBar">true</item>
</style>
-
+
+ <!-- No title bar, but Action Mode bars will overlay application content
+ instead of pushing it down to make room. -->
+ <style name="Theme.NoTitleBar.OverlayActionModes">
+ <item name="android:windowActionModeOverlay">true</item>
+ </style>
</resources>
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index 458ac9d..2299852 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -71,6 +71,7 @@ import android.view.SurfaceHolder;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewManager;
+import android.view.ViewStub;
import android.view.VolumePanel;
import android.view.Window;
import android.view.WindowManager;
@@ -1949,8 +1950,16 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
mActionMode = mode;
} else {
if (mActionModeView == null) {
- mActionModeView = (ActionBarContextView) findViewById(
- com.android.internal.R.id.action_mode_bar);
+ if (hasFeature(FEATURE_ACTION_MODE_OVERLAY)) {
+ mActionModeView = new ActionBarContextView(mContext);
+ FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
+ MATCH_PARENT, WRAP_CONTENT);
+ addView(mActionModeView, params);
+ } else {
+ ViewStub stub = (ViewStub) findViewById(
+ com.android.internal.R.id.action_mode_bar_stub);
+ mActionModeView = (ActionBarContextView) stub.inflate();
+ }
}
if (mActionModeView != null) {