Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02a14981 authored by Jonathan Klee's avatar Jonathan Klee
Browse files

Scroll up only when new results are showed up

We faced scroll ups during installation of apps.
parent 87b5a538
Loading
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -189,6 +189,7 @@ class SearchFragment :
            }
            updateSearchResult(listAdapter, apps ?: emptyList())
            observeScrollOfSearchResult(listAdapter)
            scrollToTop()
        }
    }

@@ -231,7 +232,15 @@ class SearchFragment :

        showData()
        listAdapter?.submitList(filteredApps)
    }

    private fun showData() {
        stopLoadingUI()
        noAppsFoundLayout?.visibility = View.GONE
        searchHintLayout?.visibility = View.GONE
    }

    private fun scrollToTop() {
        // Scroll to the top with some delays so that the recycler view has the time
        // to process the new results
        recyclerView?.postDelayed(
@@ -240,12 +249,6 @@ class SearchFragment :
        )
    }

    private fun showData() {
        stopLoadingUI()
        noAppsFoundLayout?.visibility = View.GONE
        searchHintLayout?.visibility = View.GONE
    }

    private fun setupSearchResult(view: View): ApplicationListRVAdapter? {
        val listAdapter = findNavController().currentDestination?.id?.let {
            ApplicationListRVAdapter(