Commit 8e8a159f authored by leichao.gao's avatar leichao.gao

默认样式

parent f0f68226
...@@ -247,17 +247,18 @@ object NotificationUiUtil { ...@@ -247,17 +247,18 @@ object NotificationUiUtil {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
small = smallRemoteViews small = smallRemoteViews
} }
builder.setContent(small) // 设置小视图
builder.setCustomHeadsUpContentView(small) builder.setCustomContentView(smallRemoteViews)
builder.setCustomContentView(small)
// 设置悬浮通知视图(Android 12 及以上)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
builder.setCustomHeadsUpContentView(bigRemoteViews)
}
// 设置大视图
builder.setCustomBigContentView(bigRemoteViews) builder.setCustomBigContentView(bigRemoteViews)
// Show the notification
// if (AppPreferences.getInstance().getString("actionS", "1").toInt() == 1) {
// notificationManager.notify(intent.getIntExtra("actionId", actionId), builder.build())
// } else {
// notificationManager.notify(actionId, builder.build())
// }
notificationManager.notify(actionId, builder.build()) notificationManager.notify(actionId, builder.build())
AppPreferences.getInstance().put("last_notification_time", System.currentTimeMillis()) AppPreferences.getInstance().put("last_notification_time", System.currentTimeMillis())
if (actionId == ID_JUNK_CLEANER) { if (actionId == ID_JUNK_CLEANER) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment