Skip to content

Conversation

@shobhitagarwal1612
Copy link
Member

Fixes #3507

  • Creates compose screen for the xml layout
  • Migrate logic from fragment to compose screen
  • Remove nav_graph binding and directly show the bottom sheet dialog without using fragment
map.type.dialog.-.before.webm
map.type.dialog.-.after.webm

@andreia-ferreira @gino-m PTAL?

The `MapTypeDialogFragment` has been refactored to use Compose instead of XML view binding. Key changes include:
- Replaced the view-based layout and `MapTypeAdapter` with `MapTypeScreen` in `MapTypeDialogFragment`.
- Updated `MapTypeViewModel` to expose `mapTypeFlow` and `offlineImageryEnabledFlow` as `StateFlow` for Compose consumption.
- Updated `MapTypeDialogFragmentTest` to use Compose testing APIs instead of Espresso.
- Renamed `offlineImageryPreferenceUpdated` to `updateOfflineImageryPreference` in the ViewModel.
…ed XML layouts

Deletes the RecyclerView-based map type selection components, including:
- `AdaptiveSpacingItemDecorator.kt`
- `MapTypeAdapter.kt`
- `map_type_dialog_fragment.xml`
- `map_type_dialog_item.xml`
Replaces the Fragment-based `MapTypeDialogFragment` with a Compose-based `MapTypeScreen` using Material3 `ModalBottomSheet`.
Deleted `MapTypeDialogFragment` and its associated tests, removing the fragment-based implementation of the map type selector. References to the dialog were also removed from the navigation graph. The `MapTypeScreen` Composable now serves as the primary UI component for selecting map types.
…ComposeView` utility helper, removing redundant `ComposeView` boilerplate and `AppTheme` wrapping.
Adds `verticalScroll` to the main `Column` in `MapTypeScreen` to ensure content remains accessible on smaller screens or when scaled.
Extract `BasemapGallery` and `OfflineImageryToggle` into separate private composable functions to improve code readability and maintainability.
Ensures map type updates and dialog dismissals are processed by calling `composeTestRule.waitForIdle()` after click actions in tests.
@auto-assign auto-assign bot requested a review from anandwana001 February 1, 2026 09:38
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @shobhitagarwal1612, 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 undertakes a significant refactoring of the map type selection feature, transitioning its user interface from a traditional Android Fragment and XML layout approach to a modern Jetpack Compose implementation. This change simplifies the UI codebase, improves component reusability, and aligns the project with contemporary Android development practices. The underlying logic for map type and offline imagery selection has been adapted to integrate seamlessly with the new Compose UI, utilizing reactive state flows for efficient data management.

Highlights

  • Jetpack Compose Migration: The MapType bottom sheet dialog has been fully migrated from an XML-based Fragment implementation to Jetpack Compose, enhancing the modern Android UI toolkit usage.
  • Simplified UI Architecture: The previous MapTypeDialogFragment, its associated XML layouts (map_type_dialog_fragment.xml, map_type_dialog_item.xml), RecyclerView adapter, and item decorator have been removed, replaced by a single BasemapSelectorScreen.kt composable.
  • ViewModel Refactoring: The MapTypeViewModel has been renamed to BasemapSelectorViewModel, moved to a new package, and updated to leverage Kotlin Flow's StateFlow for reactive state management, aligning with Compose best practices.
  • Direct Compose Integration: The AbstractMapContainerFragment now directly hosts the BasemapSelectorScreen as a Compose view within its ViewGroup, eliminating the need for Android Navigation Component bindings for this specific dialog.
  • Comprehensive Testing: New Compose UI tests (BasemapSelectorScreenTest.kt) have been added to ensure the correct functionality and rendering of the new basemap selector, while obsolete tests for the old Fragment implementation have been removed.

🧠 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.

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 successfully migrates the MapType bottom sheet dialog from XML and Fragments to Jetpack Compose. The changes are well-executed, resulting in cleaner, more maintainable code that aligns with modern Android development practices. The removal of the old MapTypeDialogFragment, its associated layouts, adapter, and navigation graph entries simplifies the codebase. The new BasemapSelectorScreen is a great example of building UI with Compose, and the accompanying BasemapSelectorViewModel correctly uses StateFlow to manage state. The addition of unit tests for the new composable is also a valuable contribution. I have one minor suggestion regarding modifier ordering for better correctness.

shobhitagarwal1612 and others added 2 commits February 1, 2026 15:14
…pSelectorScreen`

Refactor the map type selection logic into a standalone function within `BasemapSelectorScreen` to improve readability of the `ModalBottomSheet` content.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Feb 1, 2026

Codecov Report

❌ Patch coverage is 86.61417% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.03%. Comparing base (b08fea8) to head (d52ae1c).

Files with missing lines Patch % Lines
...ndroid/ui/basemapselector/BasemapSelectorScreen.kt 85.83% 10 Missing and 7 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3508      +/-   ##
============================================
+ Coverage     69.82%   70.03%   +0.21%     
- Complexity     1599     1600       +1     
============================================
  Files           322      322              
  Lines          8678     8783     +105     
  Branches        949      962      +13     
============================================
+ Hits           6059     6151      +92     
- Misses         2049     2054       +5     
- Partials        570      578       +8     
Files with missing lines Coverage Δ
...oid/ui/basemapselector/BasemapSelectorViewModel.kt 100.00% <100.00%> (ø)
...oundplatform/android/ui/common/BaseMapViewModel.kt 63.41% <100.00%> (+0.29%) ⬆️
...ndroid/ui/basemapselector/BasemapSelectorScreen.kt 85.83% <85.83%> (ø)

... and 3 files with indirect coverage changes

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

@shobhitagarwal1612 shobhitagarwal1612 removed the request for review from anandwana001 February 1, 2026 13:35
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.

MapType Dialog

1 participant