Skip to content

Refactor Quick Settings UI - #530

Open
Kimblebee wants to merge 95 commits into
mainfrom
kim/refactor/quickSettings/button-rows
Open

Refactor Quick Settings UI#530
Kimblebee wants to merge 95 commits into
mainfrom
kim/refactor/quickSettings/button-rows

Conversation

@Kimblebee

@Kimblebee Kimblebee commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Refactors the Quick Settings UI to a flat connected button row layout using Material 3 Expressive ToggleButton groups. Also hoists UI actions via a new, scalableQuickSettingsEvent sealed interface, improves conflict handling between HDR and Low Light Boost / Dual Camera mode, modernizes the test suite, and cleans up unused resources.


Key Changes

  • Flat Button Row UX: Replaces expandable sub-screens (Aspect Ratio, Capture Mode) with flat SettingRow / QuickSettingsListRow components using ButtonGroupDefaults connected shapes. Removed "Flip Camera" from Quick Settings (available directly on preview).
  • Conflict Resolution & State Handling: Unsupported flash modes (such as Low Light Boost when HDR is active) now remain visible as disabled with a clear rationale (LLB_DISABLED_BY_HDR) rather than disappearing.
  • Architecture & Cleanup:
    • Removed the obsolete FocusedQuickSetting enum and setFocusedSetting() controller method.
    • Deleted NoOpQuickSettingsController and unused drawables/strings.
    • Scoped state adapter functions (FlashModeUiState.from, HdrUiState.from) to internal.

⚠️ Breaking Changes & Dependents Notice

1. Test Tags (Impacts Google3 & Test Automation)

Removed Tag / Constant New Replacement Tag
QUICK_SETTINGS_HDR_BUTTON BTN_QUICK_SETTINGS_HDR_OPTION_ON / _OFF
BTN_QUICK_SETTINGS_FOCUS_CAPTURE_MODE BTN_QUICK_SETTINGS_CAPTURE_MODE_OPTION_*
QUICK_SETTINGS_FLASH_BUTTON BTN_QUICK_SETTINGS_FLASH_OPTION_*
QUICK_SETTINGS_FLIP_CAMERA_BUTTON FLIP_CAMERA_BUTTON (main UI)
QUICK_SETTINGS_RATIO_BUTTON QUICK_SETTINGS_RATIO_*_BUTTON / ROW_QUICK_SETTINGS_ASPECT_RATIO
QUICK_SETTINGS_CLOSE_EXPANDED_BUTTON None (sub-panels removed)

2. Public Signatures & State Models

  • QuickSettingsController: Removed setFocusedSetting(focusedQuickSetting: FocusedQuickSetting).
  • QuickSettingsUiState.Available & TrackedCaptureUiState: Removed focusedQuickSetting parameter.
  • QuickSettingsBottomSheet: Now takes onEvent: (QuickSettingsEvent) -> Unit instead of QuickSettingsController.
  • CaptureModeToggleButton: Now takes onChangeCaptureMode and onToggleWhenDisabled lambdas.

Testing

  • Unit Tests:
    • Added QuickSettingsControllerImplTest and QuickSettingsUiStateAdapterTest
    • Updated CaptureUiStateAdapterTest, FlashModeUiStateAdapterTest, and HdrUiStateAdapterTest
  • Instrumented Tests:
    • Updated ComposeTestRuleExt.kt, CaptureModeSettingsTest, ConcurrentCameraTest, NavigationTest, and SwitchCameraTest to target the flat button row layout.
Screenshot 2026-07-29 at 10 22 23 AM Screenshot 2026-07-29 at 10 21 33 AM

Kimblebee added 30 commits April 8, 2026 19:12
- remove flip camera, stream config, and concurrent camera from quick settings
- all quick settings menu items adopt the button row ux
- WIP unique selection of settings depending on current capture mode
auxiliary function for settings subtitles
… state

- Re-added the 'More Settings' button to the Quick Settings bottom sheet.

