summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSpike Sprague <spikuru@google.com>2014-05-15 15:32:49 -0700
committerSpike Sprague <spikuru@google.com>2014-05-15 22:35:27 +0000
commit156f3e5b41cd2049230b1423c455763d31738693 (patch)
treea6e303b79dbb40ab573238c922a7cd3a667792f9 /src
parentd73130b1c265d21edcea3d0fbe3cbb137b3db483 (diff)
downloadandroid_packages_apps_Camera2-156f3e5b41cd2049230b1423c455763d31738693.tar.gz
android_packages_apps_Camera2-156f3e5b41cd2049230b1423c455763d31738693.tar.bz2
android_packages_apps_Camera2-156f3e5b41cd2049230b1423c455763d31738693.zip
fix some lingering exposure comp value calculation errors
hide exposure comp button if not supported in hardware bug: 13967706 Change-Id: I6aa6963929c00ed06122fa2e2dfd778844bcc280
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/ButtonManager.java24
-rw-r--r--src/com/android/camera/app/CameraAppUI.java1
-rw-r--r--src/com/android/camera/widget/IndicatorIconController.java7
3 files changed, 25 insertions, 7 deletions
diff --git a/src/com/android/camera/ButtonManager.java b/src/com/android/camera/ButtonManager.java
index f9b8340f2..c5a6f2edc 100644
--- a/src/com/android/camera/ButtonManager.java
+++ b/src/com/android/camera/ButtonManager.java
@@ -499,14 +499,30 @@ public class ButtonManager implements SettingsManager.OnSettingChangedListener {
mMinExposureCompensation = min;
mExposureCompensationStep = step;
- mExposureN2.setEnabled(Math.round(min * step) <= -2);
- mExposureN1.setEnabled(Math.round(min * step) <= -1);
- mExposureP1.setEnabled(Math.round(max * step) >= 1);
- mExposureP1.setEnabled(Math.round(max * step) >= 2);
+
+ setVisible(mExposureN2, (Math.round(min * step) <= -2));
+ setVisible(mExposureN1, (Math.round(min * step) <= -1));
+ setVisible(mExposureP1, (Math.round(max * step) >= 1));
+ setVisible(mExposureP2, (Math.round(max * step) >= 2));
updateExposureButtons();
}
+ private static void setVisible(View v, boolean visible) {
+ if (visible) {
+ v.setVisibility(View.VISIBLE);
+ } else {
+ v.setVisibility(View.INVISIBLE);
+ }
+ }
+
+ /**
+ * @return The exposure compensation step value.
+ **/
+ public float getExposureCompensationStep() {
+ return mExposureCompensationStep;
+ }
+
/**
* Check if a button is enabled with the given button id..
*/
diff --git a/src/com/android/camera/app/CameraAppUI.java b/src/com/android/camera/app/CameraAppUI.java
index 4691cf8ac..ee3ac6ad1 100644
--- a/src/com/android/camera/app/CameraAppUI.java
+++ b/src/com/android/camera/app/CameraAppUI.java
@@ -1689,6 +1689,7 @@ public class CameraAppUI implements ModeListView.ModeSwitchListener,
}
boolean enableExposureCompensation = bottomBarSpec.enableExposureCompensation &&
+ !(bottomBarSpec.minExposureCompensation == 0 && bottomBarSpec.maxExposureCompensation == 0) &&
mController.getSettingsManager()
.getBoolean(SettingsManager.SETTING_EXPOSURE_COMPENSATION_ENABLED);
if (enableExposureCompensation) {
diff --git a/src/com/android/camera/widget/IndicatorIconController.java b/src/com/android/camera/widget/IndicatorIconController.java
index d7e98b969..610d9c71d 100644
--- a/src/com/android/camera/widget/IndicatorIconController.java
+++ b/src/com/android/camera/widget/IndicatorIconController.java
@@ -241,10 +241,11 @@ public class IndicatorIconController
String compString = mController.getSettingsManager().get(
SettingsManager.SETTING_EXPOSURE_COMPENSATION_VALUE);
- int comp = Integer.parseInt(compString);
+ int comp = Math.round(
+ Integer.parseInt(compString) * buttonManager.getExposureCompensationStep());
+
// Turn on the appropriate indicator.
- // Each integer compensation represent 1/6 of a stop.
- switch (comp / 6) {
+ switch (comp) {
case -2:
changeVisibility(mExposureIndicatorN2, View.VISIBLE);
break;