Skip to content

Commit

Permalink
Fixed a lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
tanujnotes committed Jan 4, 2023
1 parent eb0c843 commit acf8ec9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions app/src/main/java/app/olauncher/MainViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
val refreshHome = MutableLiveData<Boolean>()
val toggleDateTime = MutableLiveData<Unit>()
val updateSwipeApps = MutableLiveData<Any>()
val appList = MutableLiveData<List<AppModel>>()
val hiddenApps = MutableLiveData<List<AppModel>>()
val appList = MutableLiveData<List<AppModel>?>()
val hiddenApps = MutableLiveData<List<AppModel>?>()
val isOlauncherDefault = MutableLiveData<Boolean>()
val launcherResetFailed = MutableLiveData<Boolean>()
val homeAppAlignment = MutableLiveData<Int>()
Expand Down Expand Up @@ -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 -> {
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/java/app/olauncher/ui/AppDrawerFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

Expand Down

0 comments on commit acf8ec9

Please sign in to comment.