summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/proguard.flags1
-rw-r--r--packages/SystemUI/res/anim/lights_out_in.xml25
-rw-r--r--packages/SystemUI/res/anim/lights_out_out.xml25
-rw-r--r--packages/SystemUI/res/anim/status_bar_in.xml25
-rw-r--r--packages/SystemUI/res/anim/status_bar_out.xml25
-rw-r--r--packages/SystemUI/res/layout-xlarge/status_bar.xml25
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java40
7 files changed, 162 insertions, 4 deletions
diff --git a/packages/SystemUI/proguard.flags b/packages/SystemUI/proguard.flags
index 72bd77666aff..5e48461d4b6e 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 000000000000..0f0e7ce35c0d
--- /dev/null
+++ b/packages/SystemUI/res/anim/lights_out_in.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 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.
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ >
+ <translate android:fromYDelta="100%p" android:toYDelta="0"
+ android:duration="@android:integer/config_mediumAnimTime"
+ />
+ <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
+ android:duration="@android:integer/config_mediumAnimTime"
+ />
+</set>
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 000000000000..cb895d9cc9bb
--- /dev/null
+++ b/packages/SystemUI/res/anim/lights_out_out.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 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.
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ >
+ <translate android:toYDelta="100%p" android:fromYDelta="0"
+ android:duration="@android:integer/config_mediumAnimTime"
+ />
+ <alpha android:toAlpha="0.1" android:fromAlpha="1.0"
+ android:duration="@android:integer/config_mediumAnimTime"
+ />
+</set>
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 000000000000..48663f4cae44
--- /dev/null
+++ b/packages/SystemUI/res/anim/status_bar_in.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 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.
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ >
+ <translate android:fromYDelta="-100%p" android:toYDelta="0"
+ android:duration="@android:integer/config_mediumAnimTime"
+ />
+ <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
+ android:duration="@android:integer/config_mediumAnimTime"
+ />
+</set>
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 000000000000..b3f895341bb8
--- /dev/null
+++ b/packages/SystemUI/res/anim/status_bar_out.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 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.
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ >
+ <translate android:toYDelta="-100%p" android:fromYDelta="0"
+ android:duration="@android:integer/config_mediumAnimTime"
+ />
+ <alpha android:toAlpha="0.0" android:fromAlpha="1.0"
+ android:duration="@android:integer/config_mediumAnimTime"
+ />
+</set>
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar.xml b/packages/SystemUI/res/layout-xlarge/status_bar.xml
index 1d04f6780c14..f4040d91b2ec 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar.xml
@@ -19,13 +19,16 @@
-->
<!-- android:background="@drawable/status_bar_closed_default_background" -->
-<RelativeLayout
+<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
android:background="@drawable/status_bar_background"
- android:focusable="true"
- android:descendantFocusability="afterDescendants"
>
+ <RelativeLayout
+ android:id="@+id/bar_contents"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ >
<com.android.systemui.statusbar.tablet.NotificationIconArea
android:id="@+id/notificationIcons"
@@ -144,5 +147,19 @@
android:background="@drawable/ic_sysbar_icon_bg"
systemui:keyCode="4"
/>
-</RelativeLayout>
+ </RelativeLayout>
+
+ <!-- It's curtains for you. -->
+ <ImageView
+ android:id="@+id/lights_out"
+ android:src="@drawable/ic_sysbar_lightsout"
+ android:gravity="center"
+ android:background="#FF000000"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:visibility="invisible"
+ android:clickable="true"
+ android:onClick="toggleLightsOut"
+ />
+</FrameLayout>
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 a7ecb86d1796..5dc46d0c8a19 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);
+ }
}