Skip to content

Move theme components to ui module#3597

Merged
andreia-ferreira merged 2 commits intomasterfrom
andreia/move-theme-to-ui-module
Mar 9, 2026
Merged

Move theme components to ui module#3597
andreia-ferreira merged 2 commits intomasterfrom
andreia/move-theme-to-ui-module

Conversation

@andreia-ferreira
Copy link
Collaborator

@andreia-ferreira andreia-ferreira commented Mar 9, 2026

Towards #3600
This PR moves shareable components related to compose app theme to the core:ui module.

Most of the changes are just import updates due to the theme files being moved. The only file with actual changes is Typography, because some libraries used there weren't available in Compose Multiplatform.

@shobhitagarwal1612 PTAL?

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the project structure by extracting core domain logic and shared Compose UI theme components into dedicated Kotlin Multiplatform modules. This change enhances modularity, promotes code reuse across different platforms, and streamlines dependency management by centralizing version definitions. The refactoring prepares the codebase for future multiplatform development while ensuring a cleaner separation of concerns.

Highlights

  • New Multiplatform Modules: Introduced two new Kotlin Multiplatform modules: :core:domain for shared domain logic and :core:ui for shared Compose UI components and themes. These modules are configured for JVM, Android, and iOS targets.
  • Theme Component Relocation: Moved all Compose theme-related files (Color, Size, Theme, Typography) from the app module to the new :core:ui module, centralizing UI styling definitions.
  • Build Configuration Modernization: Updated app/build.gradle and e2eTest/build.gradle to use version references from libs.versions.toml for Android SDK versions and JVM toolchain, replacing rootProject properties for better dependency management.
  • Dependency Updates and Additions: Added new dependencies in app/build.gradle for the :core:domain and :core:ui modules. gradle/libs.versions.toml was updated to include new versions for multiplatform-related libraries and plugins, including Compose Multiplatform and a QR code library.
  • New UI Component: Added a GroundQrCode composable to the :core:ui module, providing a reusable component for displaying QR codes.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • app/build.gradle
    • Updated compileSdk, minSdkVersion, targetSdkVersion, and jvmToolchain to reference versions from libs.versions.toml.
    • Added implementation dependencies for the new :core:domain and :core:ui modules.
  • app/src/main/java/org/groundplatform/android/ui/basemapselector/BasemapSelectorScreen.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/components/ConfirmationDialog.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/components/HtmlText.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/components/LoadingDialog.kt
    • Updated import statements for AppTheme and sizes to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/components/MapFloatingActionButton.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/components/PermissionDeniedDialog.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/components/RecenterButton.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/datacollection/DataSubmissionConfirmationScreen.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/datacollection/components/InstructionsDialog.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/datacollection/components/TaskButton.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/datacollection/components/TaskFooter.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/datacollection/components/TextTaskInput.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/datacollection/components/UriImage.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/datacollection/tasks/date/DateTaskScreen.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/datacollection/tasks/multiplechoice/MultipleChoiceItemView.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/datacollection/tasks/photo/PhotoTaskScreen.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/datacollection/tasks/time/TimeTaskScreen.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/home/DataSharingTermsDialog.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/home/UserDetailsDialog.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/home/mapcontainer/HomeScreenMapContainerScreen.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/home/mapcontainer/jobs/ActionButton.kt
    • Updated import statements for AppTheme and sizes to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/home/mapcontainer/jobs/JobMapComponent.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/home/mapcontainer/jobs/JobSelectionModal.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/home/mapcontainer/jobs/JobSelectionRow.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/home/mapcontainer/jobs/LoiJobSheet.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/offlineareas/OfflineAreaListItem.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/settings/SettingsActivity.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/settings/SettingsScreen.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/settings/components/SettingsItem.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/settings/components/SettingsSelectItem.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/settings/components/SettingsSwitchItem.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/signin/SignInFragment.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/signin/SignInScreen.kt
    • Removed unused import org.groundplatform.android.proto.style.
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/startup/StartupFragment.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/surveyselector/SurveySelectorFragment.kt
    • Added import for kotlinx.coroutines.TimeoutCancellationException.
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
    • Updated TimeoutCancellationException usage to use the newly imported type.
  • app/src/main/java/org/groundplatform/android/ui/surveyselector/components/SurveyEmptyState.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/syncstatus/SyncListItem.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/main/java/org/groundplatform/android/ui/theme/Color.kt
    • Renamed and moved to core/ui/src/commonMain/kotlin/org/groundplatform/ui/theme/Color.kt.
  • app/src/main/java/org/groundplatform/android/ui/theme/Size.kt
    • Renamed and moved to core/ui/src/commonMain/kotlin/org/groundplatform/ui/theme/Size.kt.
  • app/src/main/java/org/groundplatform/android/ui/theme/Theme.kt
    • Renamed and moved to core/ui/src/commonMain/kotlin/org/groundplatform/ui/theme/Theme.kt.
    • Updated AppTheme to use appTypography() instead of AppTypography.
  • app/src/main/java/org/groundplatform/android/ui/theme/Typography.kt
    • Renamed and moved to core/ui/src/commonMain/kotlin/org/groundplatform/ui/theme/Typography.kt.
    • Updated font family definitions to use org.jetbrains.compose.resources.Font for multiplatform compatibility.
  • app/src/main/java/org/groundplatform/android/util/ComposeExt.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/test/java/org/groundplatform/android/ui/settings/SettingsScreenTest.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • app/src/test/java/org/groundplatform/android/ui/signin/SignInScreenTest.kt
    • Updated import statement for AppTheme to reference the new org.groundplatform.ui.theme package.
  • build.gradle
    • Added new multiplatform-related plugins: kotlin.multiplatform, android.kotlin.multiplatform.library, android.lint, and compose.multiplatform.
    • Removed deprecated ext properties for androidCompileSdk, androidMinSdk, androidTargetSdk, and jvmToolchainVersion.
  • core/domain/.gitignore
    • Added /build to ignore compiled artifacts.
  • core/domain/build.gradle.kts
    • Created a new Kotlin Multiplatform module for domain logic.
    • Configured JVM, iOSX64, iOSArm64, and iOSSimulatorArm64 targets.
    • Added dependencies for kotlin.stdlib and kotlinx.serialization.json.
  • core/domain/src/commonMain/kotlin/org/groundplatform/domain/model/LoiReport.kt
    • Added a new data class LoiReport to represent collected Location of Interest data.
  • core/ui/.gitignore
    • Added /build to ignore compiled artifacts.
  • core/ui/build.gradle.kts
    • Created a new Kotlin Multiplatform module for UI components.
    • Configured Android and iOS targets, including XCFramework generation for iOS.
    • Added dependencies for Compose Multiplatform components (runtime, foundation, material3, ui, ui.tooling.preview, components.resources), androidx.lifecycle.runtime.compose, and qrose.
  • core/ui/src/commonMain/kotlin/org/groundplatform/ui/components/GroundQrCode.kt
    • Added a new GroundQrCode composable for displaying QR codes with optional center logos.
  • e2eTest/build.gradle
    • Updated compileSdk, minSdkVersion, targetSdkVersion, and jvmToolchain to reference versions from libs.versions.toml.
  • gradle/libs.versions.toml
    • Added new version definitions for androidCompileSdk, androidMinSdk, androidTargetSdk, androidXLifecycleVersion, composeMultiplatformVersion, jvmToolchainVersion, material3Version, and qroseVersion.
    • Updated kotlinx-serialization-json to explicitly use kotlinxBom version.
    • Added new library aliases for Compose Multiplatform components and qrose.
    • Added new plugin aliases for compose-multiplatform, kotlin-multiplatform, android-kotlin-multiplatform-library, and android-lint.
  • settings.gradle
    • Included the new :core:ui and :core:domain modules in the project.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a significant refactoring that moves shareable theme components into a new core:ui module and introduces a core:domain module, preparing the project for a multi-platform architecture. The changes primarily involve moving files, updating imports, and configuring Gradle for the new Kotlin Multiplatform modules. The implementation is solid, but I've identified a few minor issues concerning copyright headers in the newly created files, which appear to violate the repository's style guide. Please see the detailed comments.

