Commit 22043554 authored by wanglei's avatar wanglei

...

parent cad4c425
...@@ -59,6 +59,7 @@ class HomeFragment : BaseFragment<FragmentHome3Binding>() { ...@@ -59,6 +59,7 @@ class HomeFragment : BaseFragment<FragmentHome3Binding>() {
} }
} }
} }
showStorage()
} }
override fun setListener() { override fun setListener() {
...@@ -113,6 +114,11 @@ class HomeFragment : BaseFragment<FragmentHome3Binding>() { ...@@ -113,6 +114,11 @@ class HomeFragment : BaseFragment<FragmentHome3Binding>() {
super.onResume() super.onResume()
binding.lottie.resumeAnimation() binding.lottie.resumeAnimation()
if (requireContext().checkStorePermission()) { if (requireContext().checkStorePermission()) {
}
}
@SuppressLint("SetTextI18n")
fun showStorage() {
binding.llStorage.visibility = View.VISIBLE binding.llStorage.visibility = View.VISIBLE
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
...@@ -135,9 +141,6 @@ class HomeFragment : BaseFragment<FragmentHome3Binding>() { ...@@ -135,9 +141,6 @@ class HomeFragment : BaseFragment<FragmentHome3Binding>() {
val usedSize = ((stat1.totalBytes + stat2.totalBytes) - (stat1.availableBytes + stat2.availableBytes)).toFormatSize() val usedSize = ((stat1.totalBytes + stat2.totalBytes) - (stat1.availableBytes + stat2.availableBytes)).toFormatSize()
binding.tvStorage.text = "$usedSize / $totalSize" binding.tvStorage.text = "$usedSize / $totalSize"
} }
}
} }
} }
\ 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