summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PieController.java
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2013-04-30 09:23:23 -0700
committerMichael Kolb <kolby@google.com>2013-04-30 09:23:23 -0700
commitb7c49994231f31f5cf4de4a66eec7a85a3bd9551 (patch)
treeaf702be3a4b029483296d1ec0ac6cf65bed7dfe9 /src/com/android/camera/PieController.java
parent6cf36371a5888be8e137af1ede183bd592bb07b2 (diff)
downloadandroid_packages_apps_Snap-b7c49994231f31f5cf4de4a66eec7a85a3bd9551.tar.gz
android_packages_apps_Snap-b7c49994231f31f5cf4de4a66eec7a85a3bd9551.tar.bz2
android_packages_apps_Snap-b7c49994231f31f5cf4de4a66eec7a85a3bd9551.zip
Remove empty slots from menu
Bug: 8640131 When a specific camera doesn't support one of the menu options, the option is removed from the menu, no empty spot anymore. Change-Id: I002d6347c35cb0bfd5f71d880294f04f45ffb38f
Diffstat (limited to 'src/com/android/camera/PieController.java')
-rw-r--r--src/com/android/camera/PieController.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/com/android/camera/PieController.java b/src/com/android/camera/PieController.java
index d2d9c7f0f..3cbcb4bf5 100644
--- a/src/com/android/camera/PieController.java
+++ b/src/com/android/camera/PieController.java
@@ -89,7 +89,7 @@ public class PieController {
return new PieItem(drawable, 0);
}
- public PieItem makeItem(String prefKey, int position, int count) {
+ public PieItem makeItem(String prefKey) {
final IconListPreference pref =
(IconListPreference) mPreferenceGroup.findPreference(prefKey);
if (pref == null) return null;
@@ -104,7 +104,6 @@ public class PieController {
resid = pref.getSingleIcon();
}
PieItem item = makeItem(resid);
- item.setPosition(position, count);
item.setLabel(pref.getTitle().toUpperCase());
mPreferences.add(pref);
mPreferenceMap.put(pref, item);
@@ -117,7 +116,6 @@ public class PieController {
} else {
inner = makeItem(pref.getEntries()[i]);
}
- inner.setPosition(i, nOfEntries);
inner.setLabel(pref.getLabels()[i]);
item.addItem(inner);
final int index = i;
@@ -134,8 +132,7 @@ public class PieController {
return item;
}
- public PieItem makeSwitchItem(final String prefKey, int position, int count,
- boolean addListener) {
+ public PieItem makeSwitchItem(final String prefKey, boolean addListener) {
final IconListPreference pref =
(IconListPreference) mPreferenceGroup.findPreference(prefKey);
if (pref == null) return null;
@@ -150,7 +147,6 @@ public class PieController {
resid = pref.getSingleIcon();
}
PieItem item = makeItem(resid);
- item.setPosition(position, count);
item.setLabel(pref.getLabels()[index]);
item.setImageResource(mActivity, resid);
mPreferences.add(pref);
@@ -183,8 +179,8 @@ public class PieController {
return item;
}
- public void addItem(String prefKey, int position, int count) {
- PieItem item = makeItem(prefKey, position, count);
+ public void addItem(String prefKey) {
+ PieItem item = makeItem(prefKey);
mRenderer.addItem(item);
}