Commit 84c1ced5 authored by wanglei's avatar wanglei

...

parent 44b02ca7
......@@ -57,9 +57,7 @@ import kotlin.random.Random
object NotificationUiUtil {
private val TAG = "NotificationUiUtil"
private const val CHANNEL_ID = "browser_notification_id" // 通知渠道ID
private const val CHANNEL_NAME = "browser_fcm_channel" // 通知渠道名称
var NOTIFICATION_ID = 8999
var NOTIFICATION_ID = Random.nextInt(1000, 1800)
private fun currentDate(): String {
val dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
......@@ -304,12 +302,13 @@ object NotificationUiUtil {
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val channelId = context.resources.getString(R.string.app_name).replace(" ", "_") + "_channel_id"
val channelName = context.resources.getString(R.string.app_name).replace(" ", "_") + "_channel"
//创建channel
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel = NotificationChannel(
CHANNEL_ID,
CHANNEL_NAME,
NotificationManager.IMPORTANCE_HIGH
channelId, channelName, NotificationManager.IMPORTANCE_HIGH
)
channel.lockscreenVisibility = NotificationCompat.VISIBILITY_PUBLIC
notificationManager.createNotificationChannel(channel)
......@@ -317,7 +316,7 @@ object NotificationUiUtil {
// Create the notification
val builder: NotificationCompat.Builder = NotificationCompat.Builder(context, CHANNEL_ID)
val builder: NotificationCompat.Builder = NotificationCompat.Builder(context, channelId)
//设置状态栏内的小图标
val smallIcon = IconCompat.createFromIcon(
......
......@@ -110,7 +110,7 @@
android:src="@mipmap/wancheng"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@id/iv_more"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
......@@ -421,8 +421,8 @@
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:max="100"
tools:progress="50"
android:progressDrawable="@drawable/progress_bar_pdf" />
android:progressDrawable="@drawable/progress_bar_pdf"
tools:progress="50" />
</LinearLayout>
......
......@@ -33,7 +33,7 @@
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="23dp"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/doc_notification"
......
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