SwipeRefreshLayout style in r21 support library

I could not find the documentation on how to create a new refreshIcon in swipeRefreshLayout ?

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

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

+5
source share
3 answers

With the last r21, you can change the hue of the arrow by passing one color to one of the following methods:

 swipeRefreshLayout.setColorSchemeColors(Color.RED); 

or

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

Tested and works on Android 5.0.2, should also work with any other version from v4. Have a nice day!

+11
source

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

See the link to the Android API .

+1
source

Not sure which icon you're saying, this layout is just the line at the top, as far as I know. Instead of the official SwipeRefreshLayout, I use https://github.com/baoyongzhang/android-PullRefreshLayout , which have 4 styles, you probably mean material design.

0
source

Source: https://habr.com/ru/post/1207723/


All Articles