Skip to content

[Switch] MaterialSwitch is not applied to SwitchPreferenceCompat #2828

@OxygenCobalt

Description

@OxygenCobalt

Description: I leverage SwitchPreferenceCompat in the preference screen of my app. Even though MDC has released the new switch component in an unstable version, the new switches will not appear on the preference screen.

This can be traced back to the preference implementation inflating a Switch, but MaterialComponentsViewInflater not intercepting that inflation and replacing it with an analogous MaterialSwitch.

Expected behavior: The preference screen should leverage MaterialSwitch.

Source code: Occurs with any SwitchPreferenceCompat instance.

Android API version: Any API version

Material Library version: 1.7.0-alpha03

Device: Pixel 5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions