A few tweaks to the battery history chart.
Change-Id: Id133267592acf7a979a625704d2d922a24f5ff41
This commit is contained in:
@@ -368,9 +368,9 @@ public class BatteryHistoryChart extends View {
|
|||||||
}
|
}
|
||||||
if (rec.batteryLevel != lastLevel || pos == 1) {
|
if (rec.batteryLevel != lastLevel || pos == 1) {
|
||||||
lastLevel = rec.batteryLevel;
|
lastLevel = rec.batteryLevel;
|
||||||
|
}
|
||||||
lastInteresting = pos;
|
lastInteresting = pos;
|
||||||
mHistEnd = rec.time;
|
mHistEnd = rec.time;
|
||||||
}
|
|
||||||
aggrStates |= rec.states;
|
aggrStates |= rec.states;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -438,7 +438,13 @@ public class BatteryHistoryChart extends View {
|
|||||||
2, getResources().getDisplayMetrics());
|
2, getResources().getDisplayMetrics());
|
||||||
if (h > (textHeight*6)) {
|
if (h > (textHeight*6)) {
|
||||||
mLargeMode = true;
|
mLargeMode = true;
|
||||||
|
if (h > (textHeight*15)) {
|
||||||
|
// Plenty of room for the chart.
|
||||||
mLineWidth = textHeight/2;
|
mLineWidth = textHeight/2;
|
||||||
|
} else {
|
||||||
|
// Compress lines to make more room for chart.
|
||||||
|
mLineWidth = textHeight/3;
|
||||||
|
}
|
||||||
mLevelTop = textHeight + mLineWidth;
|
mLevelTop = textHeight + mLineWidth;
|
||||||
mScreenOnPaint.setARGB(255, 32, 64, 255);
|
mScreenOnPaint.setARGB(255, 32, 64, 255);
|
||||||
mGpsOnPaint.setARGB(255, 32, 64, 255);
|
mGpsOnPaint.setARGB(255, 32, 64, 255);
|
||||||
@@ -472,7 +478,8 @@ public class BatteryHistoryChart extends View {
|
|||||||
mWifiRunningOffset = mWakeLockOffset + barOffset;
|
mWifiRunningOffset = mWakeLockOffset + barOffset;
|
||||||
mGpsOnOffset = mWifiRunningOffset + (mHaveWifi ? barOffset : 0);
|
mGpsOnOffset = mWifiRunningOffset + (mHaveWifi ? barOffset : 0);
|
||||||
mPhoneSignalOffset = mGpsOnOffset + (mHaveGps ? barOffset : 0);
|
mPhoneSignalOffset = mGpsOnOffset + (mHaveGps ? barOffset : 0);
|
||||||
mLevelOffset = mPhoneSignalOffset + (mHavePhoneSignal ? barOffset : 0) + mLineWidth;
|
mLevelOffset = mPhoneSignalOffset + (mHavePhoneSignal ? barOffset : 0)
|
||||||
|
+ ((mLineWidth*3)/2);
|
||||||
if (mHavePhoneSignal) {
|
if (mHavePhoneSignal) {
|
||||||
mPhoneSignalChart.init(w);
|
mPhoneSignalChart.init(w);
|
||||||
}
|
}
|
||||||
@@ -670,8 +677,8 @@ public class BatteryHistoryChart extends View {
|
|||||||
if (!mBatCriticalPath.isEmpty()) {
|
if (!mBatCriticalPath.isEmpty()) {
|
||||||
canvas.drawPath(mBatCriticalPath, mBatteryCriticalPaint);
|
canvas.drawPath(mBatCriticalPath, mBatteryCriticalPaint);
|
||||||
}
|
}
|
||||||
int top = height - (mHavePhoneSignal ? mPhoneSignalOffset - (mLineWidth/2) : 0);
|
|
||||||
if (mHavePhoneSignal) {
|
if (mHavePhoneSignal) {
|
||||||
|
int top = height-mPhoneSignalOffset - (mLineWidth/2);
|
||||||
mPhoneSignalChart.draw(canvas, top, mLineWidth);
|
mPhoneSignalChart.draw(canvas, top, mLineWidth);
|
||||||
}
|
}
|
||||||
if (!mScreenOnPath.isEmpty()) {
|
if (!mScreenOnPath.isEmpty()) {
|
||||||
|
Reference in New Issue
Block a user