Avoid drawing the invalid levels in the chart view
Bug: 183921876 Test: make SettingsRoboTests Test: make SettingsGoogleRoboTests Change-Id: Id540f35044beabe4d56ab5ce3af63271ac356f49
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