Skip to content

feat(PlaceDetailsCompose): Enhance Place Details Compose sample#988

Merged
dkhawk merged 7 commits intomainfrom
fix/readme-support-section
Dec 11, 2025
Merged

feat(PlaceDetailsCompose): Enhance Place Details Compose sample#988
dkhawk merged 7 commits intomainfrom
fix/readme-support-section

Conversation

@dkhawk
Copy link
Collaborator

@dkhawk dkhawk commented Dec 10, 2025

Enhance Place Details View with Customization and UI Polish

This pull request introduces significant enhancements to the Place Details experience, focusing on user customization and UI refinement.

The primary new feature allows users to dynamically select which content fields (e.g., address, phone number, website) are displayed in both the
compact and full Place Details views. This provides greater flexibility and a more tailored experience.

Key Changes:

  • feat: Customizable Place Content Selection

    • A "Select Fields" dialog has been added, allowing users to toggle the visibility of different place information fields.
    • The PlaceDetailsCompactView and PlaceDetailsFullView now dynamically render content based on user selections.
    • MapViewModel has been updated to manage the state for the selected content.
  • refactor: Improved Fragment Handling

    • The creation logic for the PlaceDetailsCompactView fragment has been optimized.
  • style: UI Refinements & Polish

    • The UI for toggle switches has been refined to be collapsible and end-aligned.
    • Switched to the native "My Location" button for a more standard map experience.
    • The dismiss button has been styled with a semi-transparent background.
  • fix: Addressed Coordinate Mode and Layout Issues

    • Corrected an issue where "Coordinate Mode" was not functioning as expected.
    • Resolved a layout gap in the PlaceDetailsFullView to ensure it fills the entire screen.

- Switch to built-in My Location button in MapScreen
- Fix coordinate mode to use loadWithCoordinates in PlaceDetailsView
- Style dismiss button with semi-transparent background
- Fix gap in PlaceDetailsFullView by using fillMaxSize
- Update MapViewModel to handle coordinate mode toggle
Introduces the ability for users to select which content fields are displayed in the Place Details Compact and Full views.

- **MapScreen.kt**:
  - Implemented state for content selection dialog visibility and selected content.
  - Added a "Select Fields" button to trigger the content selection dialog.
  - Updated `PlaceDetailsCompactView` and `PlaceDetailsFullView` to accept dynamic content lists.
  - Integrated `PlaceContentSelectionDialog` to allow users to choose fields for both compact and full views.

- **PlaceDetailsView.kt**:
  - Modified `PlaceDetailsCompactView` and `PlaceDetailsFullView` to utilize the `content` parameter when creating `PlaceDetailsCompactFragment` and `PlaceDetailsFragment` instances respectively.
  - Ensured proper fragment lifecycle management within `AndroidView` for `PlaceDetailsFullView`.

- **MapViewModel.kt**:
  - Added `MutableStateFlow` to manage the selected content for both compact and full place details views.
  - Provided `updateCompactContent` and `updateFullContent` functions to modify these selections.

- **PlaceContentSelectionDialog.kt**:
  - Implemented the `PlaceContentSelectionDialog` to allow users to select content fields from a list of available options.

This enhancement allows for greater flexibility and customization of the displayed place information.
@dkhawk dkhawk changed the title feat: feat: Enhance Place Details View with Customization and UI Polish Dec 10, 2025
@dkhawk dkhawk changed the title feat: Enhance Place Details View with Customization and UI Polish feat(PlaceDetailsCompose): Enhance Place Details Compose sample Dec 10, 2025
Added the standard Google LLC copyright header to the file
PlaceDetailsCompose/app/src/main/java/com/example/placedetailscompose/ui/map/PlaceContentSelectionDialog.kt
to ensure proper licensing.
@dkhawk dkhawk requested a review from kikoso December 10, 2025 21:56
- Created ARCHITECTURE.md with junior developer tips
- Extracted hardcoded strings to strings.xml
- Verified build and launch
- Replaced custom column with Material 3 ElevatedCard.
- Improved spacing and layout for toggles.
- Changed toggle arrangement to use spacedBy for better grouping.
Copy link
Collaborator

@kikoso kikoso left a comment

Choose a reason for hiding this comment

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

LGTM!

@dkhawk dkhawk merged commit 97da8ea into main Dec 11, 2025
9 checks passed
@dkhawk dkhawk deleted the fix/readme-support-section branch December 11, 2025 17:25
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