In order to have custom fonts for each Preference in PreferenceFragment, I had to write a new customized class for each preference type (CustomSwitchP
In your styles.xml, add the following style:
Then, in SettingsFragment.java, override the onCreateView():
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = super.onCreateView(inflater, container, savedInstanceState);
container.getContext().setTheme(R.style.PreferenceTheme);
return view;
}
This usually does the trick. If not, add the style to AndroidManifest.xml:
...
I'm getting a neat result: Preferences with custom font - "Lato"