|
|
@@ -15,6 +15,7 @@ import com.cjt2325.cameralibrary.listener.JCameraListener;
|
|
|
import com.cjt2325.cameralibrary.util.FileUtil;
|
|
|
import com.miekir.ocr.R;
|
|
|
import com.miekir.ocr.base.BaseCameraActivity;
|
|
|
+import com.miekir.ocr.widget.CropView;
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
|
@@ -27,6 +28,7 @@ import java.io.File;
|
|
|
*/
|
|
|
public class WechatCameraActivity extends BaseCameraActivity {
|
|
|
private JCameraView jCameraView;
|
|
|
+ private CropView pcv_scan;
|
|
|
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
@@ -42,6 +44,7 @@ public class WechatCameraActivity extends BaseCameraActivity {
|
|
|
|
|
|
@Override
|
|
|
public void initViews(Bundle savedInstanceState) {
|
|
|
+ pcv_scan = findViewById(R.id.pcv_scan);
|
|
|
jCameraView = (JCameraView) findViewById(R.id.jcameraview);
|
|
|
//设置视频保存路径
|
|
|
jCameraView.setSaveVideoPath(Environment.getExternalStorageDirectory().getPath() + File.separator + "JCamera");
|
|
|
@@ -87,6 +90,18 @@ public class WechatCameraActivity extends BaseCameraActivity {
|
|
|
finish();
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ pcv_scan.setOnTouchUpListener(new CropView.onTouchUpListener() {
|
|
|
+ @Override
|
|
|
+ public void onTouch(MotionEvent event) {
|
|
|
+ if (event.getPointerCount() == 1) {
|
|
|
+ //显示对焦指示器
|
|
|
+ if (jCameraView != null) {
|
|
|
+ jCameraView.setFocusViewWidthAnimation(event.getX(), event.getY());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -109,27 +124,6 @@ public class WechatCameraActivity extends BaseCameraActivity {
|
|
|
}*/
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public boolean onTouchEvent(MotionEvent event) {
|
|
|
- switch (event.getAction()) {
|
|
|
- case MotionEvent.ACTION_DOWN:
|
|
|
- if (event.getPointerCount() == 1) {
|
|
|
- //显示对焦指示器
|
|
|
- if (jCameraView != null) {
|
|
|
- jCameraView.setFocusViewWidthAnimation(event.getX(), event.getY());
|
|
|
- }
|
|
|
- }
|
|
|
- if (event.getPointerCount() == 2) {
|
|
|
- Log.i("CJT", "ACTION_DOWN = " + 2);
|
|
|
- }
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- return super.onTouchEvent(event);
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
protected void onResume() {
|
|
|
super.onResume();
|