Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
swiftcleanerphonehelper
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
swiftcleanerphonehelper
Commits
184cfae3
Commit
184cfae3
authored
Feb 10, 2025
by
周文华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【新增】新增病毒扫描推送条目及文案显示逻辑(此条更新会报错很正常,因为暂时没有病毒扫描推送的icon,只需要替换就可以了)
parent
82bd616f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
GlobalConfig.kt
app/src/main/java/com/swiftcleaner/chovey/GlobalConfig.kt
+1
-0
NotificationUtils.kt
...om/swiftcleaner/chovey/business/push/NotificationUtils.kt
+17
-2
No files found.
app/src/main/java/com/swiftcleaner/chovey/GlobalConfig.kt
View file @
184cfae3
...
@@ -110,6 +110,7 @@ object GlobalConfig {
...
@@ -110,6 +110,7 @@ object GlobalConfig {
const
val
ID_APP_PROCESS
=
12100
const
val
ID_APP_PROCESS
=
12100
const
val
ID_WHEATHER
=
12087
const
val
ID_WHEATHER
=
12087
const
val
ID_XINGZUO
=
12088
const
val
ID_XINGZUO
=
12088
const
val
ID_MALWARE_CLEAN
=
12089
val
noLoadingActivities
=
listOf
(
val
noLoadingActivities
=
listOf
(
"full"
,
// 过滤全屏广告
"full"
,
// 过滤全屏广告
...
...
app/src/main/java/com/swiftcleaner/chovey/business/push/NotificationUtils.kt
View file @
184cfae3
...
@@ -18,6 +18,7 @@ import com.swiftcleaner.chovey.GlobalConfig.ID_APP_PROCESS
...
@@ -18,6 +18,7 @@ import com.swiftcleaner.chovey.GlobalConfig.ID_APP_PROCESS
import
com.swiftcleaner.chovey.GlobalConfig.ID_BATTERY_INFO
import
com.swiftcleaner.chovey.GlobalConfig.ID_BATTERY_INFO
import
com.swiftcleaner.chovey.GlobalConfig.ID_CLEAN_JUNK
import
com.swiftcleaner.chovey.GlobalConfig.ID_CLEAN_JUNK
import
com.swiftcleaner.chovey.GlobalConfig.ID_LARGE_FILE_CLEANER
import
com.swiftcleaner.chovey.GlobalConfig.ID_LARGE_FILE_CLEANER
import
com.swiftcleaner.chovey.GlobalConfig.ID_MALWARE_CLEAN
import
com.swiftcleaner.chovey.GlobalConfig.ID_SCREENSHOT_CLEAN
import
com.swiftcleaner.chovey.GlobalConfig.ID_SCREENSHOT_CLEAN
import
com.swiftcleaner.chovey.GlobalConfig.ID_SIMILAR_PHOTOS
import
com.swiftcleaner.chovey.GlobalConfig.ID_SIMILAR_PHOTOS
...
@@ -53,7 +54,8 @@ object NotificationUtils {
...
@@ -53,7 +54,8 @@ object NotificationUtils {
ID_APP_PROCESS
,
ID_APP_PROCESS
,
ID_SCREENSHOT_CLEAN
,
ID_SCREENSHOT_CLEAN
,
ID_XINGZUO
,
ID_XINGZUO
,
ID_WHEATHER
ID_WHEATHER
,
ID_MALWARE_CLEAN
)
)
private
var
currentNotificationId
=
-
1
private
var
currentNotificationId
=
-
1
...
@@ -254,7 +256,16 @@ object NotificationUtils {
...
@@ -254,7 +256,16 @@ object NotificationUtils {
ID_APP_PROCESS
->
Pair
(
R
.
mipmap
.
jg__appprocss
,
R
.
string
.
notification_app_process
)
ID_APP_PROCESS
->
Pair
(
R
.
mipmap
.
jg__appprocss
,
R
.
string
.
notification_app_process
)
ID_SIMILAR_PHOTOS
->
Pair
(
R
.
mipmap
.
h_simiar
,
R
.
string
.
notification_similar_photos
)
ID_SIMILAR_PHOTOS
->
Pair
(
R
.
mipmap
.
h_simiar
,
R
.
string
.
notification_similar_photos
)
ID_SCREENSHOT_CLEAN
->
Pair
(
R
.
mipmap
.
h_screenshot
,
R
.
string
.
notification_screenshot
)
ID_SCREENSHOT_CLEAN
->
Pair
(
R
.
mipmap
.
h_screenshot
,
R
.
string
.
notification_screenshot
)
ID_MALWARE_CLEAN
->
{
val
arrayList
=
arrayOf
(
R
.
string
.
notification_malware_1
,
R
.
string
.
notification_malware_2
,
R
.
string
.
notification_malware_3
,
R
.
string
.
notification_malware_4
)
val
randomIndex
=
Random
.
nextInt
(
0
,
4
)
Pair
(
R
.
mipmap
.
icon_virus_home
,
arrayList
[
randomIndex
])
}
else
->
Pair
(
0
,
0
)
else
->
Pair
(
0
,
0
)
}
}
}
}
...
@@ -267,6 +278,8 @@ object NotificationUtils {
...
@@ -267,6 +278,8 @@ object NotificationUtils {
return
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notification_common_small
).
apply
{
return
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notification_common_small
).
apply
{
setImageViewResource
(
R
.
id
.
iv_icon
,
iconRes
)
setImageViewResource
(
R
.
id
.
iv_icon
,
iconRes
)
setTextViewText
(
R
.
id
.
tv_desc
,
context
.
getString
(
contentRes
))
setTextViewText
(
R
.
id
.
tv_desc
,
context
.
getString
(
contentRes
))
if
(
iconRes
==
R
.
mipmap
.
icon_virus_home
){
setTextViewText
(
R
.
id
.
tv_btn
,
"Scan Now"
)}
}
}
}
}
...
@@ -278,6 +291,8 @@ object NotificationUtils {
...
@@ -278,6 +291,8 @@ object NotificationUtils {
return
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notification_common
).
apply
{
return
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notification_common
).
apply
{
setImageViewResource
(
R
.
id
.
iv_icon
,
iconRes
)
setImageViewResource
(
R
.
id
.
iv_icon
,
iconRes
)
setTextViewText
(
R
.
id
.
tv_desc
,
context
.
getString
(
contentRes
))
setTextViewText
(
R
.
id
.
tv_desc
,
context
.
getString
(
contentRes
))
if
(
iconRes
==
R
.
mipmap
.
icon_virus_home
){
setTextViewText
(
R
.
id
.
tv_btn
,
"Scan Now"
)}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment