Commit 34704608 authored by 周文华's avatar 周文华

【调整】1.调整部分UI。2.新增存储权限申请时机用以计算清理大小。

parent 9fb5de39
......@@ -73,7 +73,7 @@ object ActivityJumpHelps {
fun requestPermission(
context: Context,
launcher: ActivityLauncher,
block: (() -> Unit?)? = null
block: (() -> Unit)? = null
) {
if (PermissionHelps.checkFilesAccessPermission(context)) {
block?.invoke()
......
......@@ -124,6 +124,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
}
private fun initData() {
ActivityJumpHelps.requestPermission(requireContext(), launcher) {
lifecycleScope.launch(Dispatchers.IO) {
val totalStorage = async { AppHelps.getTotalExternalSize() }
val availableStorage = async { AppHelps.getAvailableExternalSize() }
......@@ -168,6 +169,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(FragmentHomeBinding::infl
}
}
}
}
private fun showDay() {
val installTime = SpUtils.getInstance().getLong(KEY_INSTALL_TIME)
......
......@@ -10,7 +10,7 @@
android:id="@+id/iv_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginTop="10dp"
android:src="@mipmap/icon_junk_scan"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
......
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