Before AndroidX,
I would override the Preference's onCreateView(ViewGroup parent)
method to pass Custom Layouts to be used as Preference.
But in AndroidX's Preference, there is no onCreateView(ViewGroup parent)
method but it instead has onBindViewHolder(PreferenceViewHolder holder)
, I am not sure how to pass custom layouts & use them instead..
Any help would be highly appreciated!
Thanks!
One has to assign it in the constructor already:
this.setLayoutResource(R.layout.preferences);
Here are some examples for onBindViewHolder().