Merged
Conversation
This commit introduces two new composable functions for displaying dialogs: - `AppDialog`: A basic dialog wrapper using `BasicAlertDialog`. - `AppAlertDialog`: A more structured alert dialog built on top of `AlertDialog`. These components provide reusable and customizable dialogs for the library. The `PopUpActivity` has been updated to use the new `AppDialog` for a consistent look and feel, and the layout of the item list within the dialog has been adjusted. Additionally, the Detekt plugin has been re-enabled and its version updated in `gradle/libs.versions.toml`.
- Allow customization of title and item views in PopUpActivity
- Add horizontal and vertical orientation options for item list
- Update detekt configuration:
- Ignore default parameters for LongParameterList
- Ignore @Preview and @composable annotated functions for TooManyFunctions and FunctionNaming rules
- Ignore property declarations for MagicNumber rule
- Allow unused private members with @Preview annotation
- Extracted permission request logic into `checkAndRequestPermissions`. - Extracted permission result handling into `handlePermissionResult`. - Extracted image capture result handling into `handleImageCaptureResult`. - Replaced AlertDialog with composable `AppAlertDialog` for permission and setting dialogs. - Ensured `context` is passed consistently for resource access. - Updated `AppAlertDialog` to use string resources for default button text.
…tivity` This commit refactors the `ImageCaptureActivity` by extracting the UI setup logic into a new composable function named `SetUI`. Additionally, the `createFileGetUri` function in `PickerUtils.kt` has been updated to improve its logic for creating and retrieving file URIs. It now initializes the URI to null and only attempts to get the URI if the file exists after creation attempts. The `pathFromURI` function in `FileUtils.kt` has also been refactored for better readability and to ensure a null return if `filePath` is null. Finally, trailing whitespace has been removed from several files for consistency.
… config comparisons
…eAs for config comparisons
…ideoCaptureActivity
… DocumentFilePickerActivity
…ns with maxSdkVersion 32 in AndroidManifest.xml
…dability
This commit refactors `MediaFilePickerActivity.kt` to improve its structure and maintainability. Key changes include:
- **Composable functions for UI elements:** Permission dialogs, file picker launchers, and settings launchers are now encapsulated in separate composable functions.
- **Improved permission handling:** The logic for checking and requesting permissions has been streamlined.
- **Enhanced file path handling:**
- Introduced `sanitizeFileName` function in `FilePathExtentions.kt` to prevent potential security issues and ensure valid file names. This function is now used when retrieving file names from content URIs.
- Updated `FileUtils.kt` to use `toUri()` for parsing content URI prefixes, improving robustness.
- **Code organization:** Helper functions have been moved out of the `MediaFilePickerActivity` class for better separation of concerns.
- **Minor log tag update:** Corrected a typo in a log tag constant in `Const.kt`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ What's Changed
Describe the changes you made in this PR.
✅ Checklist