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

Commit 340e49ca authored by narinder Rana's avatar narinder Rana
Browse files

search recycler scrollToPosition after DataObserver

parent e50bf24c
Loading
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -193,7 +193,11 @@ class SearchFragment :
                recyclerView?.visibility = View.VISIBLE
                noAppsFoundLayout?.visibility = View.GONE
            }
            recyclerView!!.postDelayed(Runnable { kotlin.run { recyclerView!!.scrollToPosition(0) } }, 1000)
            listAdapter?.registerAdapterDataObserver(object: RecyclerView.AdapterDataObserver() {
                override fun onItemRangeInserted(positionStart: Int, itemCount: Int) {
                    recyclerView!!.scrollToPosition(0)
                }
            })
        }
    }