diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_02.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_02.xml
deleted file mode 100644
index 4107c4606aaa5..0000000000000
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_02.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_04.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_04.xml
deleted file mode 100644
index d00262ab43866..0000000000000
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_04.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_05.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_05.xml
deleted file mode 100644
index 570f51fd5d8ab..0000000000000
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_05.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_06.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_06.xml
deleted file mode 100644
index aaf93565a32f7..0000000000000
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_06.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_07.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_07.xml
deleted file mode 100644
index 330ce6af4aa04..0000000000000
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_07.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_08.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_08.xml
deleted file mode 100644
index 1c7f1a1e7d015..0000000000000
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_08.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_09.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_09.xml
deleted file mode 100644
index ebfbad6e02769..0000000000000
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_09.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_10.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_10.xml
deleted file mode 100644
index 21dda8c241c67..0000000000000
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_10.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_11.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_11.xml
deleted file mode 100644
index f4186fe1cbf9a..0000000000000
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_11.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_12.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_12.xml
deleted file mode 100644
index d408e28ec8fde..0000000000000
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_12.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_13.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_13.xml
deleted file mode 100644
index 1ac6b39375ede..0000000000000
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_13.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_14.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_14.xml
deleted file mode 100644
index c43e363c0b8f6..0000000000000
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_14.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_15.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_15.xml
deleted file mode 100644
index 22fa428c3e717..0000000000000
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_15.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_01.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_landscape.xml
similarity index 53%
rename from packages/SystemUI/res/drawable/ic_qs_rotation_01.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_landscape.xml
index a6c2cf8c2f7e0..e4c7cb589f497 100644
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_01.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_rotation_landscape.xml
@@ -19,16 +19,10 @@ Copyright (C) 2014 The Android Open Source Project
android:height="64dp"/>
+ android:viewportWidth="48.0"
+ android:viewportHeight="48.0"/>
-
-
+ android:pathData="M2.0,14.0l0.0,20.0c0.0,2.2 1.8,4.0 4.0,4.0l36.0,0.0c2.2,0.0 4.0,-1.8 4.0,-4.0L46.0,14.0c0.0,-2.2 -1.8,-4.0 -4.0,-4.0L6.0,10.0C3.8,10.0 2.0,11.8 2.0,14.0zM38.0,14.0l0.0,20.0L10.0,34.0L10.0,14.0L38.0,14.0z"/>
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_locked.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_locked.xml
deleted file mode 100644
index 75e20f0d9ded8..0000000000000
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_locked.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_03.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_portrait.xml
similarity index 52%
rename from packages/SystemUI/res/drawable/ic_qs_rotation_03.xml
rename to packages/SystemUI/res/drawable/ic_qs_rotation_portrait.xml
index 127296c455080..e4bf367db694c 100644
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_03.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_rotation_portrait.xml
@@ -19,16 +19,10 @@ Copyright (C) 2014 The Android Open Source Project
android:height="64dp"/>
+ android:viewportWidth="48.0"
+ android:viewportHeight="48.0"/>
-
-
+ android:pathData="M34.0,2.0L14.0,2.0c-2.2,0.0 -4.0,1.8 -4.0,4.0l0.0,36.0c0.0,2.2 1.8,4.0 4.0,4.0l20.0,0.0c2.2,0.0 4.0,-1.8 4.0,-4.0L38.0,6.0C38.0,3.8 36.2,2.0 34.0,2.0zM34.0,38.0L14.0,38.0L14.0,10.0l20.0,0.0L34.0,38.0z"/>
diff --git a/packages/SystemUI/res/drawable/ic_qs_rotation_unlocked.xml b/packages/SystemUI/res/drawable/ic_qs_rotation_unlocked.xml
index a1cedb9231202..a6c2cf8c2f7e0 100644
--- a/packages/SystemUI/res/drawable/ic_qs_rotation_unlocked.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_rotation_unlocked.xml
@@ -1,4 +1,3 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index 449cc1dfea3b2..72474b8519b89 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -108,6 +108,9 @@ public class QSPanel extends ViewGroup {
mColumns = columns;
postInvalidate();
}
+ if (mListening) {
+ refreshAllTiles();
+ }
}
public void setExpanded(boolean expanded) {
@@ -123,9 +126,9 @@ public class QSPanel extends ViewGroup {
mListening = listening;
for (TileRecord r : mRecords) {
r.tile.setListening(mListening);
- if (mListening) {
- r.tile.refreshState();
- }
+ }
+ if (mListening) {
+ refreshAllTiles();
}
if (listening) {
mBrightnessController.registerCallbacks();
@@ -134,6 +137,12 @@ public class QSPanel extends ViewGroup {
}
}
+ private void refreshAllTiles() {
+ for (TileRecord r : mRecords) {
+ r.tile.refreshState();
+ }
+ }
+
private void showDetail(boolean show, TileRecord r) {
mHandler.obtainMessage(H.SHOW_DETAIL, show ? 1 : 0, 0, r).sendToTarget();
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java
index 3be97cc3a64a9..21cf9ecf00301 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java
@@ -18,7 +18,6 @@ package com.android.systemui.qs.tiles;
import android.content.res.Configuration;
import android.content.res.Resources;
-import android.graphics.drawable.AnimationDrawable;
import com.android.systemui.R;
import com.android.systemui.qs.QSTile;
@@ -61,35 +60,19 @@ public class RotationLockTile extends QSTile {
final boolean rotationLocked = mController.isRotationLocked();
state.visible = mController.isRotationLockAffordanceVisible();
final Resources res = mContext.getResources();
- if (state.value != rotationLocked) {
- state.value = rotationLocked;
- final AnimationDrawable d = (AnimationDrawable) res.getDrawable(rotationLocked
- ? R.drawable.ic_qs_rotation_locked
- : R.drawable.ic_qs_rotation_unlocked);
- state.icon = d;
- mUiHandler.post(new Runnable() {
- @Override
- public void run() {
- d.start();
- }
- });
- }
+ state.value = rotationLocked;
if (rotationLocked) {
- final int lockOrientation = mController.getRotationLockOrientation();
- final int label = lockOrientation == Configuration.ORIENTATION_PORTRAIT
- ? R.string.quick_settings_rotation_locked_portrait_label
- : lockOrientation == Configuration.ORIENTATION_LANDSCAPE
- ? R.string.quick_settings_rotation_locked_landscape_label
- : R.string.quick_settings_rotation_locked_label;
+ final boolean portrait = res.getConfiguration().orientation
+ != Configuration.ORIENTATION_LANDSCAPE;
+ final int label = portrait ? R.string.quick_settings_rotation_locked_portrait_label
+ : R.string.quick_settings_rotation_locked_landscape_label;
+ final int icon = portrait ? R.drawable.ic_qs_rotation_portrait
+ : R.drawable.ic_qs_rotation_landscape;
state.label = mContext.getString(label);
- if (state.icon == null) {
- state.icon = res.getDrawable(R.drawable.ic_qs_rotation_15);
- }
+ state.icon = mContext.getDrawable(icon);
} else {
state.label = mContext.getString(R.string.quick_settings_rotation_unlocked_label);
- if (state.icon == null) {
- state.icon = res.getDrawable(R.drawable.ic_qs_rotation_01);
- }
+ state.icon = res.getDrawable(R.drawable.ic_qs_rotation_unlocked);
}
}