Reputation: 91193
In Android 2.3.x (and maybe previous versions?) when working with any scrollable Views, like a ListView or ScrollLayout, etc, when you reach the top or bottom of the list, a orange gradient appears to indicate that you are at the top or bottom of the list and can't scroll any farther. The gradient gets bigger as you try to scroll farther off the screen. I don't know what the name is of this type of widget in the SDK.
Anyways, how to do I alter it, change colors, get rid of it, etc?
Upvotes: 2
Views: 1411
Reputation: 5722
Have a look at this
change gradient colour at end of ListView
Override setOverScrollMode method
@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); }
Upvotes: 0
Reputation: 8251
ListView.setOverscrollHeader(Drawable drawable);
ListView.setOverscrollFooter(Drawable drawable);
Upvotes: 2