|
|
@@ -14,6 +14,7 @@ import android.widget.TextView;
|
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
|
|
+import com.miekir.common.utils.SizeTool;
|
|
|
import com.miekir.common.utils.ToastTool;
|
|
|
import com.miekir.common.utils.ViewTool;
|
|
|
import com.miekir.mvp.presenter.InjectPresenter;
|
|
|
@@ -179,6 +180,23 @@ public class OtaOperationActivity extends OtaCameraActivity implements CropView.
|
|
|
mTop = startY;
|
|
|
mRight = endX;
|
|
|
mBottom = endY;
|
|
|
+ if (mLeft <= 0) {
|
|
|
+ mLeft = 0;
|
|
|
+ mRight += startX;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (mLeft + mRight > SizeTool.SCREEN_WIDTH) {
|
|
|
+ mRight = SizeTool.SCREEN_WIDTH - mLeft;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (mTop <= 0) {
|
|
|
+ mTop = 0;
|
|
|
+ mBottom += startY;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (mTop + mBottom > SizeTool.SCREEN_HEIGHT) {
|
|
|
+ mBottom = SizeTool.SCREEN_HEIGHT - mTop;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -187,13 +205,17 @@ public class OtaOperationActivity extends OtaCameraActivity implements CropView.
|
|
|
showResultDialog(result);
|
|
|
}
|
|
|
|
|
|
+ private AlertDialog dialog;
|
|
|
/**
|
|
|
* 弹出识别对话框
|
|
|
* @param result
|
|
|
*/
|
|
|
private void showResultDialog(OcrResult result) {
|
|
|
+ if (dialog != null && dialog.isShowing()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
mIsUploading = false;
|
|
|
- AlertDialog dialog = new AlertDialog.Builder(this).setView(R.layout.dialog_result).create();
|
|
|
+ dialog = new AlertDialog.Builder(this).setView(R.layout.dialog_result).create();
|
|
|
dialog.show();
|
|
|
dialog.setCancelable(false);
|
|
|
dialog.setCanceledOnTouchOutside(false);
|