Tran duc Huy
Tran duc Huy

Reputation: 21

Android : Change color of blue shine (blue highlight) in List View

I really want to change color of blue shine (blue highlight) was appeared when we attempt to pull at the top (or the end) in List View (many items at there).

Therefore, I want to change this color from blue to orange, guys.

http://img835.imageshack.us/img835/5609/28746577.jpg

p/s :

Thanks,

Upvotes: 2

Views: 1503

Answers (2)

possenH4lt3r
possenH4lt3r

Reputation: 105

Here's a workaround, that worked for me:

http://evendanan.net/android/branding/2013/12/09/branding-edge-effect/

public static void brandGlowEffect(Context context, int brandColor) {

      //glow
      int glowDrawableId = context.getResources().getIdentifier("overscroll_glow", "drawable", "android");
      Drawable androidGlow = context.getResources().getDrawable(glowDrawableId);
      androidGlow.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN);
      //edge
      int edgeDrawableId = context.getResources().getIdentifier("overscroll_edge", "drawable", "android");
      Drawable androidEdge = context.getResources().getDrawable(edgeDrawableId);
      androidEdge.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN);
}

You have to invoke this method at OnCreate, right after setting the layout.

Upvotes: 2

Michał Z.
Michał Z.

Reputation: 4119

It can't be done. You will find an explanation here:

https://groups.google.com/forum/?fromgroups=#!topic/android-developers/i5a3uNN8jpg

public static void brandGlowEffect(Context context, int brandColor) {

      //glow
      int glowDrawableId = context.getResources().getIdentifier("overscroll_glow", "drawable", "android");
      Drawable androidGlow = context.getResources().getDrawable(glowDrawableId);
      androidGlow.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN);
      //edge
      int edgeDrawableId = context.getResources().getIdentifier("overscroll_edge", "drawable", "android");
      Drawable androidEdge = context.getResources().getDrawable(edgeDrawableId);
      androidEdge.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN);
}

You have to invoke this at OnCreate or OnCreateView.

Upvotes: 0

Related Questions