summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android
diff options
context:
space:
mode:
authorDanesh M <daneshm90@gmail.com>2015-12-08 17:45:00 -0800
committerDanesh M <daneshm90@gmail.com>2015-12-08 17:45:30 -0800
commit6be220df8c0368c58b9ac2a01254844263bac925 (patch)
tree504f7f8edde0dc5db3b59d841f43681cf4762fa3 /packages/SystemUI/src/com/android
parentbd8585321f34585139f6b3191ff0025fb2b552e2 (diff)
downloadframeworks_base-6be220df8c0368c58b9ac2a01254844263bac925.zip
frameworks_base-6be220df8c0368c58b9ac2a01254844263bac925.tar.gz
frameworks_base-6be220df8c0368c58b9ac2a01254844263bac925.tar.bz2
QSTiles : Switch to sdk constants
Change-Id: I06059611ee943a276e3d3aa050ff8f30e366124f
Diffstat (limited to 'packages/SystemUI/src/com/android')
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java20
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java3
2 files changed, 13 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java
index 5e62858..1367953 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSDragPanel.java
@@ -56,6 +56,9 @@ import com.android.systemui.statusbar.policy.BrightnessMirrorController;
import com.android.systemui.tuner.QsTuner;
import com.viewpagerindicator.CirclePageIndicator;
+
+import org.cyanogenmod.internal.util.QSUtils;
+
import cyanogenmod.providers.CMSettings;
import cyanogenmod.app.StatusBarPanelCustomTile;
@@ -1546,26 +1549,25 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
numBroadcast++;
}
}
- String[] defaults =
- getContext().getString(R.string.quick_settings_tiles_default).split(",");
- int availableSize = defaults.length + 1 - (tiles.size() - numBroadcast);
+ List<String> defaults = QSUtils.getAvailableTiles(getContext());
+ int availableSize = defaults.size() + 1 - (tiles.size() - numBroadcast);
if (availableSize < 1) {
availableSize = 1;
}
final String[] available = new String[availableSize];
final String[] availableTiles = new String[availableSize];
int index = 0;
- for (int i = 0; i < defaults.length; i++) {
- if (tiles.contains(defaults[i])) {
+ for (int i = 0; i < defaults.size(); i++) {
+ if (tiles.contains(defaults.get(i))) {
continue;
}
- int resource = mHost.getLabelResource(defaults[i]);
+ int resource = mHost.getLabelResource(defaults.get(i));
if (resource != 0) {
- availableTiles[index] = defaults[i];
+ availableTiles[index] = defaults.get(i);
available[index++] = getContext().getString(resource);
} else {
- availableTiles[index] = defaults[i];
- available[index++] = defaults[i];
+ availableTiles[index] = defaults.get(i);
+ available[index++] = defaults.get(i);
}
}
available[index++] = getContext().getString(R.string.broadcast_tile);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
index 6aead70..de7e96e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
@@ -336,7 +336,8 @@ public class QSTileHost implements QSTile.Host, Tunable {
protected List<String> loadTileSpecs(String tileList) {
final Resources res = mContext.getResources();
- final String defaultTileList = res.getString(R.string.quick_settings_tiles_default);
+ final String defaultTileList = res.getString(org.cyanogenmod.platform.internal.
+ R.string.config_defaultQuickSettingsTiles);
if (tileList == null) {
tileList = res.getString(R.string.quick_settings_tiles);
if (DEBUG) Log.d(TAG, "Loaded tile specs from config: " + tileList);