I'm creating a settings screen, and I have a few settings items:
SwitchPreferenceCompat and my CustomPreference.
I need the СustomPreference to disappear(hide) when the SwitchPreferenceCompat is turned off and appear(show) when the SwitchPreferenceCompat is turned on.
Out of the box, only the "dependency" mechanism is available by specifying the "dependency" attribute for some Preferences, which only disables/enables items, and I need to change visibility.
Is there a way to achieve this?
create customPreference and override onDependencyChanged().