Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is different between setColorSchemeColors(int... colors) and setColorSchemeResources(int... colorResIds) and setColorScheme(int... colors)?

Tags:

android

in android doc https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html#setColorSchemeColors(int...)
for set color schema have three methods
what is difference between 3 methods?

setColorScheme(int... colors)
setColorSchemeColors(int... colors)
setColorSchemeResources(int... colorResIds)
like image 414
Mehrdad Faraji Avatar asked Nov 09 '14 06:11

Mehrdad Faraji


1 Answers

Looking at the API docs, I can see that setColorScheme is deprecated in favour of setColorSchemeResources. So forget that first one.

The different between setColorSchemeColors and setColorSchemeResources is that the former takes colour values as the parameters and the latter takes resource IDs.

So.

  • setColorScheme - do not use this
  • setColorSchemeColors - use this when setting the specific colour values
  • setColorSchemeResources - use this when setting resource references to colours.
like image 198
Synesso Avatar answered Sep 28 '22 08:09

Synesso