summaryrefslogtreecommitdiffstats
path: root/tests/StatusBar
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2011-01-23 17:53:23 -0800
committerJoe Onorato <joeo@google.com>2011-01-23 19:22:52 -0800
commit664644d9e012aa2a28ac96f305b1ce6499ec8806 (patch)
treed8db43b09de516fefd82adf4fc4ec22417dda648 /tests/StatusBar
parentfac86056b285bf59c1c3e774f1cb9f6de0be59ba (diff)
downloadframeworks_base-664644d9e012aa2a28ac96f305b1ce6499ec8806.zip
frameworks_base-664644d9e012aa2a28ac96f305b1ce6499ec8806.tar.gz
frameworks_base-664644d9e012aa2a28ac96f305b1ce6499ec8806.tar.bz2
visibility ("lights out") API.
1. Views may setSystemUiVisibility() to recommend that the system chrome (status bar or other UI) show or hide itself. (This functionality was previously available only via the FLAG_FULLSCREEN window flag for some SystemUI implementations.) 2. Views may register a OnSystemUiVisibilityChangedListener on a view, and find out when the system UI actually appears or disappears, allowing apps to coordinate the appearance of their own UI if desired. Bug: 3241144 Change-Id: Ia1758d94099182d49a1e3688ea2738ae4995b829
Diffstat (limited to 'tests/StatusBar')
-rw-r--r--tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java b/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java
index 563f28c..5fd946e 100644
--- a/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java
+++ b/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java
@@ -27,6 +27,8 @@ import android.app.PendingIntent;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.StatusBarManager;
+import android.content.Context;
+import android.util.AttributeSet;
import android.os.Vibrator;
import android.os.Bundle;
import android.os.Handler;
@@ -36,6 +38,7 @@ import android.os.SystemClock;
import android.widget.RemoteViews;
import android.widget.Toast;
import android.os.PowerManager;
+import android.view.View;
import android.view.Window;
import android.view.WindowManager;
@@ -46,6 +49,13 @@ public class StatusBarTest extends TestActivity
NotificationManager mNotificationManager;
Handler mHandler = new Handler();
+ View.OnSystemUiVisibilityChangeListener mOnSystemUiVisibilityChangeListener
+ = new View.OnSystemUiVisibilityChangeListener() {
+ public void onSystemUiVisibilityChange(int visibility) {
+ Log.d(TAG, "onSystemUiVisibilityChange visibility=" + visibility);
+ }
+ };
+
@Override
protected String tag() {
return TAG;
@@ -60,6 +70,20 @@ public class StatusBarTest extends TestActivity
}
private Test[] mTests = new Test[] {
+ new Test("STATUS_BAR_HIDDEN") {
+ public void run() {
+ View v = findViewById(android.R.id.list);
+ v.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
+ v.setOnSystemUiVisibilityChangeListener(mOnSystemUiVisibilityChangeListener);
+ }
+ },
+ new Test("not STATUS_BAR_HIDDEN") {
+ public void run() {
+ View v = findViewById(android.R.id.list);
+ v.setSystemUiVisibility(View.STATUS_BAR_VISIBLE);
+ v.setOnSystemUiVisibilityChangeListener(null);
+ }
+ },
new Test("Double Remove") {
public void run() {
Log.d(TAG, "set 0");