Support api 24

This commit is contained in:
Gergely Hegedus 2023-12-18 20:17:38 +01:00
parent 83cbd935ae
commit c2ca9009c0
3 changed files with 6 additions and 6 deletions

View file

@ -42,7 +42,7 @@ fun interface PreviewProcessor {
@Composable
fun CameraView(
interval: Duration,
intervalInMillis: Long,
processImage: PreviewProcessor,
backgroundColor: Color = Color.Black,
) {
@ -74,7 +74,7 @@ fun CameraView(
bitmapReaderScope.launch {
while (isActive) {
delay(interval.toMillis())
delay(intervalInMillis)
bitmapStream.value = bitmap
}
}

View file

@ -61,7 +61,7 @@ fun QRCodeReader() {
.weight(1f)
.fillMaxWidth(),
) {
CameraView(interval = Duration.ofSeconds(1), processImage = {
CameraView(intervalInMillis = 1000L, processImage = {
readState = processImage(it, readState)
})
}