Crash fixes (#38)

* Updated animation specifications for UI controls and overlays to use a 200ms tween duration.

* Implemented fallback file picker and improved CSS rule merging efficiency to fix OOM.
This commit is contained in:
Aryan 2026-03-07 19:40:50 +05:30 committed by GitHub
parent 77a09c545f
commit 3a31e4fc7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 133 additions and 58 deletions

View file

@ -214,11 +214,31 @@ fun HomeScreen(
}
}
val fallbackFilePickerLauncher = rememberLauncherForActivityResult(
contract = ActivityResultContracts.GetMultipleContents()
) { uris ->
if (isContextualModeActive) {
viewModel.clearContextualAction()
}
uris.forEach { uri ->
viewModel.onFileSelected(uri, isFromRecent = false)
}
}
val onSelectFileClick = {
if (isContextualModeActive) {
viewModel.clearContextualAction()
}
pickFileLauncher.launch(arrayOf("*/*"))
try {
pickFileLauncher.launch(arrayOf("*/*"))
} catch (_: android.content.ActivityNotFoundException) {
Timber.w("OpenDocument picker failed. Falling back to GetMultipleContents.")
try {
fallbackFilePickerLauncher.launch("*/*")
} catch (_: android.content.ActivityNotFoundException) {
viewModel.showBanner("No file manager found. Please install a file manager app.", isError = true)
}
}
}
Box(modifier = Modifier.fillMaxSize()) {