summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2010-08-10 20:13:01 -0700
committerAdam Powell <adamp@google.com>2010-08-11 16:17:57 -0700
commit6b336f835d637853800b94689375a03f337139a4 (patch)
tree073bf584d8e0092137daf46d0d9c69a17faa551e /core/java/android
parentda4c35b95157ed56dbf12c166173800c4c3740e2 (diff)
downloadframeworks_base-6b336f835d637853800b94689375a03f337139a4.zip
frameworks_base-6b336f835d637853800b94689375a03f337139a4.tar.gz
frameworks_base-6b336f835d637853800b94689375a03f337139a4.tar.bz2
ActionBar overlay mode, height fetching, show/hide
Change-Id: Ie931ed26ec885d891d6733132b517a53d95f8491
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/app/ActionBar.java29
-rw-r--r--core/java/android/view/Window.java14
2 files changed, 41 insertions, 2 deletions
diff --git a/core/java/android/app/ActionBar.java b/core/java/android/app/ActionBar.java
index d33494b..38086f0 100644
--- a/core/java/android/app/ActionBar.java
+++ b/core/java/android/app/ActionBar.java
@@ -18,6 +18,7 @@ package android.app;
import android.graphics.drawable.Drawable;
import android.view.View;
+import android.view.Window;
import android.widget.SpinnerAdapter;
/**
@@ -383,6 +384,34 @@ public abstract class ActionBar {
public abstract void selectTab(Tab tab);
/**
+ * Retrieve the current height of the ActionBar.
+ *
+ * @return The ActionBar's height
+ */
+ public abstract int getHeight();
+
+ /**
+ * Show the ActionBar if it is not currently showing.
+ * If the window hosting the ActionBar does not have the feature
+ * {@link Window#FEATURE_ACTION_BAR_OVERLAY} it will resize application
+ * content to fit the new space available.
+ */
+ public abstract void show();
+
+ /**
+ * Hide the ActionBar if it is not currently showing.
+ * If the window hosting the ActionBar does not have the feature
+ * {@link Window#FEATURE_ACTION_BAR_OVERLAY} it will resize application
+ * content to fit the new space available.
+ */
+ public abstract void hide();
+
+ /**
+ * @return <code>true</code> if the ActionBar is showing, <code>false</code> otherwise.
+ */
+ public abstract boolean isShowing();
+
+ /**
* Callback interface for ActionBar navigation events.
*/
public interface NavigationCallback {
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java
index f32ff77..36f6bb2 100644
--- a/core/java/android/view/Window.java
+++ b/core/java/android/view/Window.java
@@ -64,14 +64,24 @@ public abstract class Window {
*/
public static final int FEATURE_ACTION_BAR = 8;
/**
+ * Flag for requesting an Action Bar that overlays window content.
+ * Normally an Action Bar will sit in the space above window content, but if this
+ * feature is requested along with {@link #FEATURE_ACTION_BAR} it will be layered over
+ * the window content itself. This is useful if you would like your app to have more control
+ * over how the Action Bar is displayed, such as letting application content scroll beneath
+ * an Action Bar with a transparent background or otherwise displaying a transparent/translucent
+ * Action Bar over application content.
+ */
+ public static final int FEATURE_ACTION_BAR_OVERLAY = 9;
+ /**
* Flag for specifying the behavior of action modes when an Action Bar is not present.
* If overlay is enabled, the action mode UI will be allowed to cover existing window content.
*/
- public static final int FEATURE_ACTION_MODE_OVERLAY = 9;
+ public static final int FEATURE_ACTION_MODE_OVERLAY = 10;
/**
* Flag for requesting this window to be hardware accelerated, if possible.
*/
- public static final int FEATURE_HARDWARE_ACCELERATED = 10;
+ public static final int FEATURE_HARDWARE_ACCELERATED = 11;
/** Flag for setting the progress bar's visibility to VISIBLE */
public static final int PROGRESS_VISIBILITY_ON = -1;
/** Flag for setting the progress bar's visibility to GONE */