Skip to content

Implement sharing geometry with QR code#3585

Draft
andreia-ferreira wants to merge 5 commits intomasterfrom
andreia/3575/qr-code
Draft

Implement sharing geometry with QR code#3585
andreia-ferreira wants to merge 5 commits intomasterfrom
andreia/3575/qr-code

Conversation

@andreia-ferreira
Copy link
Collaborator

@andreia-ferreira andreia-ferreira commented Feb 27, 2026

Fixes: #3575

During the implementation of this feature kmp shareable modules have been created :core:domain and :core:ui. The needed files will be refactored to those modules, when possible.

This PR will be split up to be easier to review -> still to be done

@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 introduces the capability to share geometry data using QR codes, which is enabled by a foundational architectural shift towards Kotlin Multiplatform. Key domain models and UI components have been extracted into dedicated multiplatform modules, laying the groundwork for future cross-platform development while modernizing the build system and cleaning up dependencies.

Highlights

  • Multiplatform Architecture Refactoring: The project structure has been significantly refactored to support Kotlin Multiplatform. Core domain models, specifically Coordinates, and UI theme components have been moved into new multiplatform modules: core:domain and core:ui.
  • QR Code Generation for Geometry Sharing: A new GroundQrCode composable has been introduced in the core:ui module, leveraging the qr-kit library to enable sharing geometry data via QR codes, directly addressing the pull request's primary goal.
  • Build Configuration Modernization: Gradle build files (app/build.gradle, e2eTest/build.gradle, build.gradle, gradle/libs.versions.toml, settings.gradle) have been updated to use version catalogs for SDK versions, include the new multiplatform modules, and integrate necessary multiplatform plugins and dependencies.
  • Dependency Updates and Clean-up: Unused auto-value dependencies have been removed, and various imports across the application and test modules have been updated to reflect the new Coordinates package location and the centralized theme module.

