Commit c5de749d authored by wanglei's avatar wanglei

...

parent 679de6ea
......@@ -34,7 +34,8 @@
<activity
android:name=".activity.SplashActivity"
android:exported="true"
android:launchMode="singleTask">
android:launchMode="singleTask"
android:theme="@style/splash.theme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......
......@@ -87,6 +87,7 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
}
}
@SuppressLint("SetTextI18n")
override fun initListener() {
binding.flBack.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
......@@ -120,7 +121,11 @@ class ScreenShotActivity : BaseActivity<ActivityScreenShotBinding>() {
}
}.await()
launch(Dispatchers.Main) {
binding.tvClean.text = "CLEAN"
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
import com.base.datarecovery.view.FileScanDialog
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.channels.BufferOverflow
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.launch
......
......@@ -18,7 +18,7 @@ class ScreenShotAdapter(
val select: (size: Int) -> Unit
) : RecyclerView.Adapter<ScreenShotAdapter.SSS>() {
private var beans = arrayListOf<ScreenshotBean>()
var beans = arrayListOf<ScreenshotBean>()
inner class SSS(view: View) : ViewHolder(view)
......@@ -106,6 +106,11 @@ class ScreenShotAdapter(
bean.screenPhotoBean.filter { it.isSelect }
}
}
fun getAllData(): List<ScreenPhotoBean> {
return beans.flatMap { bean ->
bean.screenPhotoBean
}
}
@SuppressLint("NotifyDataSetChanged")
fun removeData(files: List<ScreenPhotoBean>) {
......
......@@ -5,6 +5,7 @@ import android.util.Log
import com.base.datarecovery.utils.LogEx
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.launch
import java.io.File
......@@ -25,7 +26,7 @@ object FileHelp {
onDo: ((file: File) -> Unit)? = null,
onFinish: (() -> Unit)? = null
) = launch(Dispatchers.IO) {
delay(1000)
var size = 0
//添加第一层文件到链表
......
......@@ -3,7 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="#EFEFEF">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_top"
......
......@@ -21,4 +21,9 @@
<item name="android:backgroundDimEnabled">false</item>
</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>
\ 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