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
7763512a
Commit
7763512a
authored
Dec 20, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
44e8c9dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
13 deletions
+5
-13
NotificationUtils.kt
app/src/main/java/com/zxdemo/notity/NotificationUtils.kt
+5
-11
FcmReceiver.kt
app/src/main/java/com/zxdemo/receiver/FcmReceiver.kt
+0
-2
No files found.
app/src/main/java/com/zxdemo/notity/NotificationUtils.kt
View file @
7763512a
...
...
@@ -14,8 +14,8 @@ import android.util.Log
import
android.widget.RemoteViews
import
androidx.core.app.NotificationCompat
import
androidx.core.content.ContextCompat
import
com.swiftcleaner.chovey.BuildConfig
import
com.swiftcleaner.chovey.R
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_APP_PROCESS
import
com.swiftcleaner.chovey.model.bean.Global.FUNCTION_BATTERY
...
...
@@ -132,7 +132,6 @@ object NotificationUtils {
val
bigRemoteViews
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notification_common
)
val
smallRemoteViews
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notification_common_small
)
var
intentAction
=
""
when
(
actionId
)
{
FUNCTION_CLEAN
->
{
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
R
.
mipmap
.
h_cleanjunk
)
...
...
@@ -141,7 +140,6 @@ object NotificationUtils {
val
desc
=
"Clean out junk files to free up space on your phone!"
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
intentAction
=
Global
.
FUNCTION_CLEAN
}
...
...
@@ -152,7 +150,6 @@ object NotificationUtils {
val
desc
=
"Clean out junk files to free up space on your phone!"
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
intentAction
=
Global
.
FUNCTION_CLEAN
}
FUNCTION_BATTERY
->
{
...
...
@@ -162,7 +159,6 @@ object NotificationUtils {
val
desc
=
"Clean out junk files to free up space on your phone!"
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
intentAction
=
Global
.
FUNCTION_CLEAN
}
FUNCTION_LARGE_FILE
->
{
...
...
@@ -172,7 +168,6 @@ object NotificationUtils {
val
desc
=
"Clean out junk files to free up space on your phone!"
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
intentAction
=
Global
.
FUNCTION_CLEAN
}
FUNCTION_WHATS_APP
->
{
...
...
@@ -182,7 +177,6 @@ object NotificationUtils {
val
desc
=
"Clean out junk files to free up space on your phone!"
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
intentAction
=
Global
.
FUNCTION_CLEAN
}
FUNCTION_APP_PROCESS
->
{
...
...
@@ -192,7 +186,6 @@ object NotificationUtils {
val
desc
=
"Clean out junk files to free up space on your phone!"
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
intentAction
=
Global
.
FUNCTION_CLEAN
}
FUNCTION_SIMILAR_PHOTOS
->
{
...
...
@@ -202,7 +195,6 @@ object NotificationUtils {
val
desc
=
"Clean out junk files to free up space on your phone!"
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
intentAction
=
Global
.
FUNCTION_CLEAN
}
FUNCTION_SCREENSHOT
->
{
...
...
@@ -212,7 +204,6 @@ object NotificationUtils {
val
desc
=
"Clean out junk files to free up space on your phone!"
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
intentAction
=
Global
.
FUNCTION_CLEAN
}
else
->
{
...
...
@@ -222,7 +213,7 @@ object NotificationUtils {
val
flag
=
PendingIntent
.
FLAG_IMMUTABLE
val
btnRequestCode
=
Random
().
nextInt
(
1000
)
val
intent
=
Intent
(
context
,
StartActivity
::
class
.
java
)
intent
.
putExtra
(
"actionId"
,
intentAction
)
intent
.
putExtra
(
"actionId"
,
actionId
)
val
btnPendingIntent
=
PendingIntent
.
getActivity
(
context
,
btnRequestCode
,
intent
,
flag
)
bigRemoteViews
.
setOnClickPendingIntent
(
R
.
id
.
fl_btn
,
btnPendingIntent
)
smallRemoteViews
.
setOnClickPendingIntent
(
R
.
id
.
tv_btn
,
btnPendingIntent
)
...
...
@@ -274,6 +265,9 @@ object NotificationUtils {
if
(
currentNotificationIdIndex
>=
NOTIFICATION_IDS
.
size
)
{
currentNotificationIdIndex
=
0
}
if
(
BuildConfig
.
DEBUG
)
{
return
FUNCTION_BATTERY
}
// 返回下一个通知 ID
return
NOTIFICATION_IDS
[
currentNotificationIdIndex
]
}
...
...
app/src/main/java/com/zxdemo/receiver/FcmReceiver.kt
View file @
7763512a
...
...
@@ -2,10 +2,8 @@ package com.zxdemo.receiver
import
android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Intent
import
android.util.Log
class
FcmReceiver
:
BroadcastReceiver
()
{
override
fun
onReceive
(
context
:
Context
?,
intent
:
Intent
?)
{
Log
.
d
(
"TAG"
,
"onReceive:$intent "
)
}
}
\ No newline at end of file
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