🧠 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 SDK version references to use version catalogs
    • Added new module dependencies for ':core:ui' and ':core:domain'
    • Removed auto-value dependencies
  • app/src/main/AndroidManifest.xml
    • Configured manifest package attribute
    • Added tools:replace attribute to application tag
    • Reordered intent-filter data attributes
  • app/src/main/java/org/groundplatform/android/data/local/room/converter/ConverterExt.kt
    • Updated Coordinates import to use the domain model
  • app/src/main/java/org/groundplatform/android/data/remote/firebase/protobuf/ModelToProtoExt.kt
    • Updated Coordinates import to use the domain model
  • app/src/main/java/org/groundplatform/android/data/remote/firebase/schema/GeometryConverter.kt
    • Updated Coordinates import to use the domain model
  • app/src/main/java/org/groundplatform/android/model/geometry/Coordinates.kt
    • Moved Coordinates data class to the new domain module
  • app/src/main/java/org/groundplatform/android/model/geometry/Geometry.kt
    • Added Coordinates import from the domain model
  • app/src/main/java/org/groundplatform/android/model/map/Bounds.kt
    • Updated Coordinates import to use the domain model
  • app/src/main/java/org/groundplatform/android/model/map/CameraPosition.kt
    • Updated Coordinates import to use the domain model
  • app/src/main/java/org/groundplatform/android/system/GeocodingManager.kt
    • Updated Coordinates import to use the domain model
  • app/src/main/java/org/groundplatform/android/ui/basemapselector/BasemapSelectorScreen.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/common/AbstractMapContainerFragment.kt
    • Updated Coordinates import to use the domain model
  • app/src/main/java/org/groundplatform/android/ui/common/BaseMapViewModel.kt
    • Updated Coordinates import to use the domain model
  • app/src/main/java/org/groundplatform/android/ui/components/ConfirmationDialog.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/components/HtmlText.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/components/LoadingDialog.kt
    • Updated theme imports to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/components/MapFloatingActionButton.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/components/PermissionDeniedDialog.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/components/RecenterButton.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/datacollection/DataSubmissionConfirmationScreen.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/datacollection/components/InstructionsDialog.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/datacollection/components/TaskButton.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/datacollection/components/TaskFooter.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/datacollection/components/TextTaskInput.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/datacollection/components/UriImage.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/datacollection/tasks/date/DateTaskScreen.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/datacollection/tasks/multiplechoice/MultipleChoiceItemView.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/datacollection/tasks/photo/PhotoTaskScreen.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/datacollection/tasks/polygon/DrawAreaTaskViewModel.kt
    • Updated Coordinates import to use the domain model
  • app/src/main/java/org/groundplatform/android/ui/datacollection/tasks/time/TimeTaskScreen.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/home/DataSharingTermsDialog.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/home/UserDetailsDialog.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/home/mapcontainer/HomeScreenMapContainerScreen.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/home/mapcontainer/jobs/ActionButton.kt
    • Updated theme imports to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/home/mapcontainer/jobs/JobMapComponent.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/home/mapcontainer/jobs/JobSelectionModal.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/home/mapcontainer/jobs/JobSelectionRow.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/home/mapcontainer/jobs/LoiJobSheet.kt
    • Updated Coordinates import to use the domain model
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/map/CameraUpdateRequest.kt
    • Updated Coordinates import to use the domain model
  • app/src/main/java/org/groundplatform/android/ui/map/MapFragment.kt
    • Updated Coordinates import to use the domain model
    • Adjusted Javadoc comments to reflect new Coordinates package
  • app/src/main/java/org/groundplatform/android/ui/map/gms/ConverterExt.kt
    • Updated Coordinates import to use the domain model
  • app/src/main/java/org/groundplatform/android/ui/map/gms/GmsExt.kt
    • Updated Coordinates import to use the domain model
    • Adjusted Javadoc comments to reflect new Coordinates package
  • app/src/main/java/org/groundplatform/android/ui/map/gms/GoogleMapsFragment.kt
    • Updated Coordinates import to use the domain model
  • app/src/main/java/org/groundplatform/android/ui/map/gms/features/LineStringRenderer.kt
    • Clarified comment regarding resource availability
  • app/src/main/java/org/groundplatform/android/ui/map/gms/mog/TileCoordinates.kt
    • Updated Coordinates import to use the domain model
  • app/src/main/java/org/groundplatform/android/ui/offlineareas/OfflineAreaListItem.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/signin/SignInFragment.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/signin/SignInScreen.kt
    • Removed unused import
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/startup/StartupFragment.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/surveyselector/SurveySelectorFragment.kt
    • Added new import for TimeoutCancellationException
    • Updated AppTheme import to use the new theme module
    • Simplified TimeoutCancellationException reference
  • app/src/main/java/org/groundplatform/android/ui/surveyselector/components/SurveyEmptyState.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/syncstatus/SyncListItem.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/ui/theme/Color.kt
    • Moved Color definitions to the new UI module
  • app/src/main/java/org/groundplatform/android/ui/theme/Size.kt
    • Moved Size definitions to the new UI module
  • app/src/main/java/org/groundplatform/android/ui/theme/Theme.kt
    • Moved theme definitions to the new UI module
    • Updated typography reference
  • app/src/main/java/org/groundplatform/android/ui/theme/Typography.kt
    • Moved typography definitions to the new UI module
    • Adapted to Compose Multiplatform resource loading
  • app/src/main/java/org/groundplatform/android/ui/util/PolygonUtil.kt
    • Updated Coordinates import to use the domain model
  • app/src/main/java/org/groundplatform/android/util/ComposeExt.kt
    • Updated AppTheme import to use the new theme module
  • app/src/main/java/org/groundplatform/android/util/CoordinatesExt.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/FakeData.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/data/local/LocalLocationOfInterestStoreTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/data/local/LocalSubmissionStoreTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/data/local/room/converter/ValueJsonConverterTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/data/remote/firebase/protobuf/LoiMutationConverterTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/data/remote/firebase/protobuf/ModelToProtoExtKtTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/data/remote/firebase/schema/GeometryConverterTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/data/remote/firebase/schema/LoiConverterTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/data/remote/firebase/schema/SubmissionMutationConverterTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/repository/LocationOfInterestRepositoryTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/system/GeocodingManagerTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/ui/datacollection/DataCollectionFragmentTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/ui/datacollection/tasks/location/CaptureLocationTaskFragmentTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/ui/datacollection/tasks/point/DropPinTaskFragmentTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/ui/datacollection/tasks/point/DropPinTaskViewModelTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/ui/datacollection/tasks/polygon/DrawAreaTaskFragmentTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/ui/datacollection/tasks/polygon/DrawAreaTaskViewModelTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/ui/home/mapcontainer/HomeScreenMapContainerViewModelTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/ui/home/mapcontainer/jobs/LoiJobSheetTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/ui/map/gms/mog/MogClientTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/ui/map/gms/mog/TileCoordinatesTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/ui/offlineareas/selector/OfflineAreaSelectorViewModelTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/ui/signin/SignInScreenTest.kt
    • Updated AppTheme import to use the new theme module
  • app/src/test/java/org/groundplatform/android/ui/syncstatus/SyncStatusFragmentTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/usecases/submission/SubmitDataUseCaseTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/usecases/survey/RemoveOfflineSurveyUseCaseTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/util/CoordinatesExtTest.kt
    • Updated Coordinates import to use the domain model
  • app/src/test/java/org/groundplatform/android/util/PolygonUtilTest.kt
    • Updated Coordinates import to use the domain model
  • build.gradle
    • Removed deprecated ext block
    • Added multiplatform plugin aliases
  • core/domain/.gitignore
    • Added build directory to gitignore
  • core/domain/build.gradle.kts
    • Created new multiplatform domain module build configuration
  • core/ui/.gitignore
    • Added build directory to gitignore
  • core/ui/build.gradle.kts
    • Created new multiplatform UI module build configuration
  • core/ui/src/commonMain/kotlin/org/groundplatform/ui/components/GroundQrCode.kt
    • Implemented GroundQrCode composable for geometry sharing
  • e2eTest/build.gradle
    • Updated SDK version references in e2e test build configuration
  • gradle/libs.versions.toml
    • Centralized SDK versions
    • Added new multiplatform dependencies and plugins
    • Removed unused dependencies
  • settings.gradle
    • Added new multiplatform modules to the project
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.

# Conflicts:
#	app/src/main/java/org/groundplatform/android/ui/components/MapFloatingActionButton.kt
#	app/src/main/java/org/groundplatform/android/ui/components/RecenterButton.kt
#	app/src/main/java/org/groundplatform/android/ui/surveyselector/components/SurveyEmptyState.kt
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 introduces a significant refactoring to establish a multi-platform architecture by creating core/domain and core/ui modules. Shared code, including the Coordinates data class and theme files, has been moved to these new modules. A new GroundQrCode composable is also added to facilitate geometry sharing via QR codes. The changes are extensive, touching many files for import updates and build configuration, but they appear consistent and well-executed. My review focuses on the new component, where I've noted a couple of minor issues regarding the copyright year and the need for unit tests to align with the repository's style guide.

Comment on lines +43 to +49
@Composable
fun GroundQrCode(
modifier: Modifier = Modifier,
content: String,
contentDescription: String,
centerLogoPainter: Painter?,
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This new composable introduces a new behavior. Please consider adding a UI test to verify that the QR code is generated and rendered correctly for the given content. This aligns with the repository's style guide which requires tests for new behaviors.

References
  1. Add or update unit tests for all new or changed behaviors. Remove unit tests for code which has been removed. (link)

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.

Share geometry across devices and apps

1 participant