[1.0.11] fix(watch):

- WatchItemFragment: 增加对 latest/max/min 为 0 的判断
- 空值或零值统一显示 "--分钟",修复之前错误显示时间转换结果的问题
- 更新首页头部图标资源 icon_home_head.png
This commit is contained in:
zhanglei
2026-03-06 16:40:22 +08:00
parent 9c91839520
commit e2d53f851d
4 changed files with 9 additions and 9 deletions
@@ -129,23 +129,23 @@ class WatchItemFragment :
mBinding.watchLeftValue.text = "--"
mBinding.watchRightValue.text = "--"
} else {
if (TextUtils.isEmpty(bean.latest)) {
mBinding.watchValue.text = "--"
if (TextUtils.isEmpty(bean.latest)||bean.latest.floatToInt()==0) {
mBinding.watchValue.text = "--分钟"
} else {
mBinding.watchValue.text =
DateUtil.timeDiff(bean.latest!!.floatToInt().toLong() * 1000 * 60)
.orEmptyDefault()
}
if (TextUtils.isEmpty(bean.max)) {
mBinding.watchLeftValue.text = "--"
if (TextUtils.isEmpty(bean.max)||bean.max.floatToInt()==0) {
mBinding.watchLeftValue.text = "--分钟"
} else {
mBinding.watchLeftValue.text =
DateUtil.timeDiff(bean.max!!.floatToInt().toLong() * 1000 * 60)
.orEmptyDefault()
}
if (TextUtils.isEmpty(bean.min)) {
mBinding.watchRightValue.text = "--"
if (TextUtils.isEmpty(bean.min)||bean.min.floatToInt()==0) {
mBinding.watchRightValue.text = "--分钟"
} else {
mBinding.watchRightValue.text =
DateUtil.timeDiff(bean.min!!.floatToInt().toLong() * 1000 * 60)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 86 KiB

+1 -1
View File
@@ -84,7 +84,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginTop="10dp"
android:layout_marginTop="6dp"
android:ellipsize="end"
android:textColor="@color/white"
android:textSize="12sp"