Support api 24
This commit is contained in:
parent
83cbd935ae
commit
c2ca9009c0
3 changed files with 6 additions and 6 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ fun QRCodeReader() {
|
|||
.weight(1f)
|
||||
.fillMaxWidth(),
|
||||
) {
|
||||
CameraView(interval = Duration.ofSeconds(1), processImage = {
|
||||
CameraView(intervalInMillis = 1000L, processImage = {
|
||||
readState = processImage(it, readState)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue