Skip to content

Refactor Settings UI: decouple Compose slots and simplify UI state - #563

Open
temcguir wants to merge 10 commits into
mainfrom
temcguir/refactor-settings-compose-slots
Open

Refactor Settings UI: decouple Compose slots and simplify UI state#563
temcguir wants to merge 10 commits into
mainfrom
temcguir/refactor-settings-compose-slots

Conversation

@temcguir

@temcguir temcguir commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

This pull request introduces a robust Compose slot architecture for the Settings view natively inside the Jetpack Camera App. Rather than hardcoding the menu options, external feature plugins and custom apps can now safely inject custom nodes using the slot properties exposed on the SettingsScreen node, while still retaining fully featured state hoisting for isolated UI previews.

Key Changes

  • Compose Slot Extensibility: Refactored SettingsScreen to accept custom Compose slots (like cameraSettingsSlot, recordingSettingsSlot, etc.) allowing granular layout modifications.
  • Component Reusability: Safely exposed all default settings building blocks (DefaultCameraSettings, DefaultRecordingSettings, DefaultAppSettings) as public so external developers can selectively reuse them within their customized overrides.

This introduces a robust Compose slot architecture for the Settings
view natively inside Jetpack Camera App. Rather than hardcoding the
menu options, feature plugins and custom apps can inject custom nodes
using the slot properties exposed on the SettingsScreen node, while
retaining fully featured state hoisting for isolated UI previews.

Tests have been updated to reflect the ability to inject the generic UI.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 refactors the settings screen by decomposing the monolithic settings list into modular slots and introducing default stateful and stateless implementations for camera, recording, and app settings. It also adds a new JcaEffectsSetting component to manage camera effects. The review feedback suggests restricting the visibility of these new composables to internal to follow proper visibility guidelines, and simplifying the type-checking and casting logic of SettingsUiState using Kotlin's idiomatic as? and Elvis operator.

Comment thread app/src/main/java/com/google/jetpackcamera/ui/JcaEffectsSetting.kt Outdated
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