Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ data class AIDataCaptureDemoUiState(
var zoomLevel: Float = 1.0f,
val appBarTitle: String = "",
val toastMessage: String? = null,
val barcodeCountMap: MutableMap<String, Int> = mutableMapOf<String, Int>(),

// Settings
var barcodeSettings : BarcodeSettings = FileUtils.loadBarcodeSettings(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,23 @@ fun DrawBarcodeResult(
text = barcodeData.text,
selectedDemo = UsecaseState.Barcode.value
)

val value = barcodeData.text
val count = uiState.barcodeCountMap.get(value) ?: 0
uiState.barcodeCountMap.put(value, count+1)
}
}

val list = uiState.barcodeCountMap.map { (key, value) -> "$key($value)" }
val result = list.joinToString(separator = "\n")
drawBbox(
0.dp,
0.dp,
Variables.cameraPreviewViewSize.width.dp,
100.dp,
result,
selectedDemo = UsecaseState.Barcode.value)
uiState.barcodeCountMap.clear()
}

@Composable
Expand Down