Loading app/src/main/java/foundation/e/apps/ui/search/SearchFragment.kt +11 −4 Original line number Diff line number Diff line Loading @@ -119,9 +119,13 @@ class SearchFragment : authObjects.observe(viewLifecycleOwner) { val currentQuery = searchView?.query?.toString() ?: "" if (it == null || shouldIgnore(it, currentQuery)) { showData() return@observe } val applicationListRVAdapter = recyclerView?.adapter as ApplicationListRVAdapter applicationListRVAdapter.setData(mutableListOf()) loadDataWhenNetworkAvailable(it) } Loading Loading @@ -187,11 +191,15 @@ class SearchFragment : return false } showData() listAdapter?.setData(appList!!) return true } private fun showData() { stopLoadingUI() noAppsFoundLayout?.visibility = View.GONE searchHintLayout?.visibility = View.GONE listAdapter?.setData(appList!!) return true } private fun setupSearchResult(view: View): ApplicationListRVAdapter? { Loading Loading @@ -373,6 +381,7 @@ class SearchFragment : if (text.isNotEmpty()) { hideKeyboard(activity as Activity) } view?.requestFocus() searchHintLayout?.visibility = View.GONE shimmerLayout?.visibility = View.VISIBLE Loading @@ -381,8 +390,6 @@ class SearchFragment : * Set the search text and call for network result. */ searchText = text val applicationListRVAdapter = recyclerView?.adapter as ApplicationListRVAdapter applicationListRVAdapter.setData(mutableListOf()) repostAuthObjects() } return false Loading app/src/main/java/foundation/e/apps/ui/search/SearchViewModel.kt +4 −0 Original line number Diff line number Diff line Loading @@ -130,4 +130,8 @@ class SearchViewModel @Inject constructor( fun isAuthObjectListSame(authObjectList: List<AuthObject>?): Boolean { return lastAuthObjects == authObjectList } fun isSearchResultAvailable(): Boolean { return searchResult.value?.data?.first?.isNotEmpty() == true } } Loading
app/src/main/java/foundation/e/apps/ui/search/SearchFragment.kt +11 −4 Original line number Diff line number Diff line Loading @@ -119,9 +119,13 @@ class SearchFragment : authObjects.observe(viewLifecycleOwner) { val currentQuery = searchView?.query?.toString() ?: "" if (it == null || shouldIgnore(it, currentQuery)) { showData() return@observe } val applicationListRVAdapter = recyclerView?.adapter as ApplicationListRVAdapter applicationListRVAdapter.setData(mutableListOf()) loadDataWhenNetworkAvailable(it) } Loading Loading @@ -187,11 +191,15 @@ class SearchFragment : return false } showData() listAdapter?.setData(appList!!) return true } private fun showData() { stopLoadingUI() noAppsFoundLayout?.visibility = View.GONE searchHintLayout?.visibility = View.GONE listAdapter?.setData(appList!!) return true } private fun setupSearchResult(view: View): ApplicationListRVAdapter? { Loading Loading @@ -373,6 +381,7 @@ class SearchFragment : if (text.isNotEmpty()) { hideKeyboard(activity as Activity) } view?.requestFocus() searchHintLayout?.visibility = View.GONE shimmerLayout?.visibility = View.VISIBLE Loading @@ -381,8 +390,6 @@ class SearchFragment : * Set the search text and call for network result. */ searchText = text val applicationListRVAdapter = recyclerView?.adapter as ApplicationListRVAdapter applicationListRVAdapter.setData(mutableListOf()) repostAuthObjects() } return false Loading
app/src/main/java/foundation/e/apps/ui/search/SearchViewModel.kt +4 −0 Original line number Diff line number Diff line Loading @@ -130,4 +130,8 @@ class SearchViewModel @Inject constructor( fun isAuthObjectListSame(authObjectList: List<AuthObject>?): Boolean { return lastAuthObjects == authObjectList } fun isSearchResultAvailable(): Boolean { return searchResult.value?.data?.first?.isNotEmpty() == true } }