@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 69.69%. Comparing base (285e888) to head (65fb44f).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ndroid/ui/surveyselector/SurveySelectorFragment.kt 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3597      +/-   ##
============================================
- Coverage     70.33%   69.69%   -0.65%     
+ Complexity     1816     1811       -5     
============================================
  Files           353      349       -4     
  Lines          9895     9675     -220     
  Branches       1061     1060       -1     
============================================
- Hits           6960     6743     -217     
+ Misses         2300     2298       -2     
+ Partials        635      634       -1     
Files with missing lines Coverage Δ
...ndroid/ui/basemapselector/BasemapSelectorScreen.kt 85.83% <ø> (ø)
...atform/android/ui/components/ConfirmationDialog.kt 53.65% <ø> (ø)
...g/groundplatform/android/ui/components/HtmlText.kt 75.00% <ø> (ø)
...undplatform/android/ui/components/LoadingDialog.kt 89.47% <ø> (ø)
...m/android/ui/components/MapFloatingActionButton.kt 87.87% <ø> (ø)
...rm/android/ui/components/PermissionDeniedDialog.kt 85.18% <ø> (ø)
...ndplatform/android/ui/components/RecenterButton.kt 94.44% <ø> (ø)
...datacollection/DataSubmissionConfirmationScreen.kt 71.11% <ø> (ø)
...ui/datacollection/components/InstructionsDialog.kt 76.00% <ø> (ø)
...android/ui/datacollection/components/TaskButton.kt 61.53% <ø> (ø)
... and 28 more

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andreia-ferreira andreia-ferreira force-pushed the andreia/move-theme-to-ui-module branch from 13eeb85 to 65fb44f Compare March 9, 2026 16:09
@andreia-ferreira andreia-ferreira marked this pull request as ready for review March 9, 2026 16:25
@auto-assign auto-assign bot requested a review from gino-m March 9, 2026 16:25
@andreia-ferreira andreia-ferreira merged commit 4ab61e1 into master Mar 9, 2026
9 checks passed
@andreia-ferreira andreia-ferreira deleted the andreia/move-theme-to-ui-module branch March 9, 2026 17:03
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.

2 participants