Skip to content

[Android] AppBar flicker while changing the CheckBox or Switch state after scrolling in Material 3 #35180

Description

@Dhivya-SF4094

When Material 3 is enabled on Android, toggling a CheckBox or Switch that is inside a ScrollView causes the AppBarLayout surface color to flicker. The flicker is most visible after scrolling down — the AppBar briefly flashes between its lifted (scrolled) and non-lifted states on every toggle.

Expected Behavior
The AppBar should remain in its lifted state without any visual change when toggling controls.

Actual Behavior
The AppBar flickers — it briefly flashes to the non-lifted surface color and back on every CheckBox/Switch state change. The flicker is caused by the state-change animation triggering a layout pass, which causes AppBarLayout to re-evaluate its shouldLift() check.

AppBar_flicker.mov

Steps to reproduce

  1. Create a page with a NavigationPage or Shell containing a ScrollView
  2. Place several CheckBox or Switch controls inside the ScrollView
  3. Ensure Material 3 is enabled.
  4. Scroll the page down so the AppBar enters its "lifted" state (showing scrolledContainerColor)
  5. Toggle any CheckBox or Switch. See the Appbar is flickering

AppBarFlickerRepo.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions