- Откройте AlertDialog — работает нормально
- Откройте VNDocumentCameraViewController сканер
- Закрыть сканер
- Попробуйте снова открыть AlertDialog — не отображается
`@Composable
actual fun rememberDocumentScanner(
onResult: (Result) -> Unit,
options: DocumentScannerOptions
): DocumentScanner {
val localViewController = LocalUIViewController.current
return object : DocumentScanner {
override fun scan() {
val controller = VNDocumentCameraViewController()
controller.setDelegate(
DocumentScannerDelegate(
onError = {
controller.dismissViewControllerAnimated(true) {
restoreComposeWindow(localViewController)
}
// error handling
},
onCancel = {
controller.dismissViewControllerAnimated(true) {
restoreComposeWindow(localViewController)
}
},
onResult = { result ->
controller.dismissViewControllerAnimated(true) {
restoreComposeWindow(localViewController)
}
// result handling
}
)
)
localViewController.presentViewController(controller, animated = true) {
// scanner configuration
}
}
}
}
fun restoreComposeWindow(localViewController: UIViewController?) {
val view = localViewController?.view ?: return
view.setNeedsLayout()
view.layoutIfNeeded()
view.setNeedsDisplay()
}
`
- OK Scanner opens and works perfectly
- OK Regular UI components (TextField, Button, Navigation) work fine
- FAIL AlertDialog - doesn't show after scanner
- FAIL DatePickerDialog - doesn't show after scanner
- FAIL ExposedDropdownMenuBox - doesn't show after scanner
- FAIL All popup-based components fail
Подробнее здесь: https://stackoverflow.com/questions/797 ... d-for-vndo
Мобильная версия