9
0
mirror of https://gitee.com/shuto/customCamera.git synced 2026-04-14 00:00:03 +08:00

Modifications mineures après premier pull request

This commit is contained in:
Thomas BOY
2014-12-01 17:10:27 +01:00
parent c0c9726b60
commit f27b9d277a
2 changed files with 7 additions and 7 deletions

View File

@@ -27,7 +27,7 @@
</FrameLayout>
<LinearLayout
android:id="@+id/linearLayout1"
android:id="@+id/beforePhoto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
@@ -68,7 +68,7 @@
</LinearLayout>
<FrameLayout
android:id="@+id/FrameLayout1"
android:id="@+id/afterPhoto"
android:layout_width="match_parent"
android:layout_height="match_parent" >

View File

@@ -183,12 +183,14 @@ public class CameraActivity extends Activity {
if (newDist > distanceBetweenFingers) {
//zoom in
if (zoom < maxZoom/2)
if (zoom < maxZoom/2) {
zoom+=2;
}
} else if (newDist < distanceBetweenFingers) {
//zoom out
if (zoom > 0)
if (zoom > 0) {
zoom-=2;
}
}
distanceBetweenFingers = newDist;
params.setZoom(zoom);
@@ -202,7 +204,7 @@ public class CameraActivity extends Activity {
* @param Parameters params Camera's parameter.
*/
public void handleFocus(MotionEvent event, Camera.Parameters params) {
try {
if (photoTaken == false) {
List<String> supportedFocusModes = params.getSupportedFocusModes();
if (supportedFocusModes != null && supportedFocusModes.contains(Camera.Parameters.FOCUS_MODE_AUTO)) {
mCamera.autoFocus(new Camera.AutoFocusCallback() {
@@ -210,8 +212,6 @@ public class CameraActivity extends Activity {
public void onAutoFocus(boolean b, Camera camera) {}
});
}
} catch (Exception e) {
e.printStackTrace();
}
}