diff --git a/packages/SystemUI/proguard.flags b/packages/SystemUI/proguard.flags
index 72bd77666aff7..5e48461d4b6ed 100644
--- a/packages/SystemUI/proguard.flags
+++ b/packages/SystemUI/proguard.flags
@@ -2,4 +2,5 @@
public void notificationIconsClicked(android.view.View);
public void systemInfoClicked(android.view.View);
public void recentButtonClicked(android.view.View);
+ public void toggleLightsOut(android.view.View);
}
diff --git a/packages/SystemUI/res/anim/lights_out_in.xml b/packages/SystemUI/res/anim/lights_out_in.xml
new file mode 100644
index 0000000000000..0f0e7ce35c0d9
--- /dev/null
+++ b/packages/SystemUI/res/anim/lights_out_in.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
diff --git a/packages/SystemUI/res/anim/lights_out_out.xml b/packages/SystemUI/res/anim/lights_out_out.xml
new file mode 100644
index 0000000000000..cb895d9cc9bbe
--- /dev/null
+++ b/packages/SystemUI/res/anim/lights_out_out.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
diff --git a/packages/SystemUI/res/anim/status_bar_in.xml b/packages/SystemUI/res/anim/status_bar_in.xml
new file mode 100644
index 0000000000000..48663f4cae444
--- /dev/null
+++ b/packages/SystemUI/res/anim/status_bar_in.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
diff --git a/packages/SystemUI/res/anim/status_bar_out.xml b/packages/SystemUI/res/anim/status_bar_out.xml
new file mode 100644
index 0000000000000..b3f895341bb8d
--- /dev/null
+++ b/packages/SystemUI/res/anim/status_bar_out.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar.xml b/packages/SystemUI/res/layout-xlarge/status_bar.xml
index 1d04f6780c141..f4040d91b2ecd 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar.xml
@@ -19,13 +19,16 @@
-->
-
+
-
+
+
+
+
+
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java
index a7ecb86d17963..5dc46d0c8a191 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java
@@ -33,6 +33,8 @@ import android.os.IBinder;
import android.os.Message;
import android.os.RemoteException;
import android.util.Slog;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
@@ -82,6 +84,9 @@ public class TabletStatusBarService extends StatusBarService {
ImageView mSignalMeter;
ImageView mSignalIcon;
+ View mBarContents;
+ View mCurtains;
+
NotificationIconArea.IconLayout mIconLayout;
KickerController mKicker;
@@ -150,6 +155,19 @@ public class TabletStatusBarService extends StatusBarService {
final View sb = View.inflate(this, R.layout.status_bar, null);
mStatusBarView = sb;
+ mBarContents = sb.findViewById(R.id.bar_contents);
+ mCurtains = sb.findViewById(R.id.lights_out);
+ View systemInfo = sb.findViewById(R.id.systemInfo);
+ View.OnLongClickListener toggle = new View.OnLongClickListener() {
+ public boolean onLongClick(View v) {
+ toggleLightsOut(v);
+ return true;
+ }
+ };
+
+ systemInfo.setOnLongClickListener(toggle);
+ mCurtains.setOnLongClickListener(toggle);
+
// the more notifications icon
mNotificationIconArea = (NotificationIconArea)sb.findViewById(R.id.notificationIcons);
@@ -719,6 +737,28 @@ public class TabletStatusBarService extends StatusBarService {
return true;
}
+
+ protected void setLightsOut(boolean out) {
+ if (out) {
+ mCurtains.setAnimation(AnimationUtils.loadAnimation((Context)this,
+ R.anim.lights_out_in));
+ mCurtains.setVisibility(View.VISIBLE);
+ mBarContents.setAnimation(AnimationUtils.loadAnimation((Context)this,
+ R.anim.status_bar_out));
+ mBarContents.setVisibility(View.GONE);
+ } else {
+ mCurtains.setAnimation(AnimationUtils.loadAnimation((Context)this,
+ R.anim.lights_out_out));
+ mCurtains.setVisibility(View.GONE);
+ mBarContents.setAnimation(AnimationUtils.loadAnimation((Context)this,
+ R.anim.status_bar_in));
+ mBarContents.setVisibility(View.VISIBLE);
+ }
+ }
+
+ public void toggleLightsOut(View v) {
+ setLightsOut(mCurtains.getVisibility() != View.VISIBLE);
+ }
}