Is it possible to set colors for a Swipe Refresh Layout in XML?

Viewed 208

I would like to set the theme-appropriate ProgressBackgroundColorSchemeColor and colorSchemeColors of my Swipe Refresh Layout in XML. However, I can only seem to find solutions to do it programmatically like this one below.

TypedValue typedValue = new TypedValue();
int colorValue;
if (context.getTheme().resolveAttribute(R.attr.xxx, typedValue, true))
  colorValue = typedValue.data;
else
  colorValue = Color.TRANSPARENT;

mSwipeRefreshLayout.setColorSchemeColors(colorValue);

These attributes are also not recognized in XML; so is it at all possible?

1 Answers

The arrow appears in each color for every turn.

mSwipeRefreshLayout.setColorSchemeResources(
  android.R.color.holo_blue_bright,
  android.R.color.holo_green_light,
  android.R.color.holo_orange_light,
  android.R.color.holo_red_light
);
Related