-
Notifications
You must be signed in to change notification settings - Fork 45
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
Set initial selected item or view #5
Comments
try to see --> #3 |
@chemickypes Thanks, yeah I did and it doesn't work reliably. The library should be able to set a default position (something like |
@jsonfellin mh, sure, you're right! Did you try to use smoothScrollToPosition() method? |
@chemickypes Yeah, see my first comment above. |
@jsonfellin Hey thanx for pointing that out will try to fix it ASAP. @chemickypes hey man I am open for suggestion 😅 |
@jsonfellin Oh sorry, I was confused! I have another question: when do you call this method? I had a similar problem: I put smoothScrollBy() method inside a OnGlobalLayoutListener when data is not already loaded and it's not working. So, I had to wait for the finish of notifyDataSetChanched(). try something like this -->
@adityagohad we have to think about it! |
@adityagohad In my project of HorizontalPicker I put a method in the custom LinerLayout manager :
The first method is inside LinearLayoutManager to scroll to the wanted position and the latter let RecyclerView to scroll (very tiny, 1 px) and select the element. This method is called when you add data in the Horizontal Picker
I don't know if this idea can help @jsonfellin |
@adityagohad Any fix for this issue yet? |
Anyone can solve this issue ? Please give me solution |
@nayankukadiya @paramarthasaha96 @jsonfellin |
@ReeMiXeR Doesn't that assume each view holder has equal width? |
@adityagohad |
I don't see a way to set the initial selected view or item. RecyclerView.smoothScrollToPosition() doesn't seem to scroll to the correct position. Any ideas?
The text was updated successfully, but these errors were encountered: