Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Style SwipeRefreshLayout in r21 of support library

I couldn't find any documentation on how to style the new refreshIcon in the swipeRefreshLayout ?

this.swipeRefreshLayout.setProgressBackgroundColor(R.color.feed_refresh_1);

this just changes the <background color> of the refresh icon background, is there a way to change the color of the arrow itself?

like image 403
Display name Avatar asked Nov 26 '14 09:11

Display name


2 Answers

With the latest r21, you can change the spinning arrow tint passing just one color to one of these methods:

swipeRefreshLayout.setColorSchemeColors(Color.RED);

or:

swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_red_dark);

Tested and working on Android 5.0.2, should also work with every other version since v4. Have a nice day!

like image 197
araks Avatar answered Nov 14 '22 03:11

araks


Use this.swipeRefreshLayout.setColorSchemeColors(..); or this.swipeRefreshLayout.setColorSchemeResources(..);.

See Android API reference.

like image 33
miguelt Avatar answered Nov 14 '22 02:11

miguelt