- Introduced a 'showMoreSettingsButton' boolean parameter to control its visibility, defaulting to true.

- Removed unused 'focusedQuickSetting' state from 'QuickSettingsUiState' and 'TrackedCaptureUiState'.

- Cleaned up 'FlashModeUiStateAdapter.kt' by removing a debug 'println' and adding a 'todo(kc)' for 'visibleFlashModes'.
    Remove unused drawables and their corresponding enum classes in
    QuickSettingsEnums that are no longer referenced after the quick
    settings refactoring.
    - Decoupled dynamic range (video HDR) from image format (image HDR) settings across UI, controller, and CameraX configuration layers.
    - Removed dynamic range constraints from the createImageUseCase configuration in CameraSession.kt, enabling independent Ultra HDR
  image capture.
    - Updated QuickSettings bottom sheet click handlers to mutate only the HDR setting relevant to the active capture mode.
    - Enforced specialized Low Light Boost vs Ultra HDR conflicts in CameraXCameraSystem.kt, prioritizing Low Light Boost.
    - Created HdrUiStateAdapterTest.kt covering all HDR availability states and flash conflicts.
    - Refactored CameraXCameraSystemTest.kt to run parameterized HDR decoupling tests on both front and rear lenses.
Comment thread ui/components/capture/src/main/res/values/strings.xml Outdated
-adjust letter capitalization for quick settings title
- hide settings that arent supported by the current lens
… state adapter tests

- Refactored the Quick Settings bottom sheet UI to a flat layout, replacing nested navigation and scrollable containers with direct option rows.
- Updated Instrumented tests (BackgroundDeviceTest, CaptureModeSettingsTest, ConcurrentCameraTest, NavigationTest, SwitchCameraTest) and helper functions in ComposeTestRuleExt.kt to interact with the flat layout.
- Added LocalDisableAnimations composition local support in PreviewScreen.kt and QuickSettingsModalBottomSheet to disable animations for faster, more reliable testing.
- Refactored FlashModeUiState.Unavailable and HdrUiState.Unavailable from classes to objects and updated tests in FlashModeUiStateAdapterTest.kt and HdrUiStateAdapterTest.kt.
- Dynamically update FlipCameraButton's content description based on current lens facing.
…lBottomSheet

Reverted QuickSettingsModalBottomSheet in QuickSettingsComponents.kt to directly use Material3's ModalBottomSheet, removing the custom non-gestural Box/Column layout previously used with LocalDisableAnimations.

Cleaned up ComposeTestRuleExt.kt visitQuickSettings cleanup to rely on standard swipe-to-dismiss behavior and verification.
- Remove obsolete toast and disabled rationale strings from ui:components:capture.
- Delete unused strings.xml in ui:controller:impl.
- Retain ui:uistateadapter:capture as the single source of truth for toast and rationale strings.
@Kimblebee
Kimblebee requested a review from temcguir August 20, 2026 22:45
@Kimblebee
Kimblebee force-pushed the kim/refactor/quickSettings/button-rows branch from 6eb1dbc to d05b997 Compare August 25, 2026 19:09
Comment thread app/src/androidTest/java/com/google/jetpackcamera/utils/ComposeTestRuleExt.kt Outdated
Comment thread app/src/androidTest/java/com/google/jetpackcamera/utils/ComposeTestRuleExt.kt Outdated
Comment thread app/src/androidTest/java/com/google/jetpackcamera/utils/ComposeTestRuleExt.kt Outdated
Comment thread app/src/androidTest/java/com/google/jetpackcamera/utils/ComposeTestRuleExt.kt Outdated
@Kimblebee
Kimblebee force-pushed the kim/refactor/quickSettings/button-rows branch from 72f5480 to 5d67110 Compare August 26, 2026 21:09
@Kimblebee
Kimblebee force-pushed the kim/refactor/quickSettings/button-rows branch from 5d67110 to 3b7dfd5 Compare August 26, 2026 22:00
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