KEMBAR78
chore: added Fragment sample by kikoso · Pull Request #727 · googlemaps/android-maps-compose · GitHub
Skip to content

Conversation

@kikoso
Copy link
Collaborator

@kikoso kikoso commented Jul 21, 2025

The following PR adds a sample showcasing how to use GoogleMap within a Fragment.

A ViewPager hosts two different Fragments, each of them loading a Marker and a MarkerComposable. The sample showcases how the layout is loaded from the Activity, and how are the Fragments displayed.

@googlemaps-bot
Copy link
Contributor

Code Coverage

There is no coverage information present for the Files changed

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@kikoso kikoso marked this pull request as ready for review July 23, 2025 19:20
@kikoso kikoso requested a review from a team as a code owner July 23, 2025 19:20
Key changes include:
- Renamed `activity_main.xml` to `activity_fragment_demo.xml` and added a `TextView` to indicate swipe functionality.
- Renamed `MyFragmentPagerAdaptar.kt` to `MapFragmentPagerAdapter.kt` and modified it to dynamically determine the number of fragments based on `mapConfigs`.
android:layout_margin="16dp"
android:background="#80000000"
android:padding="16dp"
android:text="Swipe to switch between views"

Check warning

Code scanning / Android Lint

Hardcoded text Warning

Hardcoded string "Swipe to switch between views", should use @string resource
@dkhawk dkhawk merged commit 820adfe into main Jul 23, 2025
13 checks passed
@dkhawk dkhawk deleted the chore/added_fragment_sample branch July 23, 2025 21:42
@googlemaps-bot
Copy link
Contributor

🎉 This PR is included in version 6.7.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

dkhawk added a commit to akexorcist/android-maps-compose that referenced this pull request Aug 27, 2025
* chore: added Fragment sample

* chore: added ViewPager example

* chore: fixed GitHub flow

* feat: Updates to the FragmentDemoActivity.kt

Key changes include:
- Renamed `activity_main.xml` to `activity_fragment_demo.xml` and added a `TextView` to indicate swipe functionality.
- Renamed `MyFragmentPagerAdaptar.kt` to `MapFragmentPagerAdapter.kt` and modified it to dynamically determine the number of fragments based on `mapConfigs`.

---------

Co-authored-by: dkhawk <107309+dkhawk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants