From ec8d7f9da0516d75447886fc0b1a357ce4e32175 Mon Sep 17 00:00:00 2001
From: renhaoting <370797079@qq.com>
Date: Fri, 9 Jan 2026 13:43:53 +0800
Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5cash=E3=80=81=E8=B0=83?=
=?UTF-8?q?=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../remax/notification/builder/NotificationDataFactory.kt | 8 +++++++-
.../main/res/layout/layout_notification_resident_12.xml | 4 ++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/notification/src/main/java/com/remax/notification/builder/NotificationDataFactory.kt b/notification/src/main/java/com/remax/notification/builder/NotificationDataFactory.kt
index 7173a7c..c4a5c2f 100644
--- a/notification/src/main/java/com/remax/notification/builder/NotificationDataFactory.kt
+++ b/notification/src/main/java/com/remax/notification/builder/NotificationDataFactory.kt
@@ -366,13 +366,15 @@ class FixTimeModelManager() {
class ResidentModelManger {
fun getModel(context: Context): GeneralNotificationData {
+ val cashNum = NotificationDatas.getResidentDatas().getCashNumber()
+ var cashStr = if (hasDecimalPart(cashNum)) String.format("%.2f", cashNum) else cashNum.toString()
val contentView = NotificationRemoteViewsBuilder(
context.packageName,
R.layout.layout_notification_resident_12,
R.layout.layout_notification_resident
).setTextViewText(R.id.tv_resident_gold, NotificationDatas.getResidentDatas().getGoldNumber().toString())
- .setTextViewText(R.id.tv_resident_cash, String.format("%.2f", NotificationDatas.getResidentDatas().getCashNumber()))
+ .setTextViewText(R.id.tv_resident_cash, "R$" + cashStr)
.setTextViewText(R.id.tv_resident_box, NotificationDatas.getResidentDatas().getBoxRestTimeStr())
.setOnClickPendingIntent(
R.id.resident_gold, entryPointPendingIntent(context,
@@ -414,4 +416,8 @@ class ResidentModelManger {
bigContentView = null
)
}
+
+ fun hasDecimalPart(number: Double): Boolean {
+ return Math.abs(number % 1) > 1e-10
+ }
}
diff --git a/notification/src/main/res/layout/layout_notification_resident_12.xml b/notification/src/main/res/layout/layout_notification_resident_12.xml
index 3ac7eb7..3841dc0 100644
--- a/notification/src/main/res/layout/layout_notification_resident_12.xml
+++ b/notification/src/main/res/layout/layout_notification_resident_12.xml
@@ -71,7 +71,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_gravity="center">
-
+ />-->