Repository navigation
feat: Migrate Compose library to Compose Multiplatform and add standalone CMP sample app - #108
Merged
Merged
Conversation
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.
…fault for sample module
davidkocnar
approved these changes
Sep 25, 2025
This commit removes the iOS-specific targets (iosX64, iosArm64, iosSimulatorArm64) and their associated framework configurations from the `library-compose/build.gradle.kts` file. Additionally, the `commonTest` source set and its dependency on `kotlin("test")` have been removed.
This commit updates the Compose Multiplatform dependencies to use the new `compose` object for easier access and removes the no longer needed `compose-mpp` bundle from the version catalog.
Contributor
Author
|
I also plan to create a follow-up PR to move the legacy Android-only |
This commit removes the legacy Android-only `sample` module and integrates its functionality into the `sample-cmp` (Compose Multiplatform) module. The `sample-cmp` module now offers a chooser screen to navigate between the Compose Multiplatform and the legacy Android Views implementations of the Donut component. Key changes: - Deleted the `sample` module and all its contents. - Moved relevant resources (layouts, drawables, strings, colors, styles) and Kotlin utility files from `sample` to `sample-cmp/src/androidMain`. - Created `ViewsSampleActivity.kt` in `sample-cmp` to host the legacy Views sample. - Created `CmpSampleActivity.kt` in `sample-cmp` to host the Compose Multiplatform sample. - Updated `MainActivity.kt` in `sample-cmp` to display a chooser screen for selecting between the CMP and Views samples. - Updated `AndroidManifest.xml` in `sample-cmp` to declare the new activities and set `MainActivity` as the launcher. - Updated `sample-cmp/build.gradle.kts` to include dependencies for the legacy Views implementation (appcompat, constraintlayout, material) and the main library. - Updated `settings.gradle.kts` to remove the `sample` module. - Updated `README.md` to reflect the consolidated sample app structure. - Updated `Dangerfile` to point to the new location of ktlint reports for the sample app. - Updated Android Gradle Plugin version in `gradle/libs.versions.toml`.
matejsemancik
approved these changes
Oct 1, 2025
…o-one-module Feat: Merge sample apps and update dependencies
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.
🚀 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
library-composemodule to use Compose Multiplatform instead of Android-only ComposeNew Standalone CMP Sample App
sample-cmpmodule - a dedicated Compose Multiplatform sample applicationRadioButtonGroup- reusable radio button componentSliderControl- cross-platform slider implementationDecimalFormatter- utility for number formattingCircle- common circle drawing componentSample App Simplification
Documentation Updates
Breaking Changes: None - this is a backward-compatible upgrade that adds new functionality while preserving existing APIs.