Commit 0595432
chore: unified Java/Kotlin project (#2026)
* chore: unified Kotlin and Java modules
* chore: unified resources
* chore: removed Kotlin
* chore: headers
* chore: headers
* chore: headers
* chore: headers
* chore: added insets
* chore: headers
* chore: renamed
* fix: Refactor map creation, centralize Map ID, add Kotlin boundary controls
This commit refactors how map fragments and Map IDs are handled across the Java and Kotlin demo applications, and introduces feature parity for boundary layer controls in the Kotlin demo.
Key changes include:
- **Programmatic Map Fragment Creation:**
- Replaced static `<fragment>` map declarations with `<FrameLayout>` containers (`map_fragment_container`) in `data_driven_boundaries_demo.xml` and `data_driven_styling_demo.xml` layouts.
- Modified `DataDrivenBoundariesActivity` and `DataDrivenDatasetStylingActivity` (Java & Kotlin) to instantiate `SupportMapFragment` programmatically using `SupportMapFragment.newInstance(mapOptions)`.
- Map options (`GoogleMapOptions`) are now created with the dynamically retrieved Map ID before fragment creation.
- this allows moving the Map ID out of the xml files
- **Centralized Map ID and Configuration Logic:**
- Introduced `ApiDemoApplication` in both Java (`java-app`) and Kotlin (`kotlin-app`) modules.
- This class centralizes Map ID retrieval, checking `BuildConfig.MAP_ID` first, then the `R.string.map_id` resource, providing a consistent source.
- The Kotlin `ApiDemoApplication` also includes API Key validation on application startup.
- **Kotlin DataDrivenBoundaries Feature Enhancement:**
- Added boundary layer selection controls (popup menu via `button_feature_type`) to the Kotlin `DataDrivenBoundariesActivity`, achieving parity with the Java version's functionality.
- Implemented state management for toggling Locality, Administrative Area Level 1, and Country layers.
- Added dynamic styling logic to apply/remove styles based on layer visibility.
- Updated feature click handling for country selection, respecting layer activation state.
- **Miscellaneous Improvements:**
- Added distinct demo titles (`demo_title_java`, `demo_title_kotlin`) in `strings.xml` for better app identification.
- Updated resource references within Java/Kotlin activities for cleaner imports (e.g., `R.id...` instead of fully qualified names).
* chore: address various lint issues
* fix: explicitly bind checkboxes in the UI
---------
Co-authored-by: dkhawk <107309+dkhawk@users.noreply.github.com>1 parent 9d1089f commit 0595432
File tree
531 files changed
+3589
-7058
lines changed- ApiDemos
- java
- app/src
- main/java/com/example/mapdemo
- v3
- java/com/example/mapdemo
- res/layout
- gradle
- kotlin
- app/src
- main
- java/com/example/kotlindemos
- res
- drawable-hdpi
- drawable-mdpi
- drawable-nodpi
- drawable-xhdpi
- drawable-xxhdpi
- drawable
- layout
- mipmap-hdpi
- mipmap-mdpi
- mipmap-xhdpi
- mipmap-xxhdpi
- mipmap-xxxhdpi
- raw
- values
- v3
- java/com/example/kotlindemos
- res/layout
- gradle/wrapper
- project
- common-ui
- src
- androidTest/java/com/example/common_ui
- main
- res
- drawable-hdpi
- drawable-mdpi
- drawable-nodpi
- drawable-xhdpi
- drawable-xxhdpi
- drawable
- layout-land
- layout
- mipmap-hdpi
- mipmap-mdpi
- mipmap-xhdpi
- mipmap-xxhdpi
- mipmap-xxxhdpi
- raw
- values
- test/java/com/example/common_ui
- gradle
- wrapper
- java-app
- src
- main
- java/com/example/mapdemo
- v3
- java/com/example/mapdemo
- anim
- model
- polyline
- res/layout
- kotlin-app
- src
- main
- java/com/example/kotlindemos
- res
- drawable-hdpi
- drawable-mdpi
- drawable-nodpi
- drawable-v24
- drawable-xhdpi
- drawable-xxhdpi
- drawable
- mipmap-anydpi-v26
- mipmap-hdpi
- mipmap-mdpi
- mipmap-xhdpi
- mipmap-xxhdpi
- mipmap-xxxhdpi
- values
- v3
- java/com/example/kotlindemos
- anim
- model
- polyline
- res/layout
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
531 files changed
+3589
-7058
lines changedLines changed: 0 additions & 162 deletions
This file was deleted.
Lines changed: 0 additions & 150 deletions
This file was deleted.
0 commit comments