diff --git a/app/src/main/java/app/olauncher/MainViewModel.kt b/app/src/main/java/app/olauncher/MainViewModel.kt index 0a31d27b..b84ad29c 100644 --- a/app/src/main/java/app/olauncher/MainViewModel.kt +++ b/app/src/main/java/app/olauncher/MainViewModel.kt @@ -24,8 +24,8 @@ class MainViewModel(application: Application) : AndroidViewModel(application) { val refreshHome = MutableLiveData() val toggleDateTime = MutableLiveData() val updateSwipeApps = MutableLiveData() - val appList = MutableLiveData>() - val hiddenApps = MutableLiveData>() + val appList = MutableLiveData?>() + val hiddenApps = MutableLiveData?>() val isOlauncherDefault = MutableLiveData() val launcherResetFailed = MutableLiveData() val homeAppAlignment = MutableLiveData() @@ -133,7 +133,6 @@ class MainViewModel(application: Application) : AndroidViewModel(application) { val activityInfo = launcher.getActivityList(packageName, userHandle) val component = if (activityClassName.isNullOrBlank()) { - // TODO: Handle multiple launch activities in an app. This is NOT the way. // activityClassName will be null for hidden apps. when (activityInfo.size) { 0 -> { diff --git a/app/src/main/java/app/olauncher/ui/AppDrawerFragment.kt b/app/src/main/java/app/olauncher/ui/AppDrawerFragment.kt index 185bff84..029a7daf 100644 --- a/app/src/main/java/app/olauncher/ui/AppDrawerFragment.kt +++ b/app/src/main/java/app/olauncher/ui/AppDrawerFragment.kt @@ -113,8 +113,10 @@ class AppDrawerFragment : Fragment() { }) viewModel.appList.observe(viewLifecycleOwner, Observer { - if (flag == Constants.FLAG_HIDDEN_APPS) return@Observer - if (it == appAdapter.appsList) return@Observer + if (it == null + || it == appAdapter.appsList + || flag == Constants.FLAG_HIDDEN_APPS + ) return@Observer populateAppList(it, appAdapter) })