In RecycleView with Realm data, I need to detect the last item currently see through scrolling. So I added the listener so that RecycleView can check onScrolled.
Expected Results
Detecting onScrolled method
Actual Results
onScrolled is not called.. How do I detect OnScrolled in RecycleView with RealmRecyclerViewAdapter??
Code Sample
receivedAdapter = TestListAdapter(this@NotificationsActivity, receivedNotiRealmResults)
recyclerView.adapter = receivedAdapter
recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
//TODO: check. but is not called.
}
})
class TestListAdapter(internal var activity: Activity, data: OrderedRealmCollection<TestNotification>)
: RealmRecyclerViewAdapter<TestNotification, TestListAdapter.MyViewHolder>(data, true) {
....
}
What do you want to achieve?
Expected Results
Actual Results
Code Sample
Version of Realm and tooling
Realm version(s): 10.16.1 and adapter is 4.0.0
Android Studio version: Giraffe 2022.3.1 Patch3
device: Android 12