Skip to content

Commit b0ba615

Browse files
committed
* little code cleanup
* color of shutter button after after an image capture
1 parent cd592f3 commit b0ba615

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

app/src/main/java/com/todobom/opennotescanner/OpenNoteScannerActivity.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ public HUDCanvasView getHUD() {
149149

150150
public void setImageProcessorBusy(boolean imageProcessorBusy) {
151151
this.imageProcessorBusy = imageProcessorBusy;
152+
if (!imageProcessorBusy) {
153+
mWaitSpinner.setVisibility(View.GONE);
154+
}
152155
}
153156

154157
private boolean imageProcessorBusy=true;
@@ -460,8 +463,7 @@ public void onResume() {
460463
if (mImageProcessor == null) {
461464
mImageProcessor = new ImageProcessor(mImageThread.getLooper(), new Handler(), this);
462465
}
463-
imageProcessorBusy = false;
464-
mWaitSpinner.setVisibility(View.GONE);
466+
this.setImageProcessorBusy(false);
465467

466468
}
467469

@@ -714,7 +716,7 @@ public void onAutoFocusMoving(boolean start, Camera camera) {
714716
Log.d(TAG, "onPreviewFrame - received image " + pictureSize.width + "x" + pictureSize.height);
715717

716718
if ( focused && ! imageProcessorBusy ) {
717-
imageProcessorBusy = true;
719+
setImageProcessorBusy(true);
718720
Mat yuv = new Mat(new Size(pictureSize.width, pictureSize.height * 1.5), CvType.CV_8UC1);
719721
yuv.put(0, 0, data);
720722

@@ -740,7 +742,7 @@ public void run() {
740742
private class ResetShutterColor implements Runnable {
741743
@Override
742744
public void run() {
743-
scanDocButton.setBackgroundTintList(ColorStateList.valueOf(0xFF00FFFF));
745+
scanDocButton.setBackgroundTintList(null);
744746
}
745747
}
746748

@@ -766,7 +768,7 @@ public void onPictureTaken(byte[] data, Camera camera) {
766768
Mat mat = new Mat(new Size(pictureSize.width, pictureSize.height), CvType.CV_8U);
767769
mat.put(0, 0, data);
768770

769-
imageProcessorBusy = true;
771+
setImageProcessorBusy(true);
770772
sendImageProcessorMessage("pictureTaken", mat);
771773

772774
shootSound();

0 commit comments

Comments
 (0)