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
eda17d5e
Commit
eda17d5e
authored
Jan 23, 2025
by
周文华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【调整&修复】1.调整权限弹出逻辑。2.修复通知栏没有图标问题。3.修复扫描崩溃问题。4.调整减短常驻显示延迟。
parent
7b265b0a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
20 deletions
+34
-20
CleanJunkActivity.kt
...ecoveryrecyclebin/activity/junkclean/CleanJunkActivity.kt
+22
-16
NotificationUtil.kt
...a/com/base/filerecoveryrecyclebin/fcm/NotificationUtil.kt
+10
-0
GuideFragment.kt
...com/base/filerecoveryrecyclebin/fragment/GuideFragment.kt
+1
-3
StayJobService.kt
...com/base/filerecoveryrecyclebin/service/StayJobService.kt
+1
-1
No files found.
app/src/main/java/com/base/filerecoveryrecyclebin/activity/junkclean/CleanJunkActivity.kt
View file @
eda17d5e
...
...
@@ -179,8 +179,8 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
var
totalSize
=
0L
val
list
=
arrayListOf
<
ChildBean
>()
async
{
val
list1
=
async
(
Dispatchers
.
IO
)
{
val
list
=
arrayListOf
<
ChildBean
>()
val
emptyFolder1
=
FileHelp
.
getFileFolder
(
Environment
.
getExternalStoragePublicDirectory
(
Environment
.
DIRECTORY_DCIM
))
val
emptyFolder2
=
FileHelp
.
getFileFolder
(
Environment
.
getExternalStoragePublicDirectory
(
Environment
.
DIRECTORY_DOWNLOADS
))
val
emptyFolder3
=
FileHelp
.
getFileFolder
(
Environment
.
getExternalStoragePublicDirectory
(
Environment
.
DIRECTORY_DOCUMENTS
))
...
...
@@ -197,13 +197,14 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
emptyFolder
.
filter
{
it
.
listFiles
().
isNullOrEmpty
()
}.
forEach
{
l
->
list
.
add
(
ChildBean
(
R
.
mipmap
.
kongwenjian
,
l
.
name
,
l
.
path
,
1
))
}
delay
(
Random
.
nextLong
(
1500
,
2000
))
delay
(
Random
.
nextLong
(
1000
,
1500
))
list
}.
await
()
junkExpandAdapter
.
addChildData
(
0
,
list
)
junkExpandAdapter
.
addChildData
(
0
,
list
1
)
list
.
clear
()
async
{
val
list2
=
async
(
Dispatchers
.
IO
)
{
val
list
=
arrayListOf
<
ChildBean
>()
val
apk
=
MediaStoreUtils
.
queryFiles
(
this
@CleanJunkActivity
,
MediaStoreUtils
.
FileType
.
APK
)
?:
listOf
()
apk
.
forEach
{
l
->
totalSize
+=
l
.
size
...
...
@@ -216,13 +217,15 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
// list.add(ChildBean(R.mipmap.apk, "1", "apl$it", size))
// }
// }
delay
(
Random
.
nextLong
(
1500
,
2000
))
delay
(
Random
.
nextLong
(
1000
,
1500
))
list
}.
await
()
junkExpandAdapter
.
addChildData
(
1
,
list
)
junkExpandAdapter
.
addChildData
(
1
,
list
2
)
list
.
clear
()
async
{
val
list3
=
async
(
Dispatchers
.
IO
)
{
val
list
=
arrayListOf
<
ChildBean
>()
val
temp
=
MediaStoreUtils
.
queryFiles
(
this
@CleanJunkActivity
,
MediaStoreUtils
.
FileType
.
TMP
)
?:
listOf
()
temp
.
forEach
{
l
->
totalSize
+=
l
.
size
...
...
@@ -235,12 +238,14 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
// list.add(ChildBean(R.mipmap.temp_clean, "1", "temp$it", size))
// }
// }
delay
(
Random
.
nextLong
(
1500
,
2000
))
delay
(
Random
.
nextLong
(
1000
,
1500
))
list
}.
await
()
junkExpandAdapter
.
addChildData
(
2
,
list
)
junkExpandAdapter
.
addChildData
(
2
,
list3
)
list
.
clear
()
async
{
val
list4
=
async
(
Dispatchers
.
IO
)
{
val
list
=
arrayListOf
<
ChildBean
>()
val
log
=
MediaStoreUtils
.
queryFiles
(
this
@CleanJunkActivity
,
MediaStoreUtils
.
FileType
.
LOG
)
?:
listOf
()
log
.
forEach
{
l
->
totalSize
+=
l
.
size
...
...
@@ -253,11 +258,12 @@ class CleanJunkActivity : BaseActivity<ActivityLayoutCleanJunkBinding>() {
// list.add(ChildBean(R.mipmap.log_clean, "1", "log$it", size))
// }
// }
delay
(
Random
.
nextLong
(
1500
,
2000
))
delay
(
Random
.
nextLong
(
1000
,
1500
))
list
}.
await
()
scanFinish
=
true
junkExpandAdapter
.
addChildData
(
3
,
list
)
junkExpandAdapter
.
addChildData
(
3
,
list
4
)
}
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/fcm/NotificationUtil.kt
View file @
eda17d5e
...
...
@@ -76,6 +76,7 @@ object NotificationUtil {
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
smallRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
sendCustomNotification
(
context
,
actionId
,
intent
,
bigRemoteViews
,
smallRemoteViews
)
...
...
@@ -88,6 +89,7 @@ object NotificationUtil {
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
smallRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
sendCustomNotification
(
context
,
actionId
,
intent
,
bigRemoteViews
,
smallRemoteViews
)
...
...
@@ -100,6 +102,7 @@ object NotificationUtil {
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
smallRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
sendCustomNotification
(
context
,
actionId
,
intent
,
bigRemoteViews
,
smallRemoteViews
)
...
...
@@ -112,6 +115,7 @@ object NotificationUtil {
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
smallRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
sendCustomNotification
(
context
,
actionId
,
intent
,
bigRemoteViews
,
smallRemoteViews
)
...
...
@@ -124,6 +128,7 @@ object NotificationUtil {
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
smallRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
sendCustomNotification
(
context
,
actionId
,
intent
,
bigRemoteViews
,
smallRemoteViews
)
...
...
@@ -136,6 +141,7 @@ object NotificationUtil {
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
smallRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
sendCustomNotification
(
context
,
actionId
,
intent
,
bigRemoteViews
,
smallRemoteViews
)
...
...
@@ -148,6 +154,7 @@ object NotificationUtil {
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
smallRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
sendCustomNotification
(
context
,
actionId
,
intent
,
bigRemoteViews
,
smallRemoteViews
)
...
...
@@ -160,6 +167,7 @@ object NotificationUtil {
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
smallRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
sendCustomNotification
(
context
,
actionId
,
intent
,
bigRemoteViews
,
smallRemoteViews
)
...
...
@@ -172,6 +180,7 @@ object NotificationUtil {
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
smallRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
sendCustomNotification
(
context
,
actionId
,
intent
,
bigRemoteViews
,
smallRemoteViews
)
...
...
@@ -184,6 +193,7 @@ object NotificationUtil {
bigRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
smallRemoteViews
.
setImageViewResource
(
R
.
id
.
iv_icon
,
icon
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_desc
,
desc
)
smallRemoteViews
.
setTextViewText
(
R
.
id
.
tv_btn
,
btn
)
sendCustomNotification
(
context
,
actionId
,
intent
,
bigRemoteViews
,
smallRemoteViews
)
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/fragment/GuideFragment.kt
View file @
eda17d5e
...
...
@@ -5,7 +5,6 @@ import android.content.Intent
import
androidx.core.view.isVisible
import
com.base.filerecoveryrecyclebin.R
import
com.base.filerecoveryrecyclebin.activity.MainActivity
import
com.base.filerecoveryrecyclebin.activity.guide.CleanGuideActivity
import
com.base.filerecoveryrecyclebin.activity.guide.GuideActivity
import
com.base.filerecoveryrecyclebin.ads.AdmobMaxHelper
import
com.base.filerecoveryrecyclebin.bean.ConstObject
...
...
@@ -74,8 +73,7 @@ class GuideFragment : BaseFragment<FragmentGuideBinding>() {
// isInstallVip = false
}
else
{
if
(!
ConstObject
.
isCLeanGuide
){
startActivity
(
Intent
(
requireContext
(),
CleanGuideActivity
::
class
.
java
))
requireActivity
().
finish
()
(
requireActivity
()
as
GuideActivity
).
lauchPermisson
()
}
else
{
val
showAd
=
AppPreferences
.
getInstance
().
getString
(
"isShowGuideAd"
,
"0"
)
?.
toInt
()
if
(
showAd
==
1
)
{
...
...
app/src/main/java/com/base/filerecoveryrecyclebin/service/StayJobService.kt
View file @
eda17d5e
...
...
@@ -51,7 +51,7 @@ class StayJobService : JobService() {
val
jobScheduler
=
getSystemService
(
JOB_SCHEDULER_SERVICE
)
as
JobScheduler
val
componentName
=
ComponentName
(
this
,
StayJobService
::
class
.
java
)
val
jobInfo
=
JobInfo
.
Builder
(
JOB_INFO_ID
,
componentName
)
.
setMinimumLatency
(
30
000
)
.
setMinimumLatency
(
5
000
)
.
build
()
jobScheduler
.
schedule
(
jobInfo
)
}
...
...
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