Skip to content

Dev#69

Merged
ChochaNaresh merged 16 commits intomasterfrom
Dev
May 30, 2025
Merged

Dev#69
ChochaNaresh merged 16 commits intomasterfrom
Dev

Conversation

@ChochaNaresh
Copy link
Owner

✨ What's Changed

Describe the changes you made in this PR.

✅ Checklist

  • ✅ I've tested this on a device/emulator
  • ✅ I've added tests where applicable
  • ✅ I've updated documentation (if needed)
  • ✅ This PR follows the CONTRIBUTING.md guidelines

naresh chocha and others added 16 commits May 27, 2025 11:15
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.
…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`.
@ChochaNaresh ChochaNaresh merged commit 1df651a into master May 30, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant