Skip to content

Commit

Permalink
graphicOverlay clear & postInvalidate when onFailure
Browse files Browse the repository at this point in the history
  • Loading branch information
hongbeomi committed Dec 12, 2020
1 parent 86a39af commit e116dc9
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ import java.io.FileOutputStream
abstract class BaseImageAnalyzer<T> : ImageAnalysis.Analyzer {

abstract val graphicOverlay: GraphicOverlay
private var saveAction: ((Context) -> Unit)? = null

// var onTakePictureListener: OnTakePictureListener = object : OnTakePictureListener {
// override fun onTakePicture(context: Context) {
// saveAction?.invoke(context)
// }
// }

@SuppressLint("UnsafeExperimentalUsageError")
override fun analyze(imageProxy: ImageProxy) {
Expand All @@ -39,6 +32,8 @@ abstract class BaseImageAnalyzer<T> : ImageAnalysis.Analyzer {
)
}
.addOnFailureListener {
graphicOverlay.clear()
graphicOverlay.postInvalidate()
onFailure(it)
}
.addOnCompleteListener {
Expand Down

0 comments on commit e116dc9

Please sign in to comment.