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
0a5b0386
Commit
0a5b0386
authored
Dec 20, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
3046ab41
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
NotificationUtils.kt
app/src/main/java/com/zxdemo/notity/NotificationUtils.kt
+5
-4
notification_common_small.xml
app/src/main/res/layout/notification_common_small.xml
+1
-1
No files found.
app/src/main/java/com/zxdemo/notity/NotificationUtils.kt
View file @
0a5b0386
package
com.zxdemo.notity
import
android.app.NotificationChannel
import
android.app.NotificationManager
import
android.app.PendingIntent
...
...
@@ -131,8 +132,8 @@ object NotificationUtils {
fun
sendNotification
(
context
:
Context
,
action
:
String
,
value
:
String
)
{
var
actionId
=
nextNotificationId
val
bigRemoteViews
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
noti
ce_expand
)
val
smallRemoteViews
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notif
y_stay_big
)
val
bigRemoteViews
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
noti
fication_common
)
val
smallRemoteViews
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
notif
ication_common_small
)
when
(
actionId
)
{
ID_CLEAN_JUNK
->
{
}
...
...
@@ -161,8 +162,8 @@ object NotificationUtils {
var
intent
=
Intent
(
context
,
MainActivity
::
class
.
java
)
intent
.
putExtra
(
"actionId"
,
actionId
)
val
btnPendingIntent
=
PendingIntent
.
getActivity
(
context
,
btnRequestCode
,
intent
,
flag
)
// bigRemoteViews.setOnClickPendingIntent(R.id.btn_notice
, btnPendingIntent)
// smallRemoteViews.setOnClickPendingIntent(R.id.notice
_btn, btnPendingIntent)
bigRemoteViews
.
setOnClickPendingIntent
(
R
.
id
.
fl_btn
,
btnPendingIntent
)
smallRemoteViews
.
setOnClickPendingIntent
(
R
.
id
.
tv
_btn
,
btnPendingIntent
)
val
open
=
SpUtils
.
getInstance
().
getInt
(
"NotificationStayStatus"
,
0
)
if
(
open
==
1
)
{
...
...
app/src/main/res/layout/notification_common_small.xml
View file @
0a5b0386
...
...
@@ -36,7 +36,7 @@
<TextView
android:id=
"@+id/tv_btn"
android:layout_width=
"wrap_content"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
21dp
"
android:layout_gravity=
"center_vertical"
android:layout_marginEnd=
"12dp"
android:paddingHorizontal=
"20dp"
...
...
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