Reputation: 1348
Is it possible to change the ScrollView and ListView edge glow color from blue to orange.?
Upvotes: 1
Views: 1966
Reputation: 4607
If you want to change color of glow, when you pull listview (the blue glow effect) use
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);
mode SRC_IN will show only your color. Place this code in Application class if color will be same or before initialisation of each individual listview (if you want different glow of different listviews).
If you asking about color change of fadingedge ( a shadow a top and a bottom of listview)
change color of colorCacheHint
inside listview
Upvotes: 2
Reputation: 75629
Yes. Create drawable you like and set it for the listview:
android:overScrollHeader="@drawable/header"
android:overScrollFooter="@drawable/footer"
Upvotes: 0
Reputation: 76466
use the Android Holo Colors Generator by Jérôme Van Der Linden
http://android-holo-colors.com/
The Android Holo Colors Generator allows you to easily create Android components such as editext or spinner with your own colours for your Android application. It will generate all necessary nine patch assets plus associated XML drawables and styles which you can copy straight into your project.
Select the views you want to generate colors for and add pngs & the theme from the XML it generates
Upvotes: 0