Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
PDF Viewer Scanner White ago
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
kuxulei
PDF Viewer Scanner White ago
Commits
6315bea1
Commit
6315bea1
authored
Jan 06, 2025
by
周文华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修复】修复通知栏中耗时操作导致的anr
parent
294472a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
NotificationUiUtil.kt
.../com/base/pdfviewerscannerwhite/fcm/NotificationUiUtil.kt
+11
-1
No files found.
app/src/main/java/com/base/pdfviewerscannerwhite/fcm/NotificationUiUtil.kt
View file @
6315bea1
...
...
@@ -44,6 +44,10 @@ import com.base.pdfviewerscannerwhite.utils.LogEx
import
com.base.pdfviewerscannerwhite.utils.RamUtils.ramPair
import
com.base.pdfviewerscannerwhite.utils.TimeUtils.formatATime
import
com.base.pdfviewerscannerwhite.utils.TimeUtils.isDayOrNight
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.MainScope
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.withContext
import
java.text.SimpleDateFormat
import
java.util.Calendar
import
java.util.Locale
...
...
@@ -149,6 +153,10 @@ object NotificationUiUtil {
var
hoverActionId
=
""
val
mainScope
by
lazy
{
MainScope
()
}
@SuppressLint
(
"RemoteViewLayout"
)
fun
sendNotificationIfCan
(
context
:
Context
,
...
...
@@ -259,7 +267,8 @@ object NotificationUiUtil {
}
NOTIFICATION_ACTION_CLEAN_JUNK
->
{
var
size
=
fastGetJunkSize
(
context
)
mainScope
.
launch
{
var
size
=
withContext
(
Dispatchers
.
IO
){
fastGetJunkSize
(
context
)}
if
(
size
==
0L
)
{
size
=
Random
.
nextLong
(
1024
*
5
,
1024
*
10
)
}
...
...
@@ -272,6 +281,7 @@ object NotificationUiUtil {
smallRemoteViewsVar
.
setTextViewText
(
R
.
id
.
tv_size
,
size
.
toFormatSize
())
sendCustomNotification
(
context
,
intent
,
bigRemoteViewsVar
,
smallRemoteViewsVar
)
}
}
NOTIFICATION_ACTION_WEATHER
->
{
...
...
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