Skip to content

fix(UI): Compatibility issues(systemBars, photo permissions)#367

Merged
rosuH merged 15 commits intomasterfrom
dev
Oct 26, 2025
Merged

fix(UI): Compatibility issues(systemBars, photo permissions)#367
rosuH merged 15 commits intomasterfrom
dev

Conversation

@rosuH
Copy link
Owner

@rosuH rosuH commented Oct 26, 2025

This pull request introduces several improvements to the app's image picking functionality and enhances system bar inset handling for a more modern and consistent UI experience. The most significant changes are the migration to the Android Photo Picker API, updates to permission handling for newer Android versions, and improved support for system window insets across activities and custom views.

Image Picking & Permissions

  • Migrated image picking logic in MainActivity from a custom PickImageContract to the Android Photo Picker API (ActivityResultContracts.PickVisualMedia and PickMultipleVisualMedia), with fallback to legacy pickers for older devices. This simplifies code and improves compatibility with Android 13+ privacy requirements. ([[1]](https://github.com/rosuH/EasyWatermark/pull/367/files#diff-a7ebc7e11c0880fadc1c7fbac548ddebdd0038b6238793f6c16b643c78bb69cdL64-R78), [[2]](https://github.com/rosuH/EasyWatermark/pull/367/files#diff-a7ebc7e11c0880fadc1c7fbac548ddebdd0038b6238793f6c16b643c78bb69cdL230-R249), [[3]](https://github.com/rosuH/EasyWatermark/pull/367/files#diff-a7ebc7e11c0880fadc1c7fbac548ddebdd0038b6238793f6c16b643c78bb69cdL686-R722), [[4]](https://github.com/rosuH/EasyWatermark/pull/367/files#diff-bbe19512b5710e18f618d2254087e95caa404e1b514b226902a9edb22f464820L1-L21))
  • Updated permission declarations in AndroidManifest.xml to support new media access permissions for Android 13 (API 33) and Android 14 (API 34), ensuring proper access to images across different OS versions. ([app/src/main/AndroidManifest.xmlR11-R21](https://github.com/rosuH/EasyWatermark/pull/367/files#diff-7fa6aef292187a049f7a4d6060d8df3ba212d838789c78940bd363344b1c38cdR11-R21))

System Window Insets Handling

  • fixed Fullscreen view prevents use #366

  • fixed Parts of the app are covering the navigation buttons #361

  • Refactored AboutActivity and OpenSourceActivity to use a new doOnApplyWindowInsets extension for applying system bar insets via padding, replacing older margin-based logic and improving UI consistency on devices with display cutouts and gesture navigation. ([[1]](https://github.com/rosuH/EasyWatermark/pull/367/files#diff-8324ba88e7d9530e83380480e9a619de95ad655788a99941333ddda7c10e063cL70-R83), [[2]](https://github.com/rosuH/EasyWatermark/pull/367/files#diff-a655789ae95db36f15349affc8d415a888172f6b947cb5235d7d52ad2dc8b223R19-R29))

  • Enhanced LaunchView to handle system bar and display cutout insets, dynamically updating its margins to ensure proper layout regardless of device configuration. ([app/src/main/java/me/rosuh/easywatermark/ui/widget/LaunchView.ktR252-R266](https://github.com/rosuH/EasyWatermark/pull/367/files#diff-9d262bf061d53d76143e5503d95d20027b33b1af5643d40a6f0b3920261c9f53R252-R266))

General Codebase Clean-up

  • Removed the now-obsolete PickImageContract class, as all image picking is handled by standard Android APIs. ([app/src/main/java/me/rosuh/easywatermark/utils/PickImageContract.ktL1-L21](https://github.com/rosuH/EasyWatermark/pull/367/files#diff-bbe19512b5710e18f618d2254087e95caa404e1b514b226902a9edb22f464820L1-L21))
  • Updated imports and minor layout details in affected files to support the new APIs and logic. ([[1]](https://github.com/rosuH/EasyWatermark/pull/367/files#diff-a7ebc7e11c0880fadc1c7fbac548ddebdd0038b6238793f6c16b643c78bb69cdL23-R31), [[2]](https://github.com/rosuH/EasyWatermark/pull/367/files#diff-8324ba88e7d9530e83380480e9a619de95ad655788a99941333ddda7c10e063cL11-L22), [[3]](https://github.com/rosuH/EasyWatermark/pull/367/files#diff-9d262bf061d53d76143e5503d95d20027b33b1af5643d40a6f0b3920261c9f53R14-R18), [[4]](https://github.com/rosuH/EasyWatermark/pull/367/files#diff-9d262bf061d53d76143e5503d95d20027b33b1af5643d40a6f0b3920261c9f53R29))

Version Update

  • Bumped app version to 2.10.0 (versionCode 21000) in build.gradle.kts to reflect these significant changes. ([app/build.gradle.ktsL19-R20](https://github.com/rosuH/EasyWatermark/pull/367/files#diff-8cff73265af19c059547b76aca8882cbaa3209291406f52df1dafbbc78e80c46L19-R20))

rosuH added 10 commits July 14, 2024 23:08
…yResultLauncher

This commit introduces a new way to handle storage permissions by utilizing the ActivityResultLauncher for requesting multiple permissions. The previous implementation using ActivityCompat has been replaced, allowing for a more robust and modern approach to permission management.

# GENERATE BY https://aicommit.app
…troduce new permission check functions

This commit modifies the way storage permissions are handled in the application. The `isStoragePermissionGrated` function is updated to take a permission string as an argument, allowing for greater flexibility. Additionally, new methods `checkReadingPermission` and `checkWritingPermission` are added to streamline the process of checking and requesting permissions.

# GENERATE BY https://aicommit.app
# Conflicts:
#	app/src/main/java/me/rosuh/easywatermark/utils/ktx/ContextExtension.kt
#	gradle.properties
- Added `doOnApplyWindowInsets` extension support for consistent inset handling across multiple activities and views.
- Updated `LaunchView.kt` to account for system bar insets and refactored child view layout logic to use calculated available height and dynamic margins.
- Modified `AboutActivity.kt` and `OpenSourceActivity.kt` to use new inset utility instead of legacy `ViewCompat.setOnApplyWindowInsetsListener`.
- Introduced new `WindowInsetsExt.kt` to centralize window inset logic.
- Updated imports in `MainActivity.kt` for window inset compatibility utilities.

Refs: #366,#361

> GENERATE BY https://aicommit.app
- Added new photo picker intents using `ActivityResultContracts.PickVisualMedia`
- Introduced fallback to legacy gallery picker for lower Android versions
- Removed custom `PickImageContract` implementation (file deleted)
- Updated `AndroidManifest.xml` with permissions for Android 12L–14
- Simplified permissions handling in `ContextExtension.kt`
- Updated `MainActivity.kt` to use multiple and single image pickers with improved media handling
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

rosuH and others added 3 commits October 26, 2025 14:27
- Replaced READ_EXTERNAL_STORAGE with conditional permission logic
  to support Android 13 (TIRAMISU) and above.
- Introduced permission variable for backward compatibility.
- Ensured consistent call to preCheckStoragePermission().
- Modified ContextExtension.kt to handle new Android SDK changes.
- Added new `WindowInsetsExt.kt` under `utils.ktx` to handle window insets safely.
- Introduced `InitialPadding` data class and `doOnApplyWindowInsets()` extension for `View`.
…tion handling (#363)

Co-authored-by: rosuH <15865017+rosuH@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rosuH <hi@rosuh.me>
cursor[bot]

This comment was marked as outdated.

rosuH added 2 commits October 26, 2025 14:41
- Introduced `pendingPermissionAction` to store actions awaiting permission result
- Ensured deferred actions are invoked only after permission granted
- Cleared `pendingPermissionAction` to prevent memory leaks and repeated invocation
- Updated both read and write permission flows in `MainActivity.kt`

> GENERATE BY https://aicommit.app
- renamed job to `Compile (app:assembleDebug)` for clarity
- added concurrency control to cancel redundant runs
- introduced `paths-ignore` and `permissions` for optimized triggers and security
- validated Gradle wrapper for build integrity
- switched JDK setup from Zulu to Temurin 17
- added Android SDK setup for better environment preparedness
- improved Gradle caching strategy with read-only mode on PRs
- removed obsolete `simple_compile` job and duplicate steps
- updated workflow display name to “PR Checks”

Affected file: `.github/workflows/pr_pre_check.yml`

> GENERATE BY https://aicommit.app
@rosuH rosuH merged commit c8af8b2 into master Oct 26, 2025
3 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.

Fullscreen view prevents use Parts of the app are covering the navigation buttons

2 participants

Comments