Change gradient color at the end of the list

In Google Nexus S, when you try to drag the end of a ListView, a yellow gradient appears and its size is determined by removing the distance. How to change the color of this gradient? I do not see anything obvious.

This is not cacheColorHint.

+3
source share
1 answer

In the ScrollView implementation, it is hard-coded. Have a look at this , the method setOverScrollMode()on line 1389 (the exact line number may change if someone updates the source):

@Override
 public void setOverScrollMode(int mode) {
     if (mode != OVER_SCROLL_NEVER) {
         if (mEdgeGlowTop == null) {
             final Resources res = getContext().getResources();
             final Drawable edge = res.getDrawable(R.drawable.overscroll_edge);
             final Drawable glow = res.getDrawable(R.drawable.overscroll_glow);
             mEdgeGlowTop = new EdgeGlow(edge, glow);
             mEdgeGlowBottom = new EdgeGlow(edge, glow);
         }
     } else {
         mEdgeGlowTop = null;
         mEdgeGlowBottom = null;
     }
     super.setOverScrollMode(mode);
 }

, , - ScrollView, setOverScrollMode(), , ListView, ScrollView .

+2

All Articles