Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
A
appzxhy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
appzxhy
Commits
9f8b9c06
Commit
9f8b9c06
authored
Jun 12, 2025
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[拆包]修改电池信息界面
parent
8334eeb2
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
41 additions
and
33 deletions
+41
-33
BatteryInfoActivity.kt
...va/com/base/appzxhy/ui/batteryinfo/BatteryInfoActivity.kt
+7
-10
icon_back.png
app/src/main/res/drawable-xxhdpi/icon_back.png
+0
-0
icon_good.png
app/src/main/res/drawable-xxhdpi/icon_good.png
+0
-0
icon_li.png
app/src/main/res/drawable-xxhdpi/icon_li.png
+0
-0
icon_mah.png
app/src/main/res/drawable-xxhdpi/icon_mah.png
+0
-0
icon_mv.png
app/src/main/res/drawable-xxhdpi/icon_mv.png
+0
-0
bg_f7f8fc_10.xml
app/src/main/res/drawable/bg_f7f8fc_10.xml
+7
-0
activity_battery_info_2.xml
app/src/main/res/layout/activity_battery_info_2.xml
+6
-7
item_battery_electric.xml
app/src/main/res/layout/item_battery_electric.xml
+1
-1
item_battery_head.xml
app/src/main/res/layout/item_battery_head.xml
+1
-0
item_battery_info.xml
app/src/main/res/layout/item_battery_info.xml
+17
-15
dimens.xml
app/src/main/res/values/dimens.xml
+2
-0
No files found.
app/src/main/java/com/base/appzxhy/ui/batteryinfo/BatteryInfoActivity.kt
View file @
9f8b9c06
...
@@ -26,10 +26,10 @@ class BatteryInfoActivity : BaseActivity<ActivityBatteryInfo2Binding>(ActivityBa
...
@@ -26,10 +26,10 @@ class BatteryInfoActivity : BaseActivity<ActivityBatteryInfo2Binding>(ActivityBa
private
val
adAdapter
=
AdAdapter
(
R
.
layout
.
item_ad
)
private
val
adAdapter
=
AdAdapter
(
R
.
layout
.
item_ad
)
private
val
batteryInfoList
=
listOf
(
private
val
batteryInfoList
=
listOf
(
BatteryInfoBean
(
R
.
drawable
.
icon_
current_average
,
"37.5℃"
,
"Temperature
"
),
BatteryInfoBean
(
R
.
drawable
.
icon_
good
,
"GOOD"
,
"Battery Health
"
),
BatteryInfoBean
(
R
.
drawable
.
icon_
voltage
,
"3.6V"
,
"Voltage
"
),
BatteryInfoBean
(
R
.
drawable
.
icon_
mah
,
"0 mAh / 0 mAh"
,
"Battery Capacity
"
),
BatteryInfoBean
(
R
.
drawable
.
icon_
technology
,
"Li-Poly"
,
"Technology
"
),
BatteryInfoBean
(
R
.
drawable
.
icon_
li
,
"Li-ion"
,
"Battery Type
"
),
BatteryInfoBean
(
R
.
drawable
.
icon_
battery
,
"0mAh"
,
"Battery Capacity
"
),
BatteryInfoBean
(
R
.
drawable
.
icon_
mv
,
"3818 mV"
,
"Voltage
"
),
// BatteryInfoBean(R.drawable.icon_electric_current, "NA", "Electric Current"),
// BatteryInfoBean(R.drawable.icon_electric_current, "NA", "Electric Current"),
// BatteryInfoBean(R.drawable.icon_current_average, "NA", "Current Average"),
// BatteryInfoBean(R.drawable.icon_current_average, "NA", "Current Average"),
)
)
...
@@ -138,13 +138,10 @@ class BatteryInfoActivity : BaseActivity<ActivityBatteryInfo2Binding>(ActivityBa
...
@@ -138,13 +138,10 @@ class BatteryInfoActivity : BaseActivity<ActivityBatteryInfo2Binding>(ActivityBa
)
)
val
temperature
=
Utils
.
divide
(
BatteryReceiver
.
temperature
,
10
)
batteryInfoList
[
1
].
tvValue
=
"${remainingCapacity.toInt()} / ${BatteryReceiver.mAh.toInt()} mAh"
batteryInfoList
[
0
].
tvValue
=
"$temperature℃"
val
voltage
=
Utils
.
divide
(
BatteryReceiver
.
voltage
,
1000
)
val
voltage
=
Utils
.
divide
(
BatteryReceiver
.
voltage
,
1
)
batteryInfoList
[
1
].
tvValue
=
"${voltage}V"
batteryInfoList
[
3
].
tvValue
=
"$voltage mV"
batteryInfoList
[
3
].
tvValue
=
"${(BatteryReceiver.mAh * percent).toInt()}mAh"
batteryInfoAdapter
.
submitList
(
listOf
(
batteryInfoList
))
batteryInfoAdapter
.
submitList
(
listOf
(
batteryInfoList
))
...
...
app/src/main/res/drawable-xxhdpi/icon_back.png
0 → 100644
View file @
9f8b9c06
1.18 KB
app/src/main/res/drawable-xxhdpi/icon_good.png
0 → 100644
View file @
9f8b9c06
3.56 KB
app/src/main/res/drawable-xxhdpi/icon_li.png
0 → 100644
View file @
9f8b9c06
2.86 KB
app/src/main/res/drawable-xxhdpi/icon_mah.png
0 → 100644
View file @
9f8b9c06
1.73 KB
app/src/main/res/drawable-xxhdpi/icon_mv.png
0 → 100644
View file @
9f8b9c06
2.65 KB
app/src/main/res/drawable/bg_f7f8fc_10.xml
0 → 100644
View file @
9f8b9c06
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#F7F8FC"
/>
<corners
android:radius=
"@dimen/dp_10"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/activity_battery_info_2.xml
View file @
9f8b9c06
...
@@ -17,19 +17,18 @@
...
@@ -17,19 +17,18 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:padding=
"@dimen/dp_16"
android:padding=
"@dimen/dp_16"
android:src=
"@drawable/icon_
return_b
"
/>
android:src=
"@drawable/icon_
back
"
/>
<androidx.appcompat.widget.AppCompatTextView
<androidx.appcompat.widget.AppCompatTextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_gravity=
"center_vertical"
android:layout_marginStart=
"@dimen/dp_66"
android:text=
"@string/battery_info"
android:text=
"@string/battery_info"
android:textColor=
"@color/black"
android:textColor=
"@color/black"
android:textSize=
"20sp"
android:textSize=
"20sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"@id/fl_back"
android:textStyle=
"bold"
/>
app:layout_constraintStart_toEndOf=
"@id/fl_back"
app:layout_constraintTop_toTopOf=
"@id/fl_back"
/>
</FrameLayout>
</FrameLayout>
...
@@ -44,7 +43,6 @@
...
@@ -44,7 +43,6 @@
</androidx.recyclerview.widget.RecyclerView>
</androidx.recyclerview.widget.RecyclerView>
<TextView
<TextView
android:visibility=
"invisible"
android:id=
"@+id/tvBtn"
android:id=
"@+id/tvBtn"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_45"
android:layout_height=
"@dimen/dp_45"
...
@@ -57,6 +55,7 @@
...
@@ -57,6 +55,7 @@
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"@dimen/sp_17"
android:textSize=
"@dimen/sp_17"
android:textStyle=
"bold"
android:textStyle=
"bold"
android:visibility=
"invisible"
app:layout_constraintBottom_toBottomOf=
"parent"
/>
app:layout_constraintBottom_toBottomOf=
"parent"
/>
<include
<include
...
...
app/src/main/res/layout/item_battery_electric.xml
View file @
9f8b9c06
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"@dimen/dp_16"
android:layout_marginHorizontal=
"@dimen/dp_16"
android:layout_marginTop=
"@dimen/dp_
16
"
>
android:layout_marginTop=
"@dimen/dp_
40
"
>
<TextView
<TextView
android:id=
"@+id/tv"
android:id=
"@+id/tv"
...
...
app/src/main/res/layout/item_battery_head.xml
View file @
9f8b9c06
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
android:layout_height=
"@dimen/dp_98"
android:layout_height=
"@dimen/dp_98"
android:layout_marginHorizontal=
"@dimen/dp_16"
android:layout_marginHorizontal=
"@dimen/dp_16"
android:layout_marginTop=
"@dimen/dp_16"
android:layout_marginTop=
"@dimen/dp_16"
android:layout_marginBottom=
"@dimen/dp_20"
app:cardBackgroundColor=
"#F0FFFA"
app:cardBackgroundColor=
"#F0FFFA"
app:cardCornerRadius=
"@dimen/dp_10"
>
app:cardCornerRadius=
"@dimen/dp_10"
>
...
...
app/src/main/res/layout/item_battery_info.xml
View file @
9f8b9c06
...
@@ -3,41 +3,43 @@
...
@@ -3,41 +3,43 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tool=
"http://schemas.android.com/tools"
xmlns:tool=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_
90
"
android:layout_height=
"@dimen/dp_
112
"
android:layout_marginHorizontal=
"@dimen/dp_
8
"
android:layout_marginHorizontal=
"@dimen/dp_
4
"
android:layout_marginVertical=
"@dimen/dp_5"
android:layout_marginVertical=
"@dimen/dp_5"
android:background=
"@drawable/bg_ffffff_8"
android:background=
"@drawable/bg_f7f8fc_10"
android:gravity=
"center_vertical"
android:orientation=
"vertical"
>
android:orientation=
"horizontal"
>
<androidx.appcompat.widget.AppCompatImageView
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/iv"
android:id=
"@+id/iv"
android:layout_width=
"@dimen/dp_45"
android:layout_width=
"@dimen/dp_30"
android:layout_height=
"@dimen/dp_45"
android:layout_height=
"@dimen/dp_30"
android:layout_marginStart=
"@dimen/dp_15"
/>
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"@dimen/dp_20"
/>
<LinearLayout
<LinearLayout
android:layout_width=
"
0dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginHorizontal=
"@dimen/dp_8"
android:layout_marginHorizontal=
"@dimen/dp_8"
android:layout_weight=
"1"
android:layout_marginStart=
"@dimen/dp_20"
android:layout_marginTop=
"@dimen/dp_4"
android:layout_marginEnd=
"@dimen/dp_12"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<TextView
<TextView
android:id=
"@+id/tvValue"
android:id=
"@+id/tvValue"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"
@color/color_1a1a1a
"
android:textColor=
"
#262626
"
android:textSize=
"@dimen/sp_1
8
"
android:textSize=
"@dimen/sp_1
6
"
tool:text=
"
3.6v
"
/>
tool:text=
"
GOOD
"
/>
<TextView
<TextView
android:id=
"@+id/tvTitle"
android:id=
"@+id/tvTitle"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_4"
android:layout_marginTop=
"@dimen/dp_4"
android:textColor=
"
@color/color_666666
"
android:textColor=
"
#A0A0A0
"
android:textSize=
"@dimen/sp_1
2
"
android:textSize=
"@dimen/sp_1
4
"
tool:text=
"Voltage"
/>
tool:text=
"Voltage"
/>
</LinearLayout>
</LinearLayout>
...
...
app/src/main/res/values/dimens.xml
View file @
9f8b9c06
...
@@ -56,4 +56,6 @@
...
@@ -56,4 +56,6 @@
<dimen
name=
"dp_1"
>
1dp
</dimen>
<dimen
name=
"dp_1"
>
1dp
</dimen>
<dimen
name=
"sp_22"
>
22sp
</dimen>
<dimen
name=
"sp_22"
>
22sp
</dimen>
<dimen
name=
"sp_11"
>
11sp
</dimen>
<dimen
name=
"sp_11"
>
11sp
</dimen>
<dimen
name=
"dp_112"
>
112dp
</dimen>
<dimen
name=
"dp_66"
>
66dp
</dimen>
</resources>
</resources>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment