summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CaptureUI.java
diff options
context:
space:
mode:
authorWeijie Wang <weijiew@codeaurora.org>2017-07-12 19:56:25 +0800
committerWeijie Wang <weijiew@codeaurora.org>2017-09-04 18:25:58 +0800
commit454d5b45b6b08e9213dc590fa0ebd084b50408fe (patch)
tree9305ca35cf4b783c9f67b10ef55c0dec5cb6412c /src/com/android/camera/CaptureUI.java
parent278267a43e560e7146ae842e393329501ab7dc9b (diff)
downloadandroid_packages_apps_Snap-454d5b45b6b08e9213dc590fa0ebd084b50408fe.tar.gz
android_packages_apps_Snap-454d5b45b6b08e9213dc590fa0ebd084b50408fe.tar.bz2
android_packages_apps_Snap-454d5b45b6b08e9213dc590fa0ebd084b50408fe.zip
SnapdragonCamera: refactor captureStillPicture
1. Split captureStillPicture into multiple smaller methods 2. Add some logs 3. Delete hack code Change-Id: I0ebc9625be880539f7c0c1d68350c093616205ad
Diffstat (limited to 'src/com/android/camera/CaptureUI.java')
-rw-r--r--[-rwxr-xr-x]src/com/android/camera/CaptureUI.java24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/com/android/camera/CaptureUI.java b/src/com/android/camera/CaptureUI.java
index 6ec09effd..d0b129ad9 100755..100644
--- a/src/com/android/camera/CaptureUI.java
+++ b/src/com/android/camera/CaptureUI.java
@@ -306,8 +306,10 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
mMakeupSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progresValue, boolean fromUser) {
- int value = progresValue/10*10;
- mSettingsManager.setValue(SettingsManager.KEY_MAKEUP, value+"");
+ if ( progresValue != 0 ) {
+ int value = 10 + 9 * progresValue / 10;
+ mSettingsManager.setValue(SettingsManager.KEY_MAKEUP, value + "");
+ }
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
@@ -484,8 +486,8 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
showFirstTimeHelp();
}
- protected void showCapturedImageForReview(byte[] jpegData, int orientation, boolean mirror) {
- mDecodeTaskForReview = new CaptureUI.DecodeImageForReview(jpegData, orientation, mirror);
+ protected void showCapturedImageForReview(byte[] jpegData, int orientation) {
+ mDecodeTaskForReview = new CaptureUI.DecodeImageForReview(jpegData, orientation);
mDecodeTaskForReview.execute();
if (getCurrentIntentMode() != CaptureModule.INTENT_MODE_NORMAL) {
if (mFilterMenuStatus == FILTER_MENU_ON) {
@@ -1737,24 +1739,18 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
private class DecodeTask extends AsyncTask<Void, Void, Bitmap> {
private final byte [] mData;
private int mOrientation;
- private boolean mMirror;
- public DecodeTask(byte[] data, int orientation, boolean mirror) {
+ public DecodeTask(byte[] data, int orientation) {
mData = data;
mOrientation = orientation;
- mMirror = mirror;
}
@Override
protected Bitmap doInBackground(Void... params) {
Bitmap bitmap = CameraUtil.downSample(mData, mDownSampleFactor);
// Decode image in background.
- if ((mOrientation != 0 || mMirror) && (bitmap != null)) {
+ if ((mOrientation != 0) && (bitmap != null)) {
Matrix m = new Matrix();
- if (mMirror) {
- // Flip horizontally
- m.setScale(-1f, 1f);
- }
m.preRotate(mOrientation);
return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), m,
false);
@@ -1768,8 +1764,8 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
}
private class DecodeImageForReview extends CaptureUI.DecodeTask {
- public DecodeImageForReview(byte[] data, int orientation, boolean mirror) {
- super(data, orientation, mirror);
+ public DecodeImageForReview(byte[] data, int orientation) {
+ super(data, orientation);
}
@Override