Draft: Compose/KMP migration checkpoint, not merge-ready#358
Draft
rosuH wants to merge 253 commits into
Draft
Conversation
…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
- Added new UI screens such as BackDropScreen, EditorScreen, and LaunchScreen. - Implemented new options for color, text, and tile mode customization. - Refactored existing code for better state management using Flow and ViewModel patterns. - Updated dependencies and removed unused plugins, specifically Spotless. - Enhanced image handling in GalleryDialog with new copy methods. - Updated MainActivity to utilize new string resource references. 🚧Still developing! # GENERATE BY https://aicommit.app
This commit migrates the dependency injection framework from Hilt to Koin across the codebase. Removed all Hilt-related annotations and imports, replaced them with Koin modules, and adjusted the gradle files accordingly. Updated relevant view models and repositories to use Koin's syntax instead of Hilt. Additionally, updated Android SDK and library versions for compatibility with Koin. > GENERATE BY https://aicommit.app
…alization - Updated the AboutActivity to use Koin's viewModel delegate instead of the deprecated viewModels. - Refactored the GalleryDialog to implement animated transitions for dialog dismissal and slide-in effects. - Streamlined the initialization of MainViewModel in AppModule, cleaning up redundant code. - Introduced transition helper classes for cleaner code sharing and handling animations. - Adjusted the permission request handling in LaunchScreen for better UX flow. > GENERATE BY https://aicommit.app
Added integration to allow users to pick multiple media items using the system's photo picker. Implemented necessary callbacks and UI updates for seamless media selection and navigation. > GENERATE BY https://aicommit.app
Updated compileSdk and targetSdk to 36, and Gradle wrapper to 8.13. Upgraded various libraries to improve performance and compatibility, including androidxNavigation, lifecycle components, and testing libraries. Switched to androidx-navigation3 for better navigation handling. Commented out unused androidx-motionlayout references. > GENERATE BY https://aicommit.app
Refactored the animation logic for tab transitions by introducing separate start and end animations for offsets. This improves the smoothness and control over tab indicator movements. fix(GalleryDialog): correct selection dismiss logic Adjusted the dismiss logic to correctly evaluate `selectedCount` ensuring proper functionality when items are selected. > GENERATE BY https://aicommit.app
…onsistency and improved UX Replaced deprecated use of `ModalBottomSheet` with `Box` + background approach to customize sheet visuals. Adjusted height calculations using `LocalWindowInfo` for accurate sizing. Also improved indicator rendering in `TabRow` with proper corner radius and dynamic height handling. Minor cleanup of unused/redundant UI elements. > GENERATE BY https://aicommit.app
# Conflicts: # app/src/main/java/me/rosuh/easywatermark/ui/MainActivity.kt # app/src/main/java/me/rosuh/easywatermark/utils/ktx/ContextExtension.kt # gradle.properties
# Conflicts: # app/src/main/java/me/rosuh/easywatermark/ui/MainActivity.kt # app/src/main/java/me/rosuh/easywatermark/utils/ktx/ContextExtension.kt # gradle.properties
# Conflicts: # buildSrc/src/main/kotlin/Dependencies.kt # gradle/libs.versions.toml # gradle/wrapper/gradle-wrapper.properties
Enabled edge-to-edge display in `ComposeMainActivity` by updating system bar styles and handling window insets. Removed the `BottomSurface` composable and its usages throughout the UI components, integrating its styling directly into the respective surfaces. Adjusted padding and layout modifiers to accommodate the edge-to-edge design.
Specifically:
- `ComposeMainActivity`:
- Implemented `enableEdgeToEdge` for transparent system bars.
- Used `Scaffold` with `contentWindowInsets = WindowInsets.safeDrawing` to handle safe areas.
- Applied `imePadding()` to `NavHost` for better keyboard interaction.
- `EditorScreen`:
- Removed `BottomSurface` wrapper from the main layout and `BottomView`.
- Removed `BottomSurface` from individual tabs in `BottomView`.
- Set `windowInsets = WindowInsets(0)` for `TopAppBar` in `EditorTopBar`.
- `Theme.kt`: Removed manual status bar color and appearance adjustments as `enableEdgeToEdge` handles this.
- Removed `BottomSurface` composable function.
…tes based on selected tab index Improved recomposition logic by using remember with dependencies on selectedTabIndex, ensuring optionList, selectedOption, and showOptionControl are updated properly across tabs. > GENERATE BY https://aicommit.app
…e logic - Removed unnecessary state variables related to layout height and option control visibility - Unified modal content rendering strategy without using conditional logic - Standardized use of HorizontalDivider - Simplified rendering of FuncType-based option components using `when` structure > GENERATE BY https://aicommit.app
- Update AGP to 8.13.2, Kotlin to 2.3.20, and KSP to 2.3.6 - Bump AndroidX libraries (Activity, Lifecycle, Navigation, Compose BOM, Material3) - Migrate from Navigation3 alpha to stable Navigation Compose 2.9.7 - Replace deprecated `onBackPressed()` with `OnBackPressedDispatcher` APIs - Migrate window insets handling to `WindowCompat` and `WindowInsetsControllerCompat`
- Added `Intent` import to enable launching new activities. - Integrated `AboutActivity` import and navigation callback in `ComposeMainActivity`. - Implemented `onGoAboutScreen` handler to open About screen from UI. - Improves user accessibility to app information via About section. > GENERATE BY https://aicommit.app
- wire `onAddMoreImages` in `ComposeMainActivity.kt` - launch `pickMultipleMedia` with `PickVisualMedia.ImageOnly` - enable selecting additional images from the media picker > GENERATE BY https://aicommit.app
…folding - CLAUDE.md + docs/CONTEXT.md: agent guide and domain glossary - docs/adr/0001-0016: View->Compose and CMP architecture decisions - docs/superpowers: CMP migration plan, readiness audit, UI parity backlog, review report - progress/findings/task_plan planning files; .gitignore: .alma-snapshots + .DS_Store
- Theme: force dark (production has no DayNight); wire dynamic color via CMonet - Color: align dark tokens to production colors.xml - LaunchScreen: sharp-cornered button; route About through Compose nav - EditorScreen: thumbnail filmstrip for single image; open modal text editor - TextContentOption: tap-to-open Edit-watermark modal sheet - SaveExportSheet: real Coil thumbnail strip instead of placeholder
…SEND share-in - AboutScreen, OpenSourceScreen: Compose replacements for legacy Activities - ComposeMainActivity: NavHost entries + AboutViewModel; handle ACTION_SEND/SEND_MULTIPLE (handleShareIntent -> updateImageList -> navigate), fixing single-image-only gap - AndroidManifest: move share-in intent-filter onto ComposeMainActivity (single entry)
ViewInfo/MainViewModel/WaterMarkImageView/assets were already modified in the working tree before this period; committed as-is to keep the branch buildable. Not part of the About/share/parity migration.
…eview items - RecoveryScreen: Compose replacement for legacy activity_recovery; shown by ComposeMainActivity when MyApp.recoveryMode is true. Restores crash-loop self-heal that went dead when the launcher moved off legacy MainActivity (recoveryMode check + launchSuccess reset were stranded there). - ComposeMainActivity: recovery branch in onCreate; onResume resets crash counter on a stable launch; share-in nav uses launchSingleTop + popUpTo (no double-push); multi-share validates all uris, not just the first.
…ct fabricated PR-363 claim - progress.md: Phase H batch 8 — RecoveryScreen verified on S22+ (recovery render + normal-launch regression), PR #377 opened, Phase 2 blocked on un-migrated template feature - handoff report: status updated to committed/PR-opened; §5.1 recovery now done+verified
…eListSheet) Ports the legacy TextContentTemplateListFragment + EditTemplateContentFragment to a Compose ModalBottomSheet over the already-migrated MainViewModel template CRUD (templateListFlow / addTemplate / updateTemplate / deleteTemplate). 'Use' applies via updateText (same path as the text editor), avoiding the legacy UiState.UseTemplate plumbing. - EditorScreen: thread onGoTemplateList through BottomView/OptionControl; add template params; render TemplateListSheet (replaces the onGoTemplateList TODO stub). - ComposeMainActivity: collect templateListFlow; wire use/add/update/delete callbacks. - Real-device verified (S22+): icon opens sheet, Room list renders, use-confirm dialog, Confirm applies content to the watermark + dismisses. Unblocks the legacy Activity-chain deletion (ADR-0016) — the template fragments were the last live dependency bridging Compose to the legacy stack.
…unctionally complete - TemplateListSheet migration recorded + device-verified - Complete ~40-file legacy-deletion map (2 fragment clusters + adapters/base + widget sub-cluster + layouts + manifest), all confirmed legacy-only - Note: View→Compose migration is now functionally complete; remaining legacy is dead code (deletion = hygiene)
The View→Compose migration is functionally complete — every user-facing surface now runs on the Compose stack. This removes the now-dead legacy code (reachable from nothing after MainActivity lost its launcher/share entry and the recovery + template ports landed). Deleted (39 .kt): 3 Activities (MainActivity 820L, About, OpenSource); ui/dialog/* (7 fragments); ui/panel/* (9 option-panel fragments); ui/adapter/* (9); ui/base/* (7); legacy widget cluster (LaunchView, LaunchViewListener, SimpleOverScrollEdgeEffect, BounceEdgeEffectFactory). Manifest: removed the 3 <activity> entries. ContextExtension: dropped the dead MainActivity import. Retained & clean: ComposeMainActivity (ComponentActivity), WaterMarkImageView (Compose AndroidView), all data/di/utils. APK shrank ~330KB. Real-device verified (S22+): cold launch, editor (Content/Style/Layout tabs all Compose), template sheet, save sheet, About — no crashes, no ClassNotFound. Follow-up hygiene: orphaned layout XMLs (activity_*/dialog_*/item_*) are now unreferenced (harmless, R8-stripped) — separate cleanup pass.
…UDE.md, progress)
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.
Summary
This is a large
feat/migrate_to_composeintegration checkpoint. It is not merge-ready and should stay Draft until production-vs-branch 1:1 parity gaps are closed.MediaRef, removes the deadImageInfo.shareUri, and removes staleKEY_URI/SP_KEY_URI.CMonetdirectly.Verification
git diff --checkplutil -lint iosApp/iosApp.xcodeproj/project.pbxprojxcodebuild -list -project iosApp/iosApp.xcodeproj./gradlew :app:compileDebugKotlin :shared:compileKotlinDesktop :shared:compileKotlinIosSimulatorArm64 --max-workers=8 --console=plain./gradlew :app:testDebugUnitTest :shared:desktopTest :shared:iosSimulatorArm64Test :app:assembleDebug :app:assembleRelease --max-workers=8 --console=plain./gradlew --stop --max-workers=8 --console=plainKnown Limits
DEBUG/ UI-test-only-uiTestFixtureImagelane through the realWatermarkWorkflowandIosWatermarkRenderBridge; real PHPicker grid-cell automation remains unproven on this simulator/Xcode lane.