Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
F
File Recovery RecycleBin
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
File Recovery RecycleBin
Commits
81d8b0d7
Commit
81d8b0d7
authored
Jul 30, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
283852b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
BatteryActivity.kt
...ilerecoveryrecyclebin/activity/battery/BatteryActivity.kt
+8
-1
No files found.
app/src/main/java/com/base/filerecoveryrecyclebin/activity/battery/BatteryActivity.kt
View file @
81d8b0d7
...
...
@@ -21,6 +21,7 @@ import kotlinx.coroutines.isActive
import
kotlinx.coroutines.launch
import
java.io.BufferedReader
import
java.io.FileReader
import
kotlin.math.abs
class
BatteryActivity
:
BaseActivity
<
ActivityBatteryBinding
>()
{
...
...
@@ -74,13 +75,19 @@ class BatteryActivity : BaseActivity<ActivityBatteryBinding>() {
binding
.
tvTechnology
.
text
=
BatteryReceiver
.
technology
binding
.
tvCapacity
.
text
=
"${BatteryReceiver.mAh.toInt()} mAh"
val
capacity
=
BatteryReceiver
.
mAh
.
toInt
()
binding
.
tvCapacity
.
text
=
"$capacity mAh"
val
currentNow
=
mBatteryManager
.
getIntProperty
(
BatteryManager
.
BATTERY_PROPERTY_CURRENT_NOW
)
binding
.
tvElectric
.
text
=
"${currentNow * 100} mA"
val
currentAverage
:
Int
=
mBatteryManager
.
getIntProperty
(
BatteryManager
.
BATTERY_PROPERTY_CURRENT_AVERAGE
)
binding
.
tvCurrentAverage
.
text
=
"${currentAverage * 100} mA"
val
hm
=
(
capacity
.
toFloat
()
/
(
currentNow
*
100f
))
binding
.
tvH
.
text
=
abs
(
hm
.
toInt
()).
toString
()
binding
.
tvM
.
text
=
abs
(((
hm
-
hm
.
toInt
())
*
60
).
toInt
()).
toString
()
}
fun
format
(
float
:
Float
):
String
{
...
...
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