Commit 702402d3 authored by wanglei's avatar wanglei

...

parent 52d7c8fc
Pipeline #1386 canceled with stages
...@@ -17,6 +17,10 @@ import androidx.core.app.NotificationManagerCompat ...@@ -17,6 +17,10 @@ import androidx.core.app.NotificationManagerCompat
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import com.swiftcleaner.chovey.R import com.swiftcleaner.chovey.R
import com.swiftcleaner.chovey.model.bean.Global import com.swiftcleaner.chovey.model.bean.Global
import com.swiftcleaner.chovey.model.bean.Global.FUNCTION_APP_MANAGER
import com.swiftcleaner.chovey.model.bean.Global.FUNCTION_BATTERY
import com.swiftcleaner.chovey.model.bean.Global.FUNCTION_CLEAN
import com.swiftcleaner.chovey.model.bean.Global.FUNCTION_LARGE_FILE
import com.swiftcleaner.chovey.model.bean.Global.NotificationStayCount import com.swiftcleaner.chovey.model.bean.Global.NotificationStayCount
import com.swiftcleaner.chovey.model.bean.Global.NotificationStayDelay import com.swiftcleaner.chovey.model.bean.Global.NotificationStayDelay
import com.swiftcleaner.chovey.model.bean.Global.NotificationStayStatus import com.swiftcleaner.chovey.model.bean.Global.NotificationStayStatus
...@@ -31,20 +35,12 @@ import com.zxdemo.utils.SpUtils ...@@ -31,20 +35,12 @@ import com.zxdemo.utils.SpUtils
import java.util.Random import java.util.Random
object NotificationUtils { object NotificationUtils {
val ID_CLEAN_JUNK = 0
val ID_APP_MANAGER = 1
val ID_WHATSAPP = 2
val ID_LARGE_FILE = 3
val ID_SCREENTSHOT = 4
val ID_BATTERY_LOW = 5
private val NOTIFICATION_IDS = intArrayOf( private val NOTIFICATION_IDS = arrayOf(
ID_CLEAN_JUNK, FUNCTION_CLEAN,
ID_APP_MANAGER, FUNCTION_APP_MANAGER,
ID_WHATSAPP, FUNCTION_BATTERY,
ID_LARGE_FILE, FUNCTION_LARGE_FILE,
ID_SCREENTSHOT,
ID_BATTERY_LOW,
) )
...@@ -142,7 +138,7 @@ object NotificationUtils { ...@@ -142,7 +138,7 @@ object NotificationUtils {
val smallRemoteViews = RemoteViews(context.packageName, R.layout.notification_common_small) val smallRemoteViews = RemoteViews(context.packageName, R.layout.notification_common_small)
var intentAction = "" var intentAction = ""
when (actionId) { when (actionId) {
ID_CLEAN_JUNK -> { FUNCTION_CLEAN -> {
bigRemoteViews.setImageViewResource(R.id.iv_icon, R.mipmap.h_clean) bigRemoteViews.setImageViewResource(R.id.iv_icon, R.mipmap.h_clean)
smallRemoteViews.setImageViewResource(R.id.iv_icon, R.mipmap.h_clean) smallRemoteViews.setImageViewResource(R.id.iv_icon, R.mipmap.h_clean)
...@@ -153,19 +149,8 @@ object NotificationUtils { ...@@ -153,19 +149,8 @@ object NotificationUtils {
} }
ID_APP_MANAGER -> { FUNCTION_APP_MANAGER -> {
}
ID_WHATSAPP -> {
}
ID_LARGE_FILE -> {
}
ID_SCREENTSHOT -> {
}
ID_BATTERY_LOW -> {
} }
else -> { else -> {
...@@ -230,7 +215,7 @@ object NotificationUtils { ...@@ -230,7 +215,7 @@ object NotificationUtils {
private var currentNotificationIdIndex = -1 private var currentNotificationIdIndex = -1
val nextNotificationId: Int val nextNotificationId: String
get() { get() {
// 将当前通知 ID 索引加 1 // 将当前通知 ID 索引加 1
currentNotificationIdIndex++ currentNotificationIdIndex++
......
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