Remove overscroll glow in android?

2019-09-08 17:07发布

问题:

In my application I am implementing the JasonFry overscroll listview, though I want to get rid of the annoying blue glow that appears on the scroll function. It seems very odd that it is so complicated to remove this... Any help would be greatly appreciated

回答1:

like I answered here To remove blue glow completely:

android:overScrollMode="never" place this attribute inside listview.
To change glow color add this code in application class

int glowDrawableId = getResources().getIdentifier("overscroll_glow", "drawable", "android");
        int edgeDrawableId = getResources().getIdentifier("overscroll_edge", "drawable", "android");
        Drawable androidGlow = ContextCompat.getDrawable(this, glowDrawableId);
        Drawable androidEdge = ContextCompat.getDrawable(this, edgeDrawableId);
        androidGlow.setColorFilter(getResources().getColor(R.color.white_20), PorterDuff.Mode.SRC_IN);
        androidEdge.setColorFilter(getResources().getColor(R.color.white_20), PorterDuff.Mode.SRC_IN);