summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/camera/NewPhotoModule.java6
-rw-r--r--src/com/android/camera/NewPhotoUI.java1
-rw-r--r--src/com/android/camera/NewPreviewGestures.java11
-rw-r--r--src/com/android/camera/NewVideoModule.java1
-rw-r--r--src/com/android/camera/NewVideoUI.java6
-rw-r--r--src/com/android/gallery3d/filtershow/category/Action.java2
-rw-r--r--src/com/android/gallery3d/filtershow/tools/IconFactory.java2
-rw-r--r--src/com/android/photos/drawables/MtpThumbnailDrawable.java61
8 files changed, 25 insertions, 65 deletions
diff --git a/src/com/android/camera/NewPhotoModule.java b/src/com/android/camera/NewPhotoModule.java
index 9911e8f4b..4796359ce 100644
--- a/src/com/android/camera/NewPhotoModule.java
+++ b/src/com/android/camera/NewPhotoModule.java
@@ -542,6 +542,8 @@ public class NewPhotoModule
mFocusManager.setParameters(mInitialParams);
setupPreview();
+ // reset zoom value index
+ mZoomValue = 0;
openCameraCommon();
if (ApiHelper.HAS_SURFACE_TEXTURE) {
@@ -752,6 +754,10 @@ public class NewPhotoModule
if (mPaused) {
return;
}
+ //TODO: We should show the picture taken rather than frozen preview here
+ if (mIsImageCaptureIntent) {
+ stopPreview();
+ }
if (mSceneMode == Util.SCENE_MODE_HDR) {
mUI.showSwitcher();
mUI.setSwipingEnabled(true);
diff --git a/src/com/android/camera/NewPhotoUI.java b/src/com/android/camera/NewPhotoUI.java
index 4d9469743..2f29e440f 100644
--- a/src/com/android/camera/NewPhotoUI.java
+++ b/src/com/android/camera/NewPhotoUI.java
@@ -293,6 +293,7 @@ public class NewPhotoUI implements PieListener,
mGestures = new NewPreviewGestures(mActivity, this, mZoomRenderer, mPieRenderer);
mRenderOverlay.setGestures(mGestures);
}
+ mGestures.setZoomEnabled(params.isZoomSupported());
mGestures.setRenderOverlay(mRenderOverlay);
mRenderOverlay.requestLayout();
diff --git a/src/com/android/camera/NewPreviewGestures.java b/src/com/android/camera/NewPreviewGestures.java
index 39c4be664..339c4b33f 100644
--- a/src/com/android/camera/NewPreviewGestures.java
+++ b/src/com/android/camera/NewPreviewGestures.java
@@ -69,6 +69,7 @@ public class NewPreviewGestures
private int mMode;
private int mSlop;
private int mTapTimeout;
+ private boolean mZoomEnabled;
private boolean mEnabled;
private boolean mZoomOnly;
private int mOrientation;
@@ -148,6 +149,10 @@ public class NewPreviewGestures
mEnabled = enabled;
}
+ public void setZoomEnabled(boolean enable) {
+ mZoomEnabled = enable;
+ }
+
public void setZoomOnly(boolean zoom) {
mZoomOnly = zoom;
}
@@ -178,7 +183,10 @@ public class NewPreviewGestures
mScale.onTouchEvent(m);
if (MotionEvent.ACTION_POINTER_DOWN == m.getActionMasked()) {
mMode = MODE_ZOOM;
- mZoom.onScaleBegin(mScale);
+ if (mZoomEnabled) {
+ // Start showing zoom UI as soon as there is a second finger down
+ mZoom.onScaleBegin(mScale);
+ }
} else if (MotionEvent.ACTION_POINTER_UP == m.getActionMasked()) {
mZoom.onScaleEnd(mScale);
}
@@ -241,6 +249,7 @@ public class NewPreviewGestures
if (mPie == null || !mPie.isOpen()) {
mMode = MODE_ZOOM;
mGestureDetector.onTouchEvent(makeCancelEvent(mCurrent));
+ if (!mZoomEnabled) return false;
return mZoom.onScaleBegin(detector);
}
return false;
diff --git a/src/com/android/camera/NewVideoModule.java b/src/com/android/camera/NewVideoModule.java
index 188a38965..8bec332f9 100644
--- a/src/com/android/camera/NewVideoModule.java
+++ b/src/com/android/camera/NewVideoModule.java
@@ -2015,6 +2015,7 @@ public class NewVideoModule implements NewCameraModule,
initializeVideoControl();
// From onResume
+ mZoomValue = 0;
mUI.initializeZoom(mParameters);
mUI.setOrientationIndicator(0, false);
diff --git a/src/com/android/camera/NewVideoUI.java b/src/com/android/camera/NewVideoUI.java
index 02c8e1c7a..9e2c10810 100644
--- a/src/com/android/camera/NewVideoUI.java
+++ b/src/com/android/camera/NewVideoUI.java
@@ -581,7 +581,11 @@ public class NewVideoUI implements PieRenderer.PieListener,
}
public void initializeZoom(Parameters param) {
- if (param == null || !param.isZoomSupported()) return;
+ if (param == null || !param.isZoomSupported()) {
+ mGestures.setZoomEnabled(false);
+ return;
+ }
+ mGestures.setZoomEnabled(true);
mZoomMax = param.getMaxZoom();
mZoomRatios = param.getZoomRatios();
// Currently we use immediate zoom for fast zooming to get better UX and
diff --git a/src/com/android/gallery3d/filtershow/category/Action.java b/src/com/android/gallery3d/filtershow/category/Action.java
index 506b2bf0f..b46147961 100644
--- a/src/com/android/gallery3d/filtershow/category/Action.java
+++ b/src/com/android/gallery3d/filtershow/category/Action.java
@@ -134,7 +134,7 @@ public class Action implements RenderingRequestCaller {
m.mapRect(image);
m.setRectToRect(image, frame, Matrix.ScaleToFit.FILL);
Canvas canvas = new Canvas(destination);
- canvas.drawBitmap(source, m, new Paint());
+ canvas.drawBitmap(source, m, new Paint(Paint.FILTER_BITMAP_FLAG));
}
@Override
diff --git a/src/com/android/gallery3d/filtershow/tools/IconFactory.java b/src/com/android/gallery3d/filtershow/tools/IconFactory.java
index ccc49e13d..9e39f27fc 100644
--- a/src/com/android/gallery3d/filtershow/tools/IconFactory.java
+++ b/src/com/android/gallery3d/filtershow/tools/IconFactory.java
@@ -103,6 +103,6 @@ public class IconFactory {
rec.roundOut(srcRect);
}
- canvas.drawBitmap(sourceImage, srcRect, destRect, new Paint());
+ canvas.drawBitmap(sourceImage, srcRect, destRect, new Paint(Paint.FILTER_BITMAP_FLAG));
}
}
diff --git a/src/com/android/photos/drawables/MtpThumbnailDrawable.java b/src/com/android/photos/drawables/MtpThumbnailDrawable.java
deleted file mode 100644
index e35e06943..000000000
--- a/src/com/android/photos/drawables/MtpThumbnailDrawable.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.photos.drawables;
-
-import android.mtp.MtpDevice;
-import android.mtp.MtpObjectInfo;
-
-import com.android.gallery3d.ingest.MtpDeviceIndex;
-
-import java.io.InputStream;
-
-public class MtpThumbnailDrawable extends AutoThumbnailDrawable<MtpObjectInfo> {
- public void setImage(MtpObjectInfo data) {
- if (data == null) {
- setImage(null, 0, 0);
- } else {
- setImage(data, data.getImagePixWidth(), data.getImagePixHeight());
- }
- }
-
- @Override
- protected byte[] getPreferredImageBytes(MtpObjectInfo data) {
- if (data == null) {
- return null;
- }
- MtpDevice device = MtpDeviceIndex.getInstance().getDevice();
- if (device != null) {
- return device.getThumbnail(data.getObjectHandle());
- } else {
- return null;
- }
- }
-
- @Override
- protected InputStream getFallbackImageStream(MtpObjectInfo data) {
- // No fallback
- return null;
- }
-
- @Override
- protected boolean dataChangedLocked(MtpObjectInfo data) {
- // We only fetch the MtpObjectInfo once when creating
- // the index so checking the reference is enough
- return mData == data;
- }
-
-}