Skip to content

Conversation

jacob-derynk
Copy link
Contributor

🚀 Major Upgrade: Compose Multiplatform Migration

This PR represents a significant upgrade to modernize the Donut library by migrating from Android-only Compose to Compose Multiplatform (CMP), enabling cross-platform support for iOS and other platforms.

✨ Key Changes

Compose Multiplatform Migration

  • Upgraded library-compose module to use Compose Multiplatform instead of Android-only Compose
  • Added iOS support with proper framework configuration for iOS targets (iosX64, iosArm64, iosSimulatorArm64)
  • Updated build configuration to use CMP plugins and dependencies

New Standalone CMP Sample App

  • Created sample-cmp module - a dedicated Compose Multiplatform sample application
  • Added iOS app integration
  • Implemented shared UI components:
    • RadioButtonGroup - reusable radio button component
    • SliderControl - cross-platform slider implementation
    • DecimalFormatter - utility for number formatting
    • Circle - common circle drawing component

Sample App Simplification

  • Removed Compose example from the main Android sample app
  • Made View-based example the default for the sample module

Documentation Updates

  • Updated README to feature Compose Multiplatform prominently
  • Added CMP installation instructions for Kotlin Multiplatform projects

Breaking Changes: None - this is a backward-compatible upgrade that adds new functionality while preserving existing APIs.

This commit introduces a new `library-compose-multiplatform` module to the project

Key changes include:

- **New Module:** Added `library-compose-multiplatform` with necessary Gradle configuration for Kotlin Multiplatform and Compose Multiplatform.
- **Dependencies:** Included Compose Multiplatform libraries (runtime, ui, foundation, animation, material3) in `libs.versions.toml`.
- **Sample Integration:**
    - Added a "Hello World" Composable (`HelloWorld.kt`) in the new module.
    - Created a new `HelloWorldActivity` in the sample app to display this Composable.
    - Added a button in `MainActivity` to navigate to the `HelloWorldActivity`.
- **Build Configuration:**
    - Updated `settings.gradle.kts` to include the new module and Compose Multiplatform repositories.
    - Updated root `build.gradle.kts` to include Kotlin Multiplatform and Compose Multiplatform plugins.
    - Added `.kotlin/` to `.gitignore`.
- **Sample UI Update:** Modified `activity_main.xml` and `strings.xml` in the sample app to accommodate the new "Hello World CMP" button.
This commit introduces a new `sample-cmp` module which will contain a Compose Multiplatform sample application for Android and iOS.

The following changes were made:
- Created the `sample-cmp` module with initial Android and iOS setup.
- Added basic "Hello iOS & Android from CMP" screen in common code.
- Configured Gradle for the new module, including dependencies for Compose Multiplatform.
- Set up the Android part of the sample with an `MainActivity` and resources.
- Set up the iOS part of the sample with an Xcode project, Swift entry point, and assets.
- Removed the old `HelloWorld` composable and its associated activity from the `library-compose-multiplatform` and `sample` modules respectively, as its functionality is now covered by the new `sample-cmp` module.
- Updated the main sample app to remove the button linking to the deleted `HelloWorldActivity`.
- Added `iosApp/DonutSampleIOS/Config/Signing.local.xcconfig` to `.gitignore`.
Renames `Signing.local.xcconfig` to `Signing.local.xcconfig.example` and adds it to `.gitignore` to prevent committing local signing configurations.
Also adds `xcuserdata` and `*.xcuserstate` to `.gitignore` to avoid committing user-specific Xcode project settings.
@jacob-derynk jacob-derynk self-assigned this Aug 28, 2025
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