diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/module/ModuleViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/module/ModuleViewModel.kt index 728150575..22261169e 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/module/ModuleViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/redesign/module/ModuleViewModel.kt @@ -122,9 +122,8 @@ class ModuleViewModel( moveToState() } - fun loadRemoteImplicit() = downloadRepos() - .observeOn(AndroidSchedulers.mainThread()) - .doOnComplete { items.clear(); itemsSearch.clear() } + fun loadRemoteImplicit() = let { items.clear(); itemsSearch.clear() } + .run { downloadRepos() } .applyViewModel(this, false) .subscribeK { refresh(); submitQuery() } .add() diff --git a/app/src/main/res/layout/fragment_module_md2.xml b/app/src/main/res/layout/fragment_module_md2.xml index 5387c7b84..4bcc577b1 100644 --- a/app/src/main/res/layout/fragment_module_md2.xml +++ b/app/src/main/res/layout/fragment_module_md2.xml @@ -24,7 +24,7 @@ adapter="@{viewModel.adapter}" dividerHorizontal="@{R.drawable.divider_l1}" dividerVertical="@{R.drawable.divider_l1}" - gone="@{viewModel.loading}" + gone="@{viewModel.loading && viewModel.items.empty}" itemBinding="@{viewModel.itemBinding}" items="@{viewModel.items}" android:layout_width="match_parent" @@ -71,7 +71,7 @@