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:
@@ -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" >
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user