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
ba942042
Commit
ba942042
authored
Nov 09, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
33a08f5d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
7 deletions
+18
-7
MyApplication.kt
...ain/java/com/base/filerecoveryrecyclebin/MyApplication.kt
+3
-1
SettingActivity.kt
...m/base/filerecoveryrecyclebin/activity/SettingActivity.kt
+7
-3
Splash2Activity.kt
...filerecoveryrecyclebin/activity/splash/Splash2Activity.kt
+1
-1
StayJobService.kt
...com/base/filerecoveryrecyclebin/service/StayJobService.kt
+7
-2
No files found.
app/src/main/java/com/base/filerecoveryrecyclebin/MyApplication.kt
View file @
ba942042
...
@@ -17,6 +17,7 @@ import com.base.filerecoveryrecyclebin.help.ConfigHelper
...
@@ -17,6 +17,7 @@ import com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.base.filerecoveryrecyclebin.utils.ActivityManagerUtils
import
com.base.filerecoveryrecyclebin.utils.ActivityManagerUtils
import
com.base.filerecoveryrecyclebin.utils.AppPreferences
import
com.base.filerecoveryrecyclebin.utils.AppPreferences
import
com.base.filerecoveryrecyclebin.help.InstallHelps
import
com.base.filerecoveryrecyclebin.help.InstallHelps
import
com.base.filerecoveryrecyclebin.service.StayJobService.Companion.startJob
import
com.base.filerecoveryrecyclebin.utils.LogEx
import
com.base.filerecoveryrecyclebin.utils.LogEx
import
com.base.filerecoveryrecyclebin.work.schedulePeriodicWork
import
com.base.filerecoveryrecyclebin.work.schedulePeriodicWork
import
com.facebook.FacebookSdk
import
com.facebook.FacebookSdk
...
@@ -60,7 +61,7 @@ class MyApplication : BaseApplication() {
...
@@ -60,7 +61,7 @@ class MyApplication : BaseApplication() {
fun
initApp
(
isStartClick
:
Boolean
=
false
)
{
fun
initApp
(
isStartClick
:
Boolean
=
false
)
{
if
(!
isStartClick
)
{
if
(!
isStartClick
)
{
Log
.
e
(
"MXL"
,
"initApp: "
,
)
Log
.
e
(
"MXL"
,
"initApp: "
)
@Suppress
(
"DEPRECATION"
)
@Suppress
(
"DEPRECATION"
)
FacebookSdk
.
sdkInitialize
(
applicationContext
)
FacebookSdk
.
sdkInitialize
(
applicationContext
)
// FacebookSdk.setIsDebugEnabled(true)
// FacebookSdk.setIsDebugEnabled(true)
...
@@ -74,6 +75,7 @@ class MyApplication : BaseApplication() {
...
@@ -74,6 +75,7 @@ class MyApplication : BaseApplication() {
BlackUtils
.
requestBlack
()
BlackUtils
.
requestBlack
()
initLifeListener
()
initLifeListener
()
schedulePeriodicWork
(
this
)
schedulePeriodicWork
(
this
)
startJob
()
}
}
if
(
ifAgreePrivacy
)
{
if
(
ifAgreePrivacy
)
{
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/activity/SettingActivity.kt
View file @
ba942042
...
@@ -11,6 +11,8 @@ import com.base.filerecoveryrecyclebin.fcm.FCMManager.subscribeToTopic
...
@@ -11,6 +11,8 @@ import com.base.filerecoveryrecyclebin.fcm.FCMManager.subscribeToTopic
import
com.base.filerecoveryrecyclebin.fcm.FCMManager.unsubscribeFromTopic
import
com.base.filerecoveryrecyclebin.fcm.FCMManager.unsubscribeFromTopic
import
com.base.filerecoveryrecyclebin.help.BaseActivity
import
com.base.filerecoveryrecyclebin.help.BaseActivity
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.base.filerecoveryrecyclebin.help.ConfigHelper
import
com.base.filerecoveryrecyclebin.service.StayJobService
import
com.base.filerecoveryrecyclebin.service.StayJobService.Companion.startJob
import
com.base.filerecoveryrecyclebin.service.StayNotificationService
import
com.base.filerecoveryrecyclebin.service.StayNotificationService
import
com.base.filerecoveryrecyclebin.service.StayNotificationService.Companion.startStayNotification
import
com.base.filerecoveryrecyclebin.service.StayNotificationService.Companion.startStayNotification
import
com.base.filerecoveryrecyclebin.utils.BarUtils
import
com.base.filerecoveryrecyclebin.utils.BarUtils
...
@@ -41,10 +43,12 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>() {
...
@@ -41,10 +43,12 @@ class SettingActivity : BaseActivity<ActivitySettingBinding>() {
binding
.
switchStayNotification
.
setOnCheckedChangeListener
{
buttonView
,
isChecked
->
binding
.
switchStayNotification
.
setOnCheckedChangeListener
{
buttonView
,
isChecked
->
stayNotification
=
isChecked
stayNotification
=
isChecked
if
(
isChecked
)
{
if
(
isChecked
)
{
startStayNotification
()
startJob
()
// startStayNotification()
}
else
{
}
else
{
val
serviceIntent
=
Intent
(
this
,
StayNotificationService
::
class
.
java
)
StayJobService
.
isCancel
=
true
stopService
(
serviceIntent
)
// val serviceIntent = Intent(this, StayNotificationService::class.java)
// stopService(serviceIntent)
}
}
}
}
binding
.
switchFcmNotification
.
setOnCheckedChangeListener
{
buttonView
,
isChecked
->
binding
.
switchFcmNotification
.
setOnCheckedChangeListener
{
buttonView
,
isChecked
->
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/activity/splash/Splash2Activity.kt
View file @
ba942042
...
@@ -80,7 +80,7 @@ class Splash2Activity : BaseActivity<ActivitySplashBinding>(),
...
@@ -80,7 +80,7 @@ class Splash2Activity : BaseActivity<ActivitySplashBinding>(),
override
fun
onAgreePrivacy
()
{
override
fun
onAgreePrivacy
()
{
EventUtils
.
event
(
"app_start"
)
EventUtils
.
event
(
"app_start"
)
if
(
jumpType
==
0
)
{
if
(
jumpType
==
0
)
{
startStayNotification
()
//
startStayNotification()
}
}
AdmobMaxHelper
.
preloadAd
(
this
)
AdmobMaxHelper
.
preloadAd
(
this
)
mTaskManager
?.
startProgress
()
mTaskManager
?.
startProgress
()
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/service/StayJobService.kt
View file @
ba942042
...
@@ -46,6 +46,7 @@ class StayJobService : JobService() {
...
@@ -46,6 +46,7 @@ class StayJobService : JobService() {
private
const
val
JOB_INFO_ID
:
Int
=
101
private
const
val
JOB_INFO_ID
:
Int
=
101
private
const
val
JOB_PERIODIC
:
Long
=
5
*
1000L
private
const
val
JOB_PERIODIC
:
Long
=
5
*
1000L
fun
Context
.
startJob
()
{
fun
Context
.
startJob
()
{
isCancel
=
false
if
(
isRunning
)
return
if
(
isRunning
)
return
val
jobScheduler
=
getSystemService
(
JOB_SCHEDULER_SERVICE
)
as
JobScheduler
val
jobScheduler
=
getSystemService
(
JOB_SCHEDULER_SERVICE
)
as
JobScheduler
val
componentName
=
ComponentName
(
this
,
StayJobService
::
class
.
java
)
val
componentName
=
ComponentName
(
this
,
StayJobService
::
class
.
java
)
...
@@ -55,6 +56,8 @@ class StayJobService : JobService() {
...
@@ -55,6 +56,8 @@ class StayJobService : JobService() {
jobScheduler
.
schedule
(
jobInfo
)
jobScheduler
.
schedule
(
jobInfo
)
}
}
var
isCancel
:
Boolean
=
false
fun
createPermanentNotification
(
context
:
Context
):
Notification
{
fun
createPermanentNotification
(
context
:
Context
):
Notification
{
val
channelName
=
"Permanent Foreground Service Channel"
val
channelName
=
"Permanent Foreground Service Channel"
...
@@ -175,9 +178,11 @@ class StayJobService : JobService() {
...
@@ -175,9 +178,11 @@ class StayJobService : JobService() {
}
}
override
fun
onFinish
()
{
override
fun
onFinish
()
{
if
(!
isCancel
)
{
notifyForeground
()
notifyForeground
()
Timer
().
start
()
Timer
().
start
()
}
}
}
}
}
...
...
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