summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui
diff options
context:
space:
mode:
authorxianming wang <mingwax@codeaurora.org>2018-09-28 17:48:58 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2018-10-19 00:16:55 -0700
commit25056018dc026dc42bfcd002475374439063753c (patch)
tree2cd9b00a3bb6315256a4db6968799f9b308a0ab5 /src/com/android/camera/ui
parentc270e957c3aa214cb833c453a059d5a035670cfe (diff)
downloadandroid_packages_apps_Snap-25056018dc026dc42bfcd002475374439063753c.tar.gz
android_packages_apps_Snap-25056018dc026dc42bfcd002475374439063753c.tar.bz2
android_packages_apps_Snap-25056018dc026dc42bfcd002475374439063753c.zip
SnapdragonCamera: Revert the original design of ISO
Revert the original design of ISO in ProMode, add 3200ISO like the original design. CRs-Fixed: 2328914 Change-Id: I4ec658f2cc451a5515c50861d590e831ca10ad52
Diffstat (limited to 'src/com/android/camera/ui')
-rwxr-xr-xsrc/com/android/camera/ui/ProMode.java77
1 files changed, 6 insertions, 71 deletions
diff --git a/src/com/android/camera/ui/ProMode.java b/src/com/android/camera/ui/ProMode.java
index 97c9cdb83..00c755ac7 100755
--- a/src/com/android/camera/ui/ProMode.java
+++ b/src/com/android/camera/ui/ProMode.java
@@ -30,7 +30,6 @@
package com.android.camera.ui;
import android.content.Context;
-import android.content.SharedPreferences;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
@@ -46,14 +45,12 @@ import android.widget.ImageView;
import android.widget.TextView;
import com.android.camera.SettingsManager;
-import com.android.camera.ComboPreferences;
import org.codeaurora.snapcam.R;
import java.util.ArrayList;
public class ProMode extends View {
- private static final String TAG = "ProMode";
public static final int NO_MODE = -1;
public static final int EXPOSURE_MODE = 0;
public static final int MANUAL_MODE = 1;
@@ -73,7 +70,6 @@ public class ProMode extends View {
private int mCurveLeft;
private int mCurveRight;
private float mSlider = -1;
- private float mIsoSlider = -1;
private Paint mPaint = new Paint();
private int mNums;
private int mIndex;
@@ -110,19 +106,11 @@ public class ProMode extends View {
}
private void init(int mode) {
- if (mode == ISO_MODE) {
- final SharedPreferences sharedPref = mContext.getSharedPreferences(
- ComboPreferences.getLocalSharedPreferencesName(mContext, mSettingsManager.getCurrentCameraId()),
- Context.MODE_PRIVATE);
- String value = sharedPref.getString(SettingsManager.KEY_MANUAL_ISO_VALUE, "100");
- mUI.updateProModeText(mode, "Iso" + value);
- } else {
- String key = getKey(mode);
- if (key == null) return;
- int index = mSettingsManager.getValueIndex(key);
- CharSequence[] cc = mSettingsManager.getEntries(key);
- mUI.updateProModeText(mode, cc[index].toString());
- }
+ String key = getKey(mode);
+ if (key == null) return;
+ int index = mSettingsManager.getValueIndex(key);
+ CharSequence[] cc = mSettingsManager.getEntries(key);
+ mUI.updateProModeText(mode, cc[index].toString());
}
@Override
@@ -145,16 +133,6 @@ public class ProMode extends View {
canvas.drawCircle(curveCoordinate[0], curveCoordinate[1], SELECTED_DOT_SIZE,
mPaint);
}
- } else if (mMode == ISO_MODE) {
- mPaint.setColor(Color.WHITE);
- canvas.drawCircle(mCurveLeft, mCurveY, DOT_SIZE, mPaint);
- canvas.drawCircle(mCurveRight, mCurveY, DOT_SIZE, mPaint);
- mPaint.setColor(BLUE);
- if (mIsoSlider >= 0) {
- mCurveMeasure.getPosTan(mCurveMeasure.getLength() * mIsoSlider, curveCoordinate, null);
- canvas.drawCircle(curveCoordinate[0], curveCoordinate[1], SELECTED_DOT_SIZE,
- mPaint);
- }
} else {
for (int i = 0; i < mNums; i++) {
if (i == mIndex) {
@@ -250,37 +228,12 @@ public class ProMode extends View {
mParent.addView(v);
mAddedViews.add(v);
}
- } else if (mMode == ISO_MODE) {
- int[] isoRange = mSettingsManager.getIsoRangeValues(mSettingsManager.getCurrentCameraId());
- int value = Integer.parseInt(mSettingsManager.getValue(SettingsManager.KEY_MANUAL_ISO_VALUE));
- if (isoRange == null) {
- Log.v(TAG, "getIsoRangeValues is NULL");
- return;
- }
- setIsoSlider((float)value/isoRange[1],true);
- int stride = mCurveRight - mCurveLeft;
- for (int i = 0; i < 2; i++) {
- TextView v = new TextView(mContext);
- String s = "" + isoRange[0];
- if (i == 1) s = "" + isoRange[1];
- v.setText(s);
- v.setTextColor(Color.WHITE);
- v.measure(0, 0);
- ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(v.getMeasuredWidth(),
- v.getMeasuredHeight());
- v.setLayoutParams(lp);
- v.setX(mCurveLeft + i * stride - v.getMeasuredWidth() / 2);
- v.setY(mCurveY - 2 * v.getMeasuredHeight());
- mParent.addView(v);
- mAddedViews.add(v);
- }
} else {
if (key == null) return;
CharSequence[] cc = mSettingsManager.getEntries(key);
int length = mSettingsManager.getEntryValues(key).length;
int index = mSettingsManager.getValueIndex(key);
updateSlider(length);
-
for (int i = 0; i < length; i++) {
View v;
if (mMode == WHITE_BALANCE_MODE) {
@@ -319,7 +272,7 @@ public class ProMode extends View {
case WHITE_BALANCE_MODE:
return SettingsManager.KEY_WHITE_BALANCE;
case ISO_MODE:
- return SettingsManager.KEY_MANUAL_ISO_VALUE;
+ return SettingsManager.KEY_ISO;
}
return null;
}
@@ -351,19 +304,6 @@ public class ProMode extends View {
invalidate();
}
- public void setIsoSlider(float slider, boolean forceNotify) {
- mIsoSlider = slider;
- int[] isoRange = mSettingsManager.getIsoRangeValues(mSettingsManager.getCurrentCameraId());
- int maxIso = 1600;
- if (isoRange != null) {
- maxIso = isoRange[1];
- }
- mSettingsManager.setIsoValue(SettingsManager.KEY_MANUAL_ISO_VALUE, forceNotify,
- mIsoSlider, maxIso);
- mUI.updateProModeText(mMode, "Iso" + (int)(mIsoSlider * maxIso));
- invalidate();
- }
-
private void setIndex(int index, boolean force) {
if (mIndex == index && !force) return;
if (mIndex != -1) {
@@ -410,11 +350,6 @@ public class ProMode extends View {
if (slider >= 0) {
setSlider(slider,false);
}
- } else if (mMode == ISO_MODE) {
- float slider = getSlider(event.getX(), event.getY());
- if (slider >= 0) {
- setIsoSlider(slider,false);
- }
} else {
int idx = findButton(event.getX(), event.getY());
if (idx != -1) {