1

The gradient is erroneously painted using StartColor and Color. It does not respect the value of EndColor.

Bar bar = new Bar();
bar.setMultiBar(MultiBars.STACKED);
bar.setBarStyle(BarStyle.RECTGRADIENT);
bar.getGradient().setDirection(GradientDirection.VERTICAL);
bar.getGradient().setUseMiddle(false);

bar.getGradient().setStartColor(Color.fromArgb(0xff000000));
bar.getGradient().setEndColor(Color.fromArgb(0xffffff00));

// WORKAROUND: Setting the color yields a valid gradient.
// bar.setColor(Color.fromArgb(0xffffff00));

Android 4.1.2, Nexus S.

Narcís Calvet
  • 7,304
  • 5
  • 27
  • 47
l33t
  • 18,692
  • 16
  • 103
  • 180

1 Answers1

1

You are right. I've added it to the defect list to be revised for next releases. In the meanwhile, the workaround you suggested looks fine to me.

Yeray
  • 5,009
  • 1
  • 13
  • 25