Avoid drawing the invalid levels in the chart view am: 40319d9d6f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14140152 Change-Id: I3cf7a4764aa3cf30ef370796e51f58bb496f74f3
This commit is contained in:
@@ -227,6 +227,10 @@ public class BatteryChartView extends AppCompatImageView implements View.OnClick
|
|||||||
// Draws all trapezoid shapes into the canvas.
|
// Draws all trapezoid shapes into the canvas.
|
||||||
final Path trapezoidPath = new Path();
|
final Path trapezoidPath = new Path();
|
||||||
for (int index = 0; index < mTrapezoidCount; index++) {
|
for (int index = 0; index < mTrapezoidCount; index++) {
|
||||||
|
// Not draws the trapezoid for corner or not initialization cases.
|
||||||
|
if (mLevels[index] == 0 || mLevels[index + 1] == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// Configures the trapezoid paint color.
|
// Configures the trapezoid paint color.
|
||||||
mTrapezoidPaint.setColor(
|
mTrapezoidPaint.setColor(
|
||||||
mSelectedIndex == index || mSelectedIndex == SELECTED_INDEX_ALL
|
mSelectedIndex == index || mSelectedIndex == SELECTED_INDEX_ALL
|
||||||
|
Reference in New Issue
Block a user