0

Instead of programatically passing parameters to create a LinearGradient.

new LinearGradient(0, 0, 0, mWheelHeight, Color.parseColor("#4A90E2"), Color.parseColor("#50E3C2"), Shader.TileMode.MIRROR);

is it possible to load the colors from XML?

ksuralta
  • 15,076
  • 16
  • 36
  • 36

1 Answers1

0

You can set this directly inside Paint

paint.setShader(new LinearGradient(0, 0, 0, getHeight(), Color.BLACK, Color.WHITE, Shader.TileMode.MIRROR));
Sanjeev
  • 3,955
  • 2
  • 26
  • 35