commit
fba591277d
3 changed files with 6 additions and 6 deletions
|
|
@ -13,7 +13,7 @@ android {
|
|||
|
||||
defaultConfig {
|
||||
applicationId applicationIdArgument ?: "org.fnives.android.qrcodetransfer"
|
||||
minSdk 26
|
||||
minSdk 24
|
||||
targetSdk 34
|
||||
versionCode applicationVersionCodeArgument ?: 1
|
||||
versionName "1.0"
|
||||
|
|
@ -75,7 +75,7 @@ dependencies {
|
|||
def compose_ui_version = '1.5.4'
|
||||
implementation 'androidx.core:core-ktx:1.12.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
|
||||
implementation 'androidx.activity:activity-compose:1.8.1'
|
||||
implementation 'androidx.activity:activity-compose:1.8.2'
|
||||
implementation "androidx.compose.ui:ui:$compose_ui_version"
|
||||
implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"
|
||||
implementation 'androidx.compose.material:material:1.5.4'
|
||||
|
|
@ -87,7 +87,7 @@ dependencies {
|
|||
implementation 'com.google.accompanist:accompanist-permissions:0.32.0'
|
||||
|
||||
// camerax
|
||||
def camerax_version = "1.3.0"
|
||||
def camerax_version = "1.3.1"
|
||||
implementation "androidx.camera:camera-camera2:$camerax_version"
|
||||
implementation "androidx.camera:camera-lifecycle:$camerax_version"
|
||||
implementation "androidx.camera:camera-view:$camerax_version"
|
||||
|
|
|
|||
|
|
@ -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