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.

0

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.