Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
F
File Recovery RecycleBin
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
File Recovery RecycleBin
Commits
8ec129b3
Commit
8ec129b3
authored
Aug 09, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
ac5769c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
NotificationUtil.kt
...a/com/base/filerecoveryrecyclebin/fcm/NotificationUtil.kt
+16
-1
No files found.
app/src/main/java/com/base/filerecoveryrecyclebin/fcm/NotificationUtil.kt
View file @
8ec129b3
...
@@ -17,7 +17,6 @@ import androidx.core.graphics.drawable.IconCompat
...
@@ -17,7 +17,6 @@ import androidx.core.graphics.drawable.IconCompat
import
com.base.filerecoveryrecyclebin.MyApplication
import
com.base.filerecoveryrecyclebin.MyApplication
import
com.base.filerecoveryrecyclebin.R
import
com.base.filerecoveryrecyclebin.R
import
com.base.filerecoveryrecyclebin.activity.SplashActivity
import
com.base.filerecoveryrecyclebin.activity.SplashActivity
import
com.base.filerecoveryrecyclebin.bean.ConstObject.BATTERY_INFO
import
com.base.filerecoveryrecyclebin.bean.ConstObject.ID_APP_MANAGER
import
com.base.filerecoveryrecyclebin.bean.ConstObject.ID_APP_MANAGER
import
com.base.filerecoveryrecyclebin.bean.ConstObject.ID_APP_PROCESS
import
com.base.filerecoveryrecyclebin.bean.ConstObject.ID_APP_PROCESS
import
com.base.filerecoveryrecyclebin.bean.ConstObject.ID_BATTERY_INFO
import
com.base.filerecoveryrecyclebin.bean.ConstObject.ID_BATTERY_INFO
...
@@ -40,6 +39,9 @@ import com.base.filerecoveryrecyclebin.utils.PhotoRecoveryStringManager
...
@@ -40,6 +39,9 @@ import com.base.filerecoveryrecyclebin.utils.PhotoRecoveryStringManager
import
com.base.filerecoveryrecyclebin.utils.ScreenshotCleanupStringManager
import
com.base.filerecoveryrecyclebin.utils.ScreenshotCleanupStringManager
import
com.base.filerecoveryrecyclebin.utils.VideoRecoveryStringManager
import
com.base.filerecoveryrecyclebin.utils.VideoRecoveryStringManager
import
com.base.filerecoveryrecyclebin.utils.WhatsappCleanerStringManager
import
com.base.filerecoveryrecyclebin.utils.WhatsappCleanerStringManager
import
java.text.SimpleDateFormat
import
java.util.Calendar
import
java.util.Locale
import
java.util.Random
import
java.util.Random
/**
/**
...
@@ -220,6 +222,12 @@ object NotificationUtil {
...
@@ -220,6 +222,12 @@ object NotificationUtil {
private
var
handlerThread
:
HandlerThread
?
=
null
private
var
handlerThread
:
HandlerThread
?
=
null
private
var
handler
:
Handler
?
=
null
private
var
handler
:
Handler
?
=
null
private
fun
getCurrentDate
():
String
{
val
dateFormat
=
SimpleDateFormat
(
"yyyy-MM-dd"
,
Locale
.
getDefault
())
val
currentDate
=
Calendar
.
getInstance
().
time
return
dateFormat
.
format
(
currentDate
)
}
fun
sendNotification
(
context
:
Context
,
where
:
String
=
""
)
{
fun
sendNotification
(
context
:
Context
,
where
:
String
=
""
)
{
val
actionId
:
Int
=
getNextNotificationId
()
val
actionId
:
Int
=
getNextNotificationId
()
EventUtils
.
event
(
"showNotification"
,
where
,
null
,
false
)
EventUtils
.
event
(
"showNotification"
,
where
,
null
,
false
)
...
@@ -227,6 +235,11 @@ object NotificationUtil {
...
@@ -227,6 +235,11 @@ object NotificationUtil {
if
(
MyApplication
.
PAUSED_VALUE
==
1
)
{
if
(
MyApplication
.
PAUSED_VALUE
==
1
)
{
return
return
}
}
val
maxShowNotificationCount
=
AppPreferences
.
getInstance
().
getString
(
"maxShowNotificationCount"
,
"0"
).
toInt
()
var
todayShowCount
=
AppPreferences
.
getInstance
().
getInt
(
"notificationCount_${getCurrentDate()}"
,
0
)
if
(
todayShowCount
>=
maxShowNotificationCount
)
{
return
}
val
interval
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"notificationInterval"
,
"60"
).
toIntOrNull
()
?:
60
val
interval
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"notificationInterval"
,
"60"
).
toIntOrNull
()
?:
60
val
lastTime
:
Long
=
AppPreferences
.
getInstance
().
getLong
(
"last_notification_time"
,
0
)
val
lastTime
:
Long
=
AppPreferences
.
getInstance
().
getLong
(
"last_notification_time"
,
0
)
...
@@ -238,6 +251,8 @@ object NotificationUtil {
...
@@ -238,6 +251,8 @@ object NotificationUtil {
sendNotification
(
context
,
actionId
)
sendNotification
(
context
,
actionId
)
AppPreferences
.
getInstance
().
putInt
(
"NotificationCount_${getCurrentDate()}"
,
todayShowCount
+
1
)
val
open
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"open"
,
"0"
).
toIntOrNull
()
?:
0
val
open
:
Int
=
AppPreferences
.
getInstance
().
getString
(
"open"
,
"0"
).
toIntOrNull
()
?:
0
if
(
open
==
1
)
{
if
(
open
==
1
)
{
...
...
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