Android PreferenceFragment change overscroll color

383 Views Asked by At

In Android 5 (Lollipop) the colorPrimaryDark is used for the overscroll color in listviews. Now I want to change it everywhere. I found a way to set for a single ListView, but the PreferenceFragment has no external layout for editing. How can I set the overscroll color for every ListView in my whole app?

1

There are 1 best solutions below

0
On

for your preference fragment, get a reference to the listview in your onCreateView(...) and call setOverscrollFooter and setOverscrollHeader

    final ListView lv = (ListView) v.findViewById(android.R.id.list);
    lv.setOverscrollFooter(someDrawable);
    lv.setOverscrollHeader(someDrawable);

As for everywhere else, and the new colorPrimaryDark to your application styles.