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
5ee4cfc5
Commit
5ee4cfc5
authored
Jul 12, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
ff4b1cd6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
24 deletions
+48
-24
SplashActivity.kt
...ain/java/com/base/datarecovery/activity/SplashActivity.kt
+12
-7
FileScanResultActivity.kt
.../datarecovery/activity/recovery/FileScanResultActivity.kt
+4
-7
HomeFragment.kt
.../main/java/com/base/datarecovery/fragment/HomeFragment.kt
+2
-2
FileScanDialog.kt
...rc/main/java/com/base/datarecovery/view/FileScanDialog.kt
+6
-4
activity_file_scan_result.xml
app/src/main/res/layout/activity_file_scan_result.xml
+24
-4
No files found.
app/src/main/java/com/base/datarecovery/activity/SplashActivity.kt
View file @
5ee4cfc5
...
...
@@ -46,6 +46,7 @@ import kotlinx.coroutines.flow.collectLatest
import
kotlinx.coroutines.isActive
import
kotlinx.coroutines.launch
import
kotlin.random.Random
import
kotlin.random.nextLong
@SuppressLint
(
"CustomSplashScreen"
)
class
SplashActivity
:
BaseActivity
<
ActivitySplashBinding
>()
{
...
...
@@ -205,18 +206,22 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
val
delayTime
=
Random
.
nextLong
(
300
,
550
)
delay
(
delayTime
)
processTime
+=
delayTime
if
(
processTime
>=
15000
)
{
if
(
processTime
>=
Random
.
nextLong
(
4000
,
6000
)
)
{
job
?.
cancel
()
AdmobOpenUtils
.
showAppOpenAd
(
this
@SplashActivity
)
{
LogEx
.
logDebug
(
TAG
,
"where $it"
)
binding
.
pb
.
progress
=
100
startActivity
(
Intent
(
this
@SplashActivity
,
MainActivity
::
class
.
java
))
finish
()
}
outTimeAd
()
}
}
}
private
fun
outTimeAd
()
{
AdmobOpenUtils
.
showAppOpenAd
(
this
@SplashActivity
)
{
LogEx
.
logDebug
(
TAG
,
"where $it"
)
binding
.
pb
.
progress
=
100
startActivity
(
Intent
(
this
@SplashActivity
,
MainActivity
::
class
.
java
))
finish
()
}
}
override
fun
onResume
()
{
super
.
onResume
()
if
(
ifAgreePrivacy
&&
job
?.
isActive
==
false
)
{
...
...
app/src/main/java/com/base/datarecovery/activity/recovery/FileScanResultActivity.kt
View file @
5ee4cfc5
...
...
@@ -121,7 +121,7 @@ class FileScanResultActivity : BaseActivity<ActivityFileScanResultBinding>() {
val
mPathFlow
=
MutableSharedFlow
<
String
>(
replay
=
5
,
//当新的订阅者Collect时,发送几个已经发送过的数据给它
extraBufferCapacity
=
5
,
//减去replay,MutableSharedFlow还缓存多少数据,缓冲池容量 = replay + extraBufferCapacity
onBufferOverflow
=
BufferOverflow
.
SUSPEND
//缓存策略,三种 丢掉最新值、丢掉最旧值和挂起
onBufferOverflow
=
BufferOverflow
.
DROP_OLDEST
//缓存策略,三种 丢掉最新值、丢掉最旧值和挂起
)
val
pathFlow
:
SharedFlow
<
String
>
=
mPathFlow
...
...
@@ -133,14 +133,11 @@ class FileScanResultActivity : BaseActivity<ActivityFileScanResultBinding>() {
)
val
foundFlow
:
SharedFlow
<
Pair
<
Int
,
String
>>
=
mFoundFlow
var
pathShowed
=
false
val
dialogClass
=
FileScanDialog
(
this
)
val
scanDialog
=
dialogClass
.
showFileScanDialog
(
pathFlow
,
foundFlow
)
{
if
(!
pathShowed
)
{
pathShowed
=
true
dialogClass
.
scanShowUI
()
}
pathList
.
add
(
it
)
binding
.
tvFileNumber
.
text
=
pathList
.
size
.
toString
()
setAdapterData
(
it
)
...
...
@@ -165,7 +162,7 @@ class FileScanResultActivity : BaseActivity<ActivityFileScanResultBinding>() {
binding
.
ivWancheng
.
visibility
=
View
.
VISIBLE
binding
.
tvScanning
.
text
=
"Completed"
AdmobInterstitialUtils
.
showInterstitialAd
(
this
@FileScanResultActivity
,
isShowDialog
=
false
)
{}
binding
.
iv
Empty
.
isVisible
=
pathList
.
isEmpty
()
binding
.
fl
Empty
.
isVisible
=
pathList
.
isEmpty
()
setAdapterData
(
null
)
dialogClass
.
finishScan
{
scanDialog
.
dismiss
()
...
...
app/src/main/java/com/base/datarecovery/fragment/HomeFragment.kt
View file @
5ee4cfc5
...
...
@@ -37,8 +37,8 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
override
fun
setListener
()
{
binding
.
flScan
.
setOnClickListener
{
//
startActivity(Intent(requireContext(), ScanJunkActivity::class.java))
sendNotification
(
requireContext
(),
ConstObject
.
ID_SCREENSHOT_CLEAN
)
startActivity
(
Intent
(
requireContext
(),
ScanJunkActivity
::
class
.
java
))
//
sendNotification(requireContext(), ConstObject.ID_SCREENSHOT_CLEAN)
}
binding
.
flRyPhoto
.
setOnClickListener
{
startActivity
(
Intent
(
requireContext
(),
FileScanResultActivity
::
class
.
java
).
apply
{
...
...
app/src/main/java/com/base/datarecovery/view/FileScanDialog.kt
View file @
5ee4cfc5
...
...
@@ -13,6 +13,7 @@ import com.base.datarecovery.R
import
com.base.datarecovery.activity.recovery.FileScanResultActivity
import
com.base.datarecovery.ads.AdmobNativeUtils
import
com.base.datarecovery.databinding.DialogFileScanBinding
import
com.base.datarecovery.utils.LogEx
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.flow.SharedFlow
import
kotlinx.coroutines.flow.collectLatest
...
...
@@ -59,8 +60,13 @@ class FileScanDialog(
AdmobNativeUtils
.
showNativeAd
(
activity
,
binding
.
flAd
,
R
.
layout
.
layout_native_custom_big
)
var
pathShowed
=
false
activity
.
lifecycleScope
.
launch
(
Dispatchers
.
Main
)
{
pathFlow
.
collectLatest
{
path
->
if
(!
pathShowed
)
{
pathShowed
=
true
binding
.
tvPath
.
visibility
=
View
.
VISIBLE
}
binding
.
tvPath
.
text
=
path
}
}
...
...
@@ -85,8 +91,4 @@ class FileScanDialog(
clickAction
.
invoke
()
}
}
fun
scanShowUI
()
{
binding
.
tvPath
.
visibility
=
View
.
VISIBLE
}
}
\ No newline at end of file
app/src/main/res/layout/activity_file_scan_result.xml
View file @
5ee4cfc5
...
...
@@ -185,14 +185,34 @@
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem=
"@layout/item_folder_recovery"
/>
<
ImageView
android:id=
"@+id/
iv
_empty"
<
LinearLayout
android:id=
"@+id/
fl
_empty"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:
src=
"@mipmap/queshengye
"
android:
orientation=
"vertical
"
android:visibility=
"gone"
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"UseCompoundDrawables"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:src=
"@mipmap/queshengye"
tools:ignore=
"ContentDescription"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"16dp"
android:text=
"File no found"
android:textColor=
"@color/black"
android:textSize=
"16sp"
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
</FrameLayout>
</LinearLayout>
\ No newline at end of file
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