summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ListPreference.java
diff options
context:
space:
mode:
authorByunghun Jeon <bjeon@codeaurora.org>2016-05-10 11:38:21 -0700
committerSteve Kondik <steve@cyngn.com>2016-08-21 18:45:51 -0700
commitcba1a4ed8028cb355e1361ef29b177c0b4910b5a (patch)
tree0ff9883f4c6f0617223a7c0ca3909d678a253bf7 /src/com/android/camera/ListPreference.java
parent1fea7d5bb3dd45caf29e90be2e9eae2646567a10 (diff)
downloadandroid_packages_apps_Snap-cba1a4ed8028cb355e1361ef29b177c0b4910b5a.tar.gz
android_packages_apps_Snap-cba1a4ed8028cb355e1361ef29b177c0b4910b5a.tar.bz2
android_packages_apps_Snap-cba1a4ed8028cb355e1361ef29b177c0b4910b5a.zip
SnapdragonCamera: Add SettingsManager, scene, and filter
Add SettingsManager to work as a database for settings. It will handle all dependencies and populate the values. Add scene mode and filter. Restructure UI and menu by combining them and leave the handling of settings to SettingsManager Change-Id: I185163fdddbffd29434e6a9c41b33be6d3388f88 CRs-Fixed: 1018118
Diffstat (limited to 'src/com/android/camera/ListPreference.java')
-rw-r--r--src/com/android/camera/ListPreference.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/android/camera/ListPreference.java b/src/com/android/camera/ListPreference.java
index 1abda7c48..9b8fd687d 100644
--- a/src/com/android/camera/ListPreference.java
+++ b/src/com/android/camera/ListPreference.java
@@ -42,6 +42,7 @@ public class ListPreference extends CameraPreference {
private CharSequence[] mEntries;
private CharSequence[] mEntryValues;
+ private CharSequence[] mDependencyList;
private CharSequence[] mLabels;
private boolean mLoaded = false;
@@ -73,6 +74,8 @@ public class ListPreference extends CameraPreference {
R.styleable.ListPreference_entryValues));
setLabels(a.getTextArray(
R.styleable.ListPreference_labelList));
+ setDependencyList(a.getTextArray(
+ R.styleable.ListPreference_dependencyList));
a.recycle();
}
@@ -92,6 +95,10 @@ public class ListPreference extends CameraPreference {
return mLabels;
}
+ public CharSequence[] getDependencyList() {
+ return mDependencyList;
+ }
+
public void setEntries(CharSequence entries[]) {
mEntries = entries == null ? new CharSequence[0] : entries;
}
@@ -104,6 +111,10 @@ public class ListPreference extends CameraPreference {
mLabels = labels == null ? new CharSequence[0] : labels;
}
+ public void setDependencyList(CharSequence dependencyList[]) {
+ mDependencyList = dependencyList == null ? new CharSequence[0] : dependencyList;
+ }
+
public String getValue() {
if (!mLoaded) {
mValue = getSharedPreferences().getString(mKey,
@@ -113,6 +124,10 @@ public class ListPreference extends CameraPreference {
return mValue;
}
+ public String getOffValue() {
+ return mEntryValues[0].toString();
+ }
+
// Find the first value in mDefaultValues which is supported.
private String findSupportedDefaultValue() {
for (int i = 0; i < mDefaultValues.length; i++) {