[Catalyst] Introduce the FooterPreferenceMetadata and FooterPreferenceBinding
Test: manual test Bug: 335132588 Flag: com.android.settings.flags.catalyst Change-Id: Iff63b53ea335c96358a5278bd7e9a4d291c0b6d7
This commit is contained in:
@@ -20,8 +20,11 @@ import androidx.preference.Preference
|
||||
import com.android.settings.restriction.PreferenceRestrictionMixin
|
||||
import com.android.settings.restriction.getRestrictionEnforcedAdmin
|
||||
import com.android.settings.restriction.hasBaseUserRestriction
|
||||
import com.android.settings.widget.FooterPreferenceBinding
|
||||
import com.android.settings.widget.FooterPreferenceMetadata
|
||||
import com.android.settingslib.RestrictedPreferenceHelperProvider
|
||||
import com.android.settingslib.metadata.PreferenceHierarchyNode
|
||||
import com.android.settingslib.metadata.PreferenceMetadata
|
||||
import com.android.settingslib.preference.DefaultPreferenceBindingFactory
|
||||
import com.android.settingslib.preference.PreferenceBinding
|
||||
|
||||
@@ -49,4 +52,11 @@ class SettingsPreferenceBindingFactory : DefaultPreferenceBindingFactory() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getPreferenceBinding(metadata: PreferenceMetadata) =
|
||||
metadata as? PreferenceBinding
|
||||
?: when (metadata) {
|
||||
is FooterPreferenceMetadata -> FooterPreferenceBinding.INSTANCE
|
||||
else -> super.getPreferenceBinding(metadata)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user