NotificationUtils

通知栏工具

Author

Jenly

Functions

Link copied to clipboard
open fun cancelNotification(context: Context, notifyId: Int)
取消通知
Link copied to clipboard
open fun createNotificationChannel(context: Context, channelId: String, channelName: String, isVibrate: Boolean, isSound: Boolean)
创建一个通知通道(兼容0以上版本)
Link copied to clipboard
获取通知管理器
Link copied to clipboard
open fun showErrorNotification(context: Context, notifyId: Int, channelId: String, @DrawableRes smallIcon: Int, title: CharSequence, content: CharSequence, isReDownload: Boolean, config: UpdateConfig)
现在下载失败通知
Link copied to clipboard
open fun showFinishNotification(context: Context, notifyId: Int, channelId: String, @DrawableRes smallIcon: Int, title: CharSequence, content: CharSequence, file: File, authority: String)
显示下载完成时的通知(点击安装)
Link copied to clipboard
open fun showNotification(context: Context, notifyId: Int, channelId: String, @DrawableRes smallIcon: Int, title: CharSequence, content: CharSequence, isAutoCancel: Boolean)
显示通知信息(非第一次)
Link copied to clipboard
open fun showProgressNotification(context: Context, notifyId: Int, channelId: String, @DrawableRes smallIcon: Int, title: CharSequence, content: CharSequence, progress: Int, size: Int, isSupportCancelDownload: Boolean)
显示下载中的通知(更新进度)
Link copied to clipboard
open fun showStartNotification(context: Context, notifyId: Int, channelId: String, channelName: String, @DrawableRes smallIcon: Int, title: CharSequence, content: CharSequence, isVibrate: Boolean, isSound: Boolean, isSupportCancelDownload: Boolean)
显示开始下载时的通知