通知cash、调整
This commit is contained in:
parent
255f5223e8
commit
ec8d7f9da0
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_gravity="center">
|
||||
<ImageView
|
||||
<!--<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/icon_cash_most"
|
||||
|
|
@ -79,7 +79,7 @@
|
|||
android:scaleType="center"
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
/>
|
||||
/>-->
|
||||
<TextView
|
||||
android:id="@+id/tv_resident_cash"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
|||
Loading…
Reference in New Issue