From 561ab43e97c72e93f39925df7532311d58952bfe Mon Sep 17 00:00:00 2001 From: Joshua Kuestersteffen Date: Tue, 2 Nov 2021 09:00:55 -0500 Subject: [PATCH] Load the installed apps in IO thread on resume (#95) --- .../java/com/sduduzog/slimlauncher/ui/main/HomeFragment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/sduduzog/slimlauncher/ui/main/HomeFragment.kt b/app/src/main/java/com/sduduzog/slimlauncher/ui/main/HomeFragment.kt index 025a2cef..dc0e7129 100644 --- a/app/src/main/java/com/sduduzog/slimlauncher/ui/main/HomeFragment.kt +++ b/app/src/main/java/com/sduduzog/slimlauncher/ui/main/HomeFragment.kt @@ -27,6 +27,7 @@ import com.sduduzog.slimlauncher.utils.BaseFragment import com.sduduzog.slimlauncher.utils.OnLaunchAppListener import dagger.hilt.android.AndroidEntryPoint import kotlinx.android.synthetic.main.home_fragment.* +import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import java.text.DateFormat import java.text.SimpleDateFormat @@ -88,7 +89,7 @@ class HomeFragment(private val viewModel: MainViewModel) : BaseFragment(), OnLau super.onResume() updateClock() - lifecycleScope.launch { + lifecycleScope.launch(Dispatchers.IO) { getUnlauncherDataSource().unlauncherAppsRepo.setApps(getInstalledApps()) } if (!::appDrawerAdapter.isInitialized) {