Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
D
Data Recovery White
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
Data Recovery White
Commits
2d3d1364
Commit
2d3d1364
authored
Jul 12, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
6e016b9d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
31 deletions
+28
-31
PrivacyManageActivity.kt
...tarecovery/activity/privacyspace/PrivacyManageActivity.kt
+5
-3
FileScanResultActivity.kt
.../datarecovery/activity/recovery/FileScanResultActivity.kt
+9
-11
PrivacyPageFragment.kt
...ava/com/base/datarecovery/fragment/PrivacyPageFragment.kt
+11
-7
FileHelp.kt
app/src/main/java/com/base/datarecovery/help/FileHelp.kt
+1
-3
FileScanDialog.kt
...rc/main/java/com/base/datarecovery/view/FileScanDialog.kt
+2
-7
No files found.
app/src/main/java/com/base/datarecovery/activity/privacyspace/PrivacyManageActivity.kt
View file @
2d3d1364
...
@@ -110,9 +110,11 @@ class PrivacyManageActivity : BaseActivity<ActivityPrivacyManageBinding>() {
...
@@ -110,9 +110,11 @@ class PrivacyManageActivity : BaseActivity<ActivityPrivacyManageBinding>() {
LogEx
.
logDebug
(
TAG
,
"$it"
)
LogEx
.
logDebug
(
TAG
,
"$it"
)
list
.
add
(
MediaBean
(
it
.
absolutePath
))
list
.
add
(
MediaBean
(
it
.
absolutePath
))
},
onFinish
=
{
},
onFinish
=
{
if
(
list
.
isNotEmpty
())
{
lifecycleScope
.
launch
(
Dispatchers
.
Main
)
{
binding
.
rv
.
visibility
=
View
.
VISIBLE
if
(
list
.
isNotEmpty
())
{
mediaSubAdapter
.
setData
(
list
)
binding
.
rv
.
visibility
=
View
.
VISIBLE
mediaSubAdapter
.
setData
(
list
)
}
}
}
})
})
}
}
...
...
app/src/main/java/com/base/datarecovery/activity/recovery/FileScanResultActivity.kt
View file @
2d3d1364
...
@@ -6,7 +6,6 @@ import android.graphics.Color
...
@@ -6,7 +6,6 @@ import android.graphics.Color
import
android.os.Environment
import
android.os.Environment
import
androidx.activity.addCallback
import
androidx.activity.addCallback
import
androidx.lifecycle.lifecycleScope
import
androidx.lifecycle.lifecycleScope
import
com.base.datarecovery.R
import
com.base.datarecovery.adapter.FileFolderAdapter
import
com.base.datarecovery.adapter.FileFolderAdapter
import
com.base.datarecovery.ads.AdmobInterstitialUtils
import
com.base.datarecovery.ads.AdmobInterstitialUtils
import
com.base.datarecovery.bean.ConstObject.SCAN_DOCUMENTS
import
com.base.datarecovery.bean.ConstObject.SCAN_DOCUMENTS
...
@@ -144,7 +143,6 @@ class FileScanResultActivity : BaseActivity<ActivityFileScanResultBinding>() {
...
@@ -144,7 +143,6 @@ class FileScanResultActivity : BaseActivity<ActivityFileScanResultBinding>() {
)
)
val
foundFlow
:
SharedFlow
<
Pair
<
Int
,
String
>>
=
mFoundFlow
val
foundFlow
:
SharedFlow
<
Pair
<
Int
,
String
>>
=
mFoundFlow
val
dialogClass
=
FileScanDialog
(
this
)
val
dialogClass
=
FileScanDialog
(
this
)
val
scanDialog
=
dialogClass
.
showFileScanDialog
(
pathFlow
,
foundFlow
)
val
scanDialog
=
dialogClass
.
showFileScanDialog
(
pathFlow
,
foundFlow
)
...
@@ -158,13 +156,14 @@ class FileScanResultActivity : BaseActivity<ActivityFileScanResultBinding>() {
...
@@ -158,13 +156,14 @@ class FileScanResultActivity : BaseActivity<ActivityFileScanResultBinding>() {
val
pathList
=
ArrayList
<
String
>()
val
pathList
=
ArrayList
<
String
>()
lifecycleScope
.
launch
(
Dispatchers
.
Main
)
{
lifecycleScope
.
launch
(
Dispatchers
.
Main
)
{
mFoundFlow
.
collectLatest
{
mFoundFlow
.
collectLatest
{
dialogClass
.
scanShowUI
()
pathList
.
add
(
it
.
second
)
pathList
.
add
(
it
.
second
)
binding
.
tvFileNumber
.
text
=
pathList
.
size
.
toString
()
binding
.
tvFileNumber
.
text
=
pathList
.
size
.
toString
()
setAdapterData
(
pathList
)
setAdapterData
(
pathList
)
}
}
}
}
var
oneShowAd
=
false
val
root
=
Environment
.
getExternalStorageDirectory
()
val
root
=
Environment
.
getExternalStorageDirectory
()
lifecycleScope
.
loadFileByFilter
(
lifecycleScope
.
loadFileByFilter
(
mPathFlow
,
mPathFlow
,
...
@@ -172,16 +171,15 @@ class FileScanResultActivity : BaseActivity<ActivityFileScanResultBinding>() {
...
@@ -172,16 +171,15 @@ class FileScanResultActivity : BaseActivity<ActivityFileScanResultBinding>() {
root
,
filter
=
filter
,
root
,
filter
=
filter
,
onDo
=
{
file
->
onDo
=
{
file
->
LogEx
.
logDebug
(
TAG
,
"file =${file.absolutePath}"
)
LogEx
.
logDebug
(
TAG
,
"file =${file.absolutePath}"
)
if
(!
oneShowAd
)
{
oneShowAd
=
true
lifecycleScope
.
launch
(
Dispatchers
.
Main
)
{
dialogClass
.
scanShowUI
()
AdmobInterstitialUtils
.
showInterstitialAd
(
this
@FileScanResultActivity
,
true
,
false
)
{
}
}
}
},
},
onFinish
=
{
onFinish
=
{
scanDialog
.
dismiss
()
lifecycleScope
.
launch
(
Dispatchers
.
Main
)
{
dialogClass
.
finishScan
{
AdmobInterstitialUtils
.
showInterstitialAd
(
this
@FileScanResultActivity
)
{
scanDialog
.
dismiss
()
}
}
}
}
}
)
)
...
...
app/src/main/java/com/base/datarecovery/fragment/PrivacyPageFragment.kt
View file @
2d3d1364
...
@@ -18,6 +18,8 @@ import com.base.datarecovery.utils.LogEx
...
@@ -18,6 +18,8 @@ import com.base.datarecovery.utils.LogEx
import
com.base.datarecovery.view.DialogViews.showCameraSettingDialog
import
com.base.datarecovery.view.DialogViews.showCameraSettingDialog
import
com.base.datarecovery.view.DialogViews.showGerPermission
import
com.base.datarecovery.view.DialogViews.showGerPermission
import
com.base.datarecovery.view.DialogViews.showImageImportDialog
import
com.base.datarecovery.view.DialogViews.showImageImportDialog
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
import
java.io.File
import
java.io.File
import
kotlin.random.Random
import
kotlin.random.Random
...
@@ -114,14 +116,16 @@ class PrivacyPageFragment(
...
@@ -114,14 +116,16 @@ class PrivacyPageFragment(
list
.
add
(
it
.
absolutePath
)
list
.
add
(
it
.
absolutePath
)
},
},
onFinish
=
{
onFinish
=
{
if
(
list
.
isNotEmpty
())
{
lifecycleScope
.
launch
(
Dispatchers
.
Main
)
{
binding
.
llEmpty
.
visibility
=
View
.
GONE
if
(
list
.
isNotEmpty
())
{
binding
.
rv
.
visibility
=
View
.
VISIBLE
binding
.
llEmpty
.
visibility
=
View
.
GONE
binding
.
ivAdd
.
visibility
=
View
.
VISIBLE
binding
.
rv
.
visibility
=
View
.
VISIBLE
binding
.
tvManager
.
visibility
=
View
.
VISIBLE
binding
.
ivAdd
.
visibility
=
View
.
VISIBLE
binding
.
tvManager
.
visibility
=
View
.
VISIBLE
}
adapter
.
setData
(
list
)
callback
?.
invoke
()
}
}
adapter
.
setData
(
list
)
callback
?.
invoke
()
})
})
}
}
}
}
\ No newline at end of file
app/src/main/java/com/base/datarecovery/help/FileHelp.kt
View file @
2d3d1364
...
@@ -67,9 +67,7 @@ object FileHelp {
...
@@ -67,9 +67,7 @@ object FileHelp {
}
}
}
}
}
}
launch
(
Dispatchers
.
Main
)
{
onFinish
?.
invoke
()
onFinish
?.
invoke
()
}
}
}
fun
readFileRange
(
filePath
:
String
,
start
:
Long
,
end
:
Long
):
ByteArray
{
fun
readFileRange
(
filePath
:
String
,
start
:
Long
,
end
:
Long
):
ByteArray
{
...
...
app/src/main/java/com/base/datarecovery/view/FileScanDialog.kt
View file @
2d3d1364
...
@@ -69,23 +69,18 @@ class FileScanDialog(
...
@@ -69,23 +69,18 @@ class FileScanDialog(
}
}
}
}
return
dialog
return
dialog
}
}
@SuppressLint
(
"SetTextI18n"
)
@SuppressLint
(
"SetTextI18n"
)
fun
stopScan
(
scanType
:
Int
,
pathList
:
ArrayList
<
String
>
)
{
fun
finishScan
(
clickAction
:
()
->
Unit
)
{
a1
.
cancel
()
a1
.
cancel
()
binding
.
tvBtn
.
visibility
=
View
.
VISIBLE
binding
.
tvBtn
.
visibility
=
View
.
VISIBLE
binding
.
iv
.
visibility
=
View
.
GONE
binding
.
iv
.
visibility
=
View
.
GONE
binding
.
tvPath
.
visibility
=
View
.
GONE
binding
.
tvPath
.
visibility
=
View
.
GONE
binding
.
tvTitle
.
text
=
"Scan Completed"
binding
.
tvTitle
.
text
=
"Scan Completed"
binding
.
tvBtn
.
setOnClickListener
{
binding
.
tvBtn
.
setOnClickListener
{
activity
.
startActivity
(
Intent
(
activity
,
FileScanResultActivity
::
class
.
java
).
apply
{
clickAction
.
invoke
()
putExtra
(
"ScanType"
,
scanType
)
putExtra
(
"PathList"
,
pathList
.
toTypedArray
())
})
activity
.
finish
()
}
}
}
}
...
...
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