Commit 0a5b0386 authored by wanglei's avatar wanglei

...

parent 3046ab41
package com.zxdemo.notity package com.zxdemo.notity
import android.app.NotificationChannel import android.app.NotificationChannel
import android.app.NotificationManager import android.app.NotificationManager
import android.app.PendingIntent import android.app.PendingIntent
...@@ -131,8 +132,8 @@ object NotificationUtils { ...@@ -131,8 +132,8 @@ object NotificationUtils {
fun sendNotification(context: Context, action: String, value: String) { fun sendNotification(context: Context, action: String, value: String) {
var actionId = nextNotificationId var actionId = nextNotificationId
val bigRemoteViews = RemoteViews(context.packageName, R.layout.notice_expand) val bigRemoteViews = RemoteViews(context.packageName, R.layout.notification_common)
val smallRemoteViews = RemoteViews(context.packageName, R.layout.notify_stay_big) val smallRemoteViews = RemoteViews(context.packageName, R.layout.notification_common_small)
when (actionId) { when (actionId) {
ID_CLEAN_JUNK -> { ID_CLEAN_JUNK -> {
} }
...@@ -161,8 +162,8 @@ object NotificationUtils { ...@@ -161,8 +162,8 @@ object NotificationUtils {
var intent = Intent(context, MainActivity::class.java) var intent = Intent(context, MainActivity::class.java)
intent.putExtra("actionId", actionId) intent.putExtra("actionId", actionId)
val btnPendingIntent = PendingIntent.getActivity(context, btnRequestCode, intent, flag) val btnPendingIntent = PendingIntent.getActivity(context, btnRequestCode, intent, flag)
// bigRemoteViews.setOnClickPendingIntent(R.id.btn_notice, btnPendingIntent) bigRemoteViews.setOnClickPendingIntent(R.id.fl_btn, btnPendingIntent)
// smallRemoteViews.setOnClickPendingIntent(R.id.notice_btn, btnPendingIntent) smallRemoteViews.setOnClickPendingIntent(R.id.tv_btn, btnPendingIntent)
val open = SpUtils.getInstance().getInt("NotificationStayStatus", 0) val open = SpUtils.getInstance().getInt("NotificationStayStatus", 0)
if (open == 1) { if (open == 1) {
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<TextView <TextView
android:id="@+id/tv_btn" android:id="@+id/tv_btn"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="21dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginEnd="12dp" android:layout_marginEnd="12dp"
android:paddingHorizontal="20dp" android:paddingHorizontal="20dp"
......
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