Commit 4a7d3e92 authored by wanglei's avatar wanglei

Merge remote-tracking branch 'origin/master'

parents 1dece1ec a30abc7d
...@@ -4,8 +4,9 @@ package com.base.scanqrclear.luma ...@@ -4,8 +4,9 @@ package com.base.scanqrclear.luma
import android.animation.AnimatorSet import android.animation.AnimatorSet
import android.animation.ObjectAnimator import android.animation.ObjectAnimator
import android.animation.ValueAnimator import android.animation.ValueAnimator
import android.annotation.SuppressLint
import android.os.Bundle import android.os.Bundle
import android.text.SpannableString
import android.text.style.AbsoluteSizeSpan
import android.view.View import android.view.View
import android.view.animation.LinearInterpolator import android.view.animation.LinearInterpolator
import androidx.core.animation.doOnEnd import androidx.core.animation.doOnEnd
...@@ -147,6 +148,21 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl ...@@ -147,6 +148,21 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
AnimationHelps.progress(binding.pbMemoryUsed, usedMemoryUsedScale.toInt()) AnimationHelps.progress(binding.pbMemoryUsed, usedMemoryUsedScale.toInt())
} }
} }
lifecycleScope.launch(Dispatchers.IO) {
val emptyFoldersDeferred = async { FileHelps.findEmptyFolders(lifecycleScope) }
val filesDeferred = async { MediaHelps.findSpecifiedFiles(requireContext()) }
val emptyFolder = emptyFoldersDeferred.await()
val files = filesDeferred.await()
val emptyLength = emptyFolder.sumOf { it.length }
val filesLength = files.sumOf { it.length }
val totalLength = emptyLength + filesLength
val totalSize = Utils.getSize(totalLength)
withContext(Dispatchers.Main) {
val sp= SpannableString("$totalSize\n${getString(R.string.junk_files)}")
sp.setSpan(AbsoluteSizeSpan(16,true),sp.indexOf("\n"),sp.length,SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE)
binding.tvJunkFiles.text = sp
}
}
} }
private fun showDay() { private fun showDay() {
......
...@@ -174,6 +174,7 @@ ...@@ -174,6 +174,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/junk_files" android:text="@string/junk_files"
android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="20sp" android:textSize="20sp"
android:textStyle="bold" android:textStyle="bold"
......
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