能量风格绘图方法切换回老式算法,修复能量条间隔缝隙问题。
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Sun Dec 28 13:16:31 HKT 2025
|
||||
#Sun Dec 28 05:50:24 GMT 2025
|
||||
stageCount=39
|
||||
libraryProject=
|
||||
baseVersion=15.14
|
||||
publishVersion=15.14.38
|
||||
buildCount=0
|
||||
buildCount=1
|
||||
baseBetaVersion=15.14.39
|
||||
|
||||
@@ -121,9 +121,25 @@ public class BatteryDrawable extends Drawable {
|
||||
*/
|
||||
private void drawEnergyStyle(Canvas canvas, int battery, int left, int right, int height) {
|
||||
LogUtils.d(TAG, "【drawEnergyStyle】能量风格绘制开始 | 电量=" + battery);
|
||||
int top = height - (height * battery / BATTERY_MAX); // 计算电量对应顶部坐标
|
||||
canvas.drawRect(new Rect(left, top, right, height), mBatteryPaint);
|
||||
LogUtils.d(TAG, "【drawEnergyStyle】能量风格绘制完成 | 顶部坐标=" + top);
|
||||
// int top = height - (height * battery / BATTERY_MAX); // 计算电量对应顶部坐标
|
||||
// canvas.drawRect(new Rect(left, top, right, height), mBatteryPaint);
|
||||
// LogUtils.d(TAG, "【drawEnergyStyle】能量风格绘制完成 | 顶部坐标=" + top);
|
||||
int nWidth = getBounds().width();
|
||||
int nHeight = getBounds().height();
|
||||
int mnDx = nHeight / 203;
|
||||
|
||||
// 绘制耗电电量提醒值电量
|
||||
// 能量绘图风格
|
||||
int nTop;
|
||||
int nLeft = 0;
|
||||
int nBottom;
|
||||
int nRight = nWidth;
|
||||
|
||||
//for (int i = 0; i < mnValue; i ++) {
|
||||
nBottom = nHeight;
|
||||
nTop = nHeight - (nHeight * mBatteryValue / 100);
|
||||
canvas.drawRect(new Rect(nLeft, nTop, nRight, nBottom), mBatteryPaint);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user