Commit c5de749d authored by wanglei's avatar wanglei

...

parent 679de6ea
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
<activity <activity
android:name=".activity.SplashActivity" android:name=".activity.SplashActivity"
android:exported="true" android:exported="true"
android:launchMode="singleTask"> android:launchMode="singleTask"
android:theme="@style/splash.theme">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
......
...@@ -87,6 +87,7 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() { ...@@ -87,6 +87,7 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
} }
} }
@SuppressLint("SetTextI18n")
override fun initListener() { override fun initListener() {
binding.flBack.setOnClickListener { binding.flBack.setOnClickListener {
onBackPressedDispatcher.onBackPressed() onBackPressedDispatcher.onBackPressed()
...@@ -120,7 +121,11 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() { ...@@ -120,7 +121,11 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
} }
}.await() }.await()
launch(Dispatchers.Main) { launch(Dispatchers.Main) {
binding.tvClean.text = "CLEAN"
screenShotAdapter.removeData(files) screenShotAdapter.removeData(files)
val split = screenShotAdapter.getAllData().sumOf { it.file.length() }.toFormatSize().split(" ")
binding.tvSize.text = split[0]
binding.tvUnit.text = split[1]
} }
} }
} }
......
...@@ -25,6 +25,7 @@ import com.base.datarecovery.view.DialogViews.showGerPermission ...@@ -25,6 +25,7 @@ import com.base.datarecovery.view.DialogViews.showGerPermission
import com.base.datarecovery.view.FileScanDialog import com.base.datarecovery.view.FileScanDialog
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.channels.BufferOverflow import kotlinx.coroutines.channels.BufferOverflow
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
......
...@@ -18,7 +18,7 @@ class ScreenShotAdapter( ...@@ -18,7 +18,7 @@ class ScreenShotAdapter(
val select: (size: Int) -> Unit val select: (size: Int) -> Unit
) : RecyclerView.Adapter<ScreenShotAdapter.SSS>() { ) : RecyclerView.Adapter<ScreenShotAdapter.SSS>() {
private var beans = arrayListOf<ScreenshotBean>() var beans = arrayListOf<ScreenshotBean>()
inner class SSS(view: View) : ViewHolder(view) inner class SSS(view: View) : ViewHolder(view)
...@@ -106,6 +106,11 @@ class ScreenShotAdapter( ...@@ -106,6 +106,11 @@ class ScreenShotAdapter(
bean.screenPhotoBean.filter { it.isSelect } bean.screenPhotoBean.filter { it.isSelect }
} }
} }
fun getAllData(): List<ScreenPhotoBean> {
return beans.flatMap { bean ->
bean.screenPhotoBean
}
}
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
fun removeData(files: List<ScreenPhotoBean>) { fun removeData(files: List<ScreenPhotoBean>) {
......
...@@ -5,6 +5,7 @@ import android.util.Log ...@@ -5,6 +5,7 @@ import android.util.Log
import com.base.datarecovery.utils.LogEx import com.base.datarecovery.utils.LogEx
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.io.File import java.io.File
...@@ -25,7 +26,7 @@ object FileHelp { ...@@ -25,7 +26,7 @@ object FileHelp {
onDo: ((file: File) -> Unit)? = null, onDo: ((file: File) -> Unit)? = null,
onFinish: (() -> Unit)? = null onFinish: (() -> Unit)? = null
) = launch(Dispatchers.IO) { ) = launch(Dispatchers.IO) {
delay(1000)
var size = 0 var size = 0
//添加第一层文件到链表 //添加第一层文件到链表
......
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="#EFEFEF">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_top" android:id="@+id/cl_top"
......
...@@ -21,4 +21,9 @@ ...@@ -21,4 +21,9 @@
<item name="android:backgroundDimEnabled">false</item> <item name="android:backgroundDimEnabled">false</item>
</style> </style>
<style name="splash.theme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowBackground">@drawable/splash_bp</item>
<item name="android:windowFullscreen">false</item>
</style>
</resources> </resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment