Is it possible to change the colour of the FadingEdge of a Listview?

前端 未结 3 530
礼貌的吻别
礼貌的吻别 2020-12-09 23:52

I want to give the effect that the ListView has faded from whatever is around it. By default it is set to whatever colour your ListView is. I can adjust the orientation of t

3条回答
  •  不思量自难忘°
    2020-12-10 00:46

    You can try this (it's a hack, I know):

    int glowDrawableId = context.getResources().getIdentifier("overscroll_glow", "drawable", "android");
    Drawable androidGlow = context.getResources().getDrawable(glowDrawableId);
    androidGlow.setColorFilter(brandColor, PorterDuff.Mode.MULTIPLY);
    

    I took advantage of the fact that the glow effect is actually a shared Drawable and applied a filter on it: http://evendanan.net/android/branding/2013/12/09/branding-edge-effect/

提交回复
热议问题