Commit b744bb0a authored by Viktor De Pasquale's avatar Viktor De Pasquale

Fixed loading showing in incorrect view-states

parent 0f140b40
......@@ -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()
......
......@@ -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 @@
</com.google.android.material.circularreveal.cardview.CircularRevealCardView>
<LinearLayout
goneUnless="@{viewModel.loading}"
goneUnless="@{viewModel.loading &amp;&amp; viewModel.items.empty}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
......
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