Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
Widget
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Android Widget
Widget
Commits
28f5caf5
Commit
28f5caf5
authored
Jul 05, 2022
by
tongzifang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
单位小写
parent
c574501b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
ZqToolActivity.kt
app/src/main/java/com/qimai/android/widget/ZqToolActivity.kt
+2
-2
LivingWeight.kt
zqtoolkit/src/main/java/com/qmai/zqtoolkit/LivingWeight.kt
+1
-1
ScaleBaseKit.kt
...c/main/java/com/qmai/zqtoolkit/base/scale/ScaleBaseKit.kt
+3
-0
No files found.
app/src/main/java/com/qimai/android/widget/ZqToolActivity.kt
View file @
28f5caf5
...
@@ -193,12 +193,12 @@ class ZqToolActivity : AppCompatActivity() {
...
@@ -193,12 +193,12 @@ class ZqToolActivity : AppCompatActivity() {
tvState
?.
text
=
"稳定"
tvState
?.
text
=
"稳定"
tvState
?.
setBackgroundColor
(
Color
.
GREEN
)
tvState
?.
setBackgroundColor
(
Color
.
GREEN
)
tvLivingWeight
?.
text
=
tvLivingWeight
?.
text
=
"实时重量"
+
it
.
weight
+
"time:"
+
System
.
currentTimeMillis
()
"实时重量"
+
it
.
weight
+
" 单位"
+
it
.
unit
+
"time:"
+
System
.
currentTimeMillis
()
}
else
{
}
else
{
tvState
?.
setBackgroundColor
(
Color
.
RED
)
tvState
?.
setBackgroundColor
(
Color
.
RED
)
tvState
?.
text
=
"不稳定"
tvState
?.
text
=
"不稳定"
tvLivingWeight
?.
text
=
tvLivingWeight
?.
text
=
"实时重量"
+
it
.
weight
+
"time:"
+
System
.
currentTimeMillis
()
"实时重量"
+
it
.
weight
+
" 单位"
+
it
.
unit
+
"time:"
+
System
.
currentTimeMillis
()
}
}
}
}
}
}
...
...
zqtoolkit/src/main/java/com/qmai/zqtoolkit/LivingWeight.kt
View file @
28f5caf5
...
@@ -8,7 +8,7 @@ package com.qmai.zqtoolkit
...
@@ -8,7 +8,7 @@ package com.qmai.zqtoolkit
data class
LivingWeight
(
data class
LivingWeight
(
val
isStable
:
Boolean
,
val
isStable
:
Boolean
,
val
weight
:
String
,
val
weight
:
String
,
va
l
unit
:
String
,
va
r
unit
:
String
,
val
tare
:
String
,
val
tare
:
String
,
val
isReadErr
:
Boolean
val
isReadErr
:
Boolean
)
)
zqtoolkit/src/main/java/com/qmai/zqtoolkit/base/scale/ScaleBaseKit.kt
View file @
28f5caf5
...
@@ -62,6 +62,9 @@ abstract class ScaleBaseKit : ScaleBaseAction, ScaleUpdateAction {
...
@@ -62,6 +62,9 @@ abstract class ScaleBaseKit : ScaleBaseAction, ScaleUpdateAction {
when
{
when
{
stableWeight
.
size
==
STABLE_COUNT
->
{
stableWeight
.
size
==
STABLE_COUNT
->
{
if
(
stableWeight
.
toSet
().
size
==
1
)
{
if
(
stableWeight
.
toSet
().
size
==
1
)
{
//给业务的unit要小写
if
(
weight
.
unit
.
isNotEmpty
())
weight
.
unit
=
weight
.
unit
.
lowercase
()
_livingWeight
.
emit
(
weight
)
_livingWeight
.
emit
(
weight
)
}
}
stableWeight
.
clear
()
stableWeight
.
clear
()
...
...
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