Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 40319d9d authored by ykhung's avatar ykhung Committed by YUKAI HUNG
Browse files

Avoid drawing the invalid levels in the chart view

Bug: 183921876
Test: make SettingsRoboTests
Test: make SettingsGoogleRoboTests
Change-Id: Id540f35044beabe4d56ab5ce3af63271ac356f49
parent 9b226a4f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -227,6 +227,10 @@ public class BatteryChartView extends AppCompatImageView implements View.OnClick
        // Draws all trapezoid shapes into the canvas.
        final Path trapezoidPath = new Path();
        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.
            mTrapezoidPaint.setColor(
                mSelectedIndex == index || mSelectedIndex == SELECTED_INDEX_ALL