diff --git a/samples/ApiDemos/AndroidManifest.xml b/samples/ApiDemos/AndroidManifest.xml
index acfe9f92d..815cc06df 100644
--- a/samples/ApiDemos/AndroidManifest.xml
+++ b/samples/ApiDemos/AndroidManifest.xml
@@ -2308,7 +2308,18 @@
+ android:uiOptions="splitActionBarWhenNarrow"
+ android:enabled="@bool/atLeastJellyBeanMR2">
+
+
+
+
+
+
+
@@ -2318,7 +2329,8 @@
+ android:uiOptions="splitActionBarWhenNarrow"
+ android:enabled="@bool/atLeastJellyBean">
@@ -2328,7 +2340,8 @@
+ android:uiOptions="splitActionBarWhenNarrow"
+ android:enabled="@bool/atLeastJellyBean">
diff --git a/samples/ApiDemos/res/layout/action_bar_display_options.xml b/samples/ApiDemos/res/layout/action_bar_display_options.xml
index 1718fdbc2..d4216f5dd 100644
--- a/samples/ApiDemos/res/layout/action_bar_display_options.xml
+++ b/samples/ApiDemos/res/layout/action_bar_display_options.xml
@@ -13,36 +13,47 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
-
-
-
-
-
-
+ android:layout_height="match_parent">
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/ApiDemos/res/values/strings.xml b/samples/ApiDemos/res/values/strings.xml
index f673e31fc..c9c347eab 100644
--- a/samples/ApiDemos/res/values/strings.xml
+++ b/samples/ApiDemos/res/values/strings.xml
@@ -847,6 +847,8 @@
DISPLAY_SHOW_CUSTOMNavigationCycle Custom View Gravity
+ Toggle Visibility
+ Toggle System UICustom View!Menu Item
diff --git a/samples/ApiDemos/src/com/example/android/apis/app/ActionBarDisplayOptions.java b/samples/ApiDemos/src/com/example/android/apis/app/ActionBarDisplayOptions.java
index 257f0cd44..73d8db967 100644
--- a/samples/ApiDemos/src/com/example/android/apis/app/ActionBarDisplayOptions.java
+++ b/samples/ApiDemos/src/com/example/android/apis/app/ActionBarDisplayOptions.java
@@ -46,6 +46,8 @@ public class ActionBarDisplayOptions extends Activity
findViewById(R.id.toggle_show_custom).setOnClickListener(this);
findViewById(R.id.toggle_navigation).setOnClickListener(this);
findViewById(R.id.cycle_custom_gravity).setOnClickListener(this);
+ findViewById(R.id.toggle_visibility).setOnClickListener(this);
+ findViewById(R.id.toggle_system_ui).setOnClickListener(this);
mCustomView = getLayoutInflater().inflate(R.layout.action_bar_display_options_custom, null);
// Configure several action bar elements that will be toggled by display options.
@@ -107,6 +109,22 @@ public class ActionBarDisplayOptions extends Activity
lp.gravity = lp.gravity & ~Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK | newGravity;
bar.setCustomView(mCustomView, lp);
return;
+ case R.id.toggle_visibility:
+ if (bar.isShowing()) {
+ bar.hide();
+ } else {
+ bar.show();
+ }
+ return;
+ case R.id.toggle_system_ui:
+ if ((getWindow().getDecorView().getSystemUiVisibility()
+ & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) {
+ getWindow().getDecorView().setSystemUiVisibility(0);
+ } else {
+ getWindow().getDecorView().setSystemUiVisibility(
+ View.SYSTEM_UI_FLAG_FULLSCREEN);
+ }
+ return;
}
int change = bar.getDisplayOptions() ^ flags;
diff --git a/samples/ApiDemos/src/com/example/android/apis/view/SystemUIModes.java b/samples/ApiDemos/src/com/example/android/apis/view/SystemUIModes.java
index 7b43973c4..730534a90 100644
--- a/samples/ApiDemos/src/com/example/android/apis/view/SystemUIModes.java
+++ b/samples/ApiDemos/src/com/example/android/apis/view/SystemUIModes.java
@@ -166,8 +166,6 @@ public class SystemUIModes extends Activity
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
-
setContentView(R.layout.system_ui_modes);
mImage = (IV) findViewById(R.id.image);
mImage.setActivity(this);
diff --git a/samples/ApiDemos/src/com/example/android/apis/view/SystemUIModesOverlay.java b/samples/ApiDemos/src/com/example/android/apis/view/SystemUIModesOverlay.java
new file mode 100644
index 000000000..73eadb1dd
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/view/SystemUIModesOverlay.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2013 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.
+ */
+
+package com.example.android.apis.view;
+
+import android.os.Bundle;
+import android.view.Window;
+
+/**
+ * Version of demo that uses the action bar in overlay mode.
+ */
+public class SystemUIModesOverlay extends SystemUIModes {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
+ super.onCreate(savedInstanceState);
+ }
+}