Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto scroll to end postion #130

Open
KingWu opened this issue Oct 13, 2017 · 7 comments
Open

Auto scroll to end postion #130

KingWu opened this issue Oct 13, 2017 · 7 comments

Comments

@KingWu
Copy link

KingWu commented Oct 13, 2017

i load the result from realm and set realm-android-adapters. The recycler view always auto scroll to the end position.

is it default behaviour?

@beeender
Copy link
Contributor

I think it depends on the data changeset. the adapter's behaviour is basically the default behavior from RecyclerView.

You can overwrite those behavior if you want.
See https://github.com/realm/realm-android-adapters/blob/master/adapters/src/main/java/io/realm/RealmRecyclerViewAdapter.java#L44

@jayarajm
Copy link

jayarajm commented Mar 6, 2018

Actually in my project I used RealmRecyclerViewAdapter with header view at first time I load data from WS and update into realm. The particular scenario the recycler view scroll to bottom.

Once the data is stored into realm then it is working correctly.

Can you please check and update us ASAP ?

@cmelchior
Copy link
Contributor

Hi @jayarajm
Can you provide a sample project showing the behaviour?

@Sp4Rx
Copy link

Sp4Rx commented Mar 24, 2018

The RealmRecyclerViewAdapter is updated when data is updated in realm db.
Now I want to scroll to the end of the list when RealmRecyclerViewAdapter is updated (notifyDataSetChanged() is called by OrderedRealmCollectionChangeListener internaly)

Edit
Found a solution add addChangeListener to RealmResults<E>

@lam-amsiq
Copy link

We're having a similar issue where we're adding an item to an empty list. In this case it looks like the adapter inserts and extra row above the other rows. This results in the user not being able to see the new item in the list since it's above the current viewport.

@nickming
Copy link

nickming commented Sep 6, 2018

@lam-amsiq do you know how to solve this problem? @jayarajmI have the same situation as you, had you solved it?

@nickming
Copy link

nickming commented Sep 6, 2018

but I found that if I add header view for the adapter when I notify item changes should add the count of header view for start position

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants