添加BatteryStyleView控件,添加能量与斑马绘图风格。

This commit is contained in:
2025-12-27 21:12:54 +08:00
parent fca17908b2
commit abd956d7d0
8 changed files with 356 additions and 36 deletions

View File

@@ -1,3 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- BatteryStyleView 自定义属性 -->
<declare-styleable name="BatteryStyleView">
<attr name="batteryPreviewColor" format="color"/>
<attr name="previewBatteryValue" format="integer"/>
<attr name="defaultSelectedStyle" format="integer">
<enum name="zebra_style" value="0"/>
<enum name="energy_style" value="1"/>
</attr>
</declare-styleable>
<!-- 字符串资源可放到strings.xml -->
<string name="zebra_style">Zebra Style</string>
<string name="energy_style">Energy Style</string>
</resources>