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

Commit 5f07c07e authored by Jonathan Klee's avatar Jonathan Klee
Browse files

Merge branch '2998-u-fix-scroll-up' into 'main'

Scroll up only when new results are showed up

See merge request !545
parents c6ed8b44 02a14981
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(