summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLikai Ding <likaid@codeaurora.org>2015-05-27 15:59:04 +0800
committerSteve Kondik <steve@cyngn.com>2016-08-03 15:45:47 -0700
commit846dc6ad1013a28d60aa883ce3d219bf01167e86 (patch)
treee1a01f23107f337236678e0bff8ebe3f043193e4
parent9a1d5c26b78d3e7edb8a02961289f934a862cceb (diff)
downloadandroid_packages_apps_Snap-846dc6ad1013a28d60aa883ce3d219bf01167e86.zip
android_packages_apps_Snap-846dc6ad1013a28d60aa883ce3d219bf01167e86.tar.gz
android_packages_apps_Snap-846dc6ad1013a28d60aa883ce3d219bf01167e86.tar.bz2
SnapdragonCamera: implement optizoom and chromaflash UI
add scene mode for optizoom and preference entry for chromaflash Change-Id: I859a42e3273d340a7dda7e24c6cb2e08ddb0f7bf
-rw-r--r--res/drawable-hdpi/ic_scene_mode_optizoom.pngbin0 -> 4076 bytes
-rw-r--r--res/drawable-hdpi/ic_settings_chromaflash.pngbin0 -> 3041 bytes
-rw-r--r--res/drawable-xhdpi/ic_scene_mode_optizoom.pngbin0 -> 5520 bytes
-rw-r--r--res/drawable-xhdpi/ic_settings_chromaflash.pngbin0 -> 4055 bytes
-rw-r--r--res/drawable-xxhdpi/ic_scene_mode_optizoom.pngbin0 -> 8137 bytes
-rw-r--r--res/drawable-xxhdpi/ic_settings_chromaflash.pngbin0 -> 5787 bytes
-rw-r--r--res/values/arrays.xml13
-rw-r--r--res/values/strings.xml2
-rw-r--r--res/xml/camera_preferences.xml7
-rw-r--r--src/com/android/camera/CameraSettings.java19
-rw-r--r--src/com/android/camera/PhotoMenu.java13
-rw-r--r--src/com/android/camera/PhotoModule.java17
12 files changed, 70 insertions, 1 deletions
diff --git a/res/drawable-hdpi/ic_scene_mode_optizoom.png b/res/drawable-hdpi/ic_scene_mode_optizoom.png
new file mode 100644
index 0000000..bdf3d63
--- /dev/null
+++ b/res/drawable-hdpi/ic_scene_mode_optizoom.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_settings_chromaflash.png b/res/drawable-hdpi/ic_settings_chromaflash.png
new file mode 100644
index 0000000..a58bc00
--- /dev/null
+++ b/res/drawable-hdpi/ic_settings_chromaflash.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_scene_mode_optizoom.png b/res/drawable-xhdpi/ic_scene_mode_optizoom.png
new file mode 100644
index 0000000..8a4fc36
--- /dev/null
+++ b/res/drawable-xhdpi/ic_scene_mode_optizoom.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_settings_chromaflash.png b/res/drawable-xhdpi/ic_settings_chromaflash.png
new file mode 100644
index 0000000..b21a5a0
--- /dev/null
+++ b/res/drawable-xhdpi/ic_settings_chromaflash.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_scene_mode_optizoom.png b/res/drawable-xxhdpi/ic_scene_mode_optizoom.png
new file mode 100644
index 0000000..e41b3ac
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_scene_mode_optizoom.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_settings_chromaflash.png b/res/drawable-xxhdpi/ic_settings_chromaflash.png
new file mode 100644
index 0000000..d46fc49
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_settings_chromaflash.png
Binary files differ
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index d2c5494..b3f2d94 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -470,11 +470,22 @@
<item>@drawable/ic_indicator_wb_cloudy</item>
</array>
+ <string-array name="pref_camera_chromaflash_entries" translatable="false">
+ <item>@string/setting_off</item>
+ <item>@string/setting_on</item>
+ </string-array>
+
+ <array name="pref_camera_chromaflash_entryvalues" translatable="false">
+ <item>@string/pref_camera_advanced_feature_value_chromaflash_off</item>
+ <item>@string/pref_camera_advanced_feature_value_chromaflash_on</item>
+ </array>
+
<!-- Camera Preferences Scene Mode dialog box entries -->
<string-array name="pref_camera_scenemode_entries" translatable="false">
<item>@string/pref_camera_scenemode_entry_auto</item>
<item>@string/pref_camera_scenemode_entry_hdr</item>
<item>@string/pref_camera_scenemode_entry_refocus</item>
+ <item>@string/pref_camera_scenemode_entry_optizoom</item>
<item>@string/pref_camera_scenemode_entry_action</item>
<item>@string/pref_camera_scenemode_entry_antimotionblur</item>
<item>@string/pref_camera_scenemode_entry_aqua</item>
@@ -531,6 +542,7 @@
<item>@drawable/ic_scene_mode_auto</item>
<item>@drawable/ic_scene_mode_hdr</item>
<item>@drawable/ic_scene_mode_refocus</item>
+ <item>@drawable/ic_scene_mode_optizoom</item>
<item>@drawable/ic_scene_mode_action</item>
<item>@drawable/ic_scene_mode_entry_antimotionblur</item>
<item>@drawable/ic_scene_mode_entry_aqua</item>
@@ -603,6 +615,7 @@
<item>auto</item>
<item>hdr</item>
<item>@string/pref_camera_advanced_feature_value_refocus_on</item>
+ <item>@string/pref_camera_advanced_feature_value_optizoom_on</item>
<item>action</item>
<item>anti-motion-blur</item>
<item>aqua</item>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 409bca7..247e1b8 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -354,6 +354,8 @@
<!-- Scene mode optimized for taking indoor low-lights pictures. [CHAR LIMIT=16] -->
<string name="pref_camera_scenemode_entry_party">Party</string>
+ <string name="pref_camera_scenemode_entry_optizoom">Opti-Zoom</string>
+
<!-- Settings menu, scene mode labels [CHAR LIMIT=50] -->
<string name="pref_camera_scenemode_label_auto">NONE</string>
<!-- Scene mode that takes an image quickly with little motion blur. [CHAR LIMIT=50] -->
diff --git a/res/xml/camera_preferences.xml b/res/xml/camera_preferences.xml
index 3f5df1e..bde5a52 100644
--- a/res/xml/camera_preferences.xml
+++ b/res/xml/camera_preferences.xml
@@ -50,6 +50,13 @@
camera:entries="@array/pref_camera_whitebalance_entries"
camera:entryValues="@array/pref_camera_whitebalance_entryvalues"
camera:labelList="@array/pref_camera_whitebalance_labels" />
+ <IconListPreference
+ camera:key="chroma-flash"
+ camera:defaultValue="@string/pref_camera_advanced_feature_value_chromaflash_off"
+ camera:title="@string/pref_camera_advanced_feature_entry_chromaflash"
+ camera:singleIcon="@drawable/ic_settings_chromaflash"
+ camera:entries="@array/pref_camera_chromaflash_entries"
+ camera:entryValues="@array/pref_camera_chromaflash_entryvalues" />
<RecordLocationPreference
camera:key="pref_camera_recordlocation_key"
camera:defaultValue="@string/pref_camera_recordlocation_default"
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index ee5ba7b..66a022b 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -881,6 +881,7 @@ public class CameraSettings {
ListPreference timeLapseInterval = group.findPreference(KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL);
ListPreference pictureSize = group.findPreference(KEY_PICTURE_SIZE);
ListPreference whiteBalance = group.findPreference(KEY_WHITE_BALANCE);
+ ListPreference chromaFlash = group.findPreference(KEY_QC_CHROMA_FLASH);
ListPreference sceneMode = group.findPreference(KEY_SCENE_MODE);
ListPreference flashMode = group.findPreference(KEY_FLASH_MODE);
ListPreference focusMode = group.findPreference(KEY_FOCUS_MODE);
@@ -927,6 +928,17 @@ public class CameraSettings {
whiteBalance, mParameters.getSupportedWhiteBalance());
}
+ if (chromaFlash != null) {
+ List<String> supportedAdvancedFeatures =
+ getSupportedAdvancedFeatures(mParameters);
+ if (!CameraUtil.isSupported(
+ mContext.getString(R.string
+ .pref_camera_advanced_feature_value_chromaflash_on),
+ supportedAdvancedFeatures)) {
+ removePreference(group, chromaFlash.getKey());
+ }
+ }
+
if (sceneMode != null) {
List<String> supportedSceneModes = mParameters.getSupportedSceneModes();
List<String> supportedAdvancedFeatures =
@@ -938,6 +950,13 @@ public class CameraSettings {
supportedSceneModes.add(mContext.getString(R.string
.pref_camera_advanced_feature_value_refocus_on));
}
+ if (CameraUtil.isSupported(
+ mContext.getString(R.string
+ .pref_camera_advanced_feature_value_optizoom_on),
+ supportedAdvancedFeatures)) {
+ supportedSceneModes.add(mContext.getString(R.string
+ .pref_camera_advanced_feature_value_optizoom_on));
+ }
filterUnsupportedOptions(group, sceneMode, supportedSceneModes);
}
if (flashMode != null) {
diff --git a/src/com/android/camera/PhotoMenu.java b/src/com/android/camera/PhotoMenu.java
index 8556a23..35d721d 100644
--- a/src/com/android/camera/PhotoMenu.java
+++ b/src/com/android/camera/PhotoMenu.java
@@ -153,6 +153,7 @@ public class PhotoMenu extends MenuController
CameraSettings.KEY_ISO,
CameraSettings.KEY_EXPOSURE,
CameraSettings.KEY_WHITE_BALANCE,
+ CameraSettings.KEY_QC_CHROMA_FLASH,
CameraSettings.KEY_FOCUS_MODE,
CameraSettings.KEY_FOCUS_TIME,
CameraSettings.KEY_SHUTTER_SPEED,
@@ -180,6 +181,7 @@ public class PhotoMenu extends MenuController
CameraSettings.KEY_ISO,
CameraSettings.KEY_EXPOSURE,
CameraSettings.KEY_WHITE_BALANCE,
+ CameraSettings.KEY_QC_CHROMA_FLASH,
CameraSettings.KEY_FOCUS_MODE,
CameraSettings.KEY_FOCUS_TIME,
CameraSettings.KEY_SHUTTER_SPEED,
@@ -1155,6 +1157,17 @@ public class PhotoMenu extends MenuController
mActivity.getString(R.string.pref_camera_advanced_feature_default));
}
}
+
+ String optizoomOn = mActivity.getString(R.string
+ .pref_camera_advanced_feature_value_optizoom_on);
+ if (notSame(pref, CameraSettings.KEY_SCENE_MODE, optizoomOn)) {
+ ListPreference lp = mPreferenceGroup
+ .findPreference(CameraSettings.KEY_ADVANCED_FEATURES);
+ if (lp != null && optizoomOn.equals(lp.getValue())) {
+ setPreference(CameraSettings.KEY_ADVANCED_FEATURES,
+ mActivity.getString(R.string.pref_camera_advanced_feature_default));
+ }
+ }
updateFilterModeIcon(pref, pref);
super.onSettingChanged(pref);
}
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 133d73d..4208ca7 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1867,7 +1867,11 @@ public class PhotoModule
(fssr != null && fssr.equals(fssrOn)) ||
(truePortrait != null && truePortrait.equals(truPortraitOn)) ||
(stillMore != null && stillMore.equals(stillMoreOn))) {
- mSceneMode = sceneMode = Parameters.SCENE_MODE_AUTO;
+ if (optiZoom != null && optiZoom.equals(optiZoomOn)) {
+ sceneMode = null;
+ } else {
+ mSceneMode = sceneMode = Parameters.SCENE_MODE_AUTO;
+ }
flashMode = Parameters.FLASH_MODE_OFF;
focusMode = Parameters.FOCUS_MODE_INFINITY;
redeyeReduction = mActivity.getString(R.string.
@@ -3682,6 +3686,8 @@ public class PhotoModule
String refocusOn = mActivity.getString(R.string
.pref_camera_advanced_feature_value_refocus_on);
+ String optizoomOn = mActivity.getString(R.string
+ .pref_camera_advanced_feature_value_optizoom_on);
if (CameraUtil.isSupported(mSceneMode, mParameters.getSupportedSceneModes())) {
if (!mParameters.getSceneMode().equals(mSceneMode)) {
@@ -3699,6 +3705,11 @@ public class PhotoModule
mUI.setPreference(CameraSettings.KEY_ADVANCED_FEATURES, refocusOn);
} catch (NullPointerException e) {
}
+ } else if (optizoomOn.equals(mSceneMode)) {
+ try {
+ mUI.setPreference(CameraSettings.KEY_ADVANCED_FEATURES, optizoomOn);
+ } catch (NullPointerException e) {
+ }
} else {
mSceneMode = mParameters.getSceneMode();
if (mSceneMode == null) {
@@ -4415,6 +4426,10 @@ public class PhotoModule
updateRemainingPhotos();
}
+ if (CameraSettings.KEY_QC_CHROMA_FLASH.equals(pref.getKey())) {
+ mUI.setPreference(CameraSettings.KEY_ADVANCED_FEATURES, pref.getValue());
+ }
+
//call generic onSharedPreferenceChanged
onSharedPreferenceChanged();
}