Issue
I have colors that are dynamically generated in my app, based off of user preferences. I used these colors effectively in chrisbane's ActionBar-PullToRefresh library, but since that library is no longer being developed, I'm trying to move over to SwipeRefreshLayout. However, SwipeRefreshLayout seems to only take color resource IDs, as opposed to ints that directly represent colors, and as such I can't find any way to color the progress bar. Is there anything I'm missing in SwipeRefreshLayout that would allow me to do what I need to do?
Solution
Not sure about the v19 support library, but the v20 one has the following methods:
public void setColorSchemeResources(int colorRes1, int colorRes2, int colorRes3, int colorRes4)
Which allows you to set the colors by resource. But the following method also exists, which takes colors:
public void setColorSchemeColors(int color1, int color2, int color3, int color4)
The second one is your answer
Answered By - nickmartens1980
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.