From a2f5f217d5b6585b06bfdb0385a50a1cfee26e1c Mon Sep 17 00:00:00 2001 From: Matt Fenlon Date: Fri, 19 Jul 2019 14:15:48 -0400 Subject: [PATCH] Disable swipeToRefresh until first query --- .../bigfig/roma/components/search/fragments/SearchFragment.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/tech/bigfig/roma/components/search/fragments/SearchFragment.kt b/app/src/main/java/tech/bigfig/roma/components/search/fragments/SearchFragment.kt index f61aa61353..bbf1397bb6 100644 --- a/app/src/main/java/tech/bigfig/roma/components/search/fragments/SearchFragment.kt +++ b/app/src/main/java/tech/bigfig/roma/components/search/fragments/SearchFragment.kt @@ -61,6 +61,7 @@ abstract class SearchFragment : Fragment(), } private fun setupSwipeRefreshLayout() { + swipeRefreshLayout.isEnabled = false swipeRefreshLayout.setOnRefreshListener(this) swipeRefreshLayout.setColorSchemeResources(R.color.roma_blue) swipeRefreshLayout.setProgressBackgroundColorSchemeColor( @@ -70,6 +71,7 @@ abstract class SearchFragment : Fragment(), private fun subscribeObservables() { data.observe(viewLifecycleOwner, Observer { + if (!swipeRefreshLayout.isEnabled) swipeRefreshLayout.isEnabled = true adapter.submitList(it) })