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
  • 16,276
  • 16
  • 38
  • 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
  • 4,255
  • 3
  • 28
  • 37