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:
parent
77a09c545f
commit
3a31e4fc7b
7 changed files with 133 additions and 58 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue