-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#21: The app becomes unusable if user closes folder selection dialog #32
Conversation
shubertm
commented
Dec 5, 2023
•
edited by kirillt
Loading
edited by kirillt
- The app becomes unusable if user closes folder selection dialog #21
val activity = (requireActivity() as MainActivity) | ||
if (activity.memoPreferences.getPathString() == null) activity.finish() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming FilePickerDialog
might probably be used in other activity in the future, rather than MainActivity
, this casting will cause a crash.
What do you think about below?
val activity = (requireActivity() as MainActivity) | |
if (activity.memoPreferences.getPathString() == null) activity.finish() | |
} | |
val activity = (activity as? MainActivity) | |
if (activity?.memoPreferences?.getPathString() == null) activity?.finish() | |
} |
fun show() { | ||
ArkFilePickerFragment.newInstance(getFilePickerConfig()).show(fragmentManager!!, TAG) | ||
newInstance(getFilePickerConfig()).show(fragmentManager!!, TAG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newInstance(getFilePickerConfig()).show(fragmentManager!!, TAG) | |
fragmentManager?.let { newInstance(getFilePickerConfig()).show(it, TAG) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think fragmentManager
can not really be null here. We can just make it non-nullable
Doesn't look fixed: bug.mp4It's possible to close the app and start it again, but it works the same way in other branches. The best would be to disable touching outside the filepicker. |
* SVG generating * Fix gradle build and deprecated APIs * Move local texts to string resource file * Add extended fab * Generalize file listing function * Fix extra line feed in text content Co-authored-by: Tuan Nguyen <[email protected]>
Bumps [com.google.code.gson:gson](https://github.com/google/gson) from 2.8.9 to 2.10.1. - [Release notes](https://github.com/google/gson/releases) - [Changelog](https://github.com/google/gson/blob/main/CHANGELOG.md) - [Commits](google/gson@gson-parent-2.8.9...gson-parent-2.10.1) --- updated-dependencies: - dependency-name: com.google.code.gson:gson dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works 👍
Cool |
# Conflicts: # app/src/main/java/dev/arkbuilders/arkmemo/ui/activities/MainActivity.kt # app/src/main/java/dev/arkbuilders/arkmemo/ui/dialogs/FilePickerDialog.kt