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

smoothScrollToStep & scrollToStep are not working in onCreate ? #12

Open
drmkraja opened this issue Jul 14, 2020 · 2 comments
Open

smoothScrollToStep & scrollToStep are not working in onCreate ? #12

drmkraja opened this issue Jul 14, 2020 · 2 comments

Comments

@drmkraja
Copy link

drmkraja commented Jul 14, 2020

Thanks for the awesome library.
I'm having 10 steps in my app. Current layout only shows 4 steps. I'm assigning currentcount via onCreate(). But I tried smoothScrollToStep to 6. But it is not scrolling to 6th step...

        StatusViewScroller mStatus = findViewById(R.id.status);
        List<String> statusArray = Arrays.asList(getResources().getStringArray(R.array.indiv));
        mStatus.getStatusView().setStatusList(statusArray);
        mStatus.getStatusView().setStepCount(statusArray.size());
        mStatus.getStatusView().setCurrentCount(6);
        mStatus.smoothScrollToStep(6);
@drmkraja drmkraja changed the title smoothScrollToStep & scrollToStep are not working ? smoothScrollToStep & scrollToStep are not working in onCreate ? Jul 15, 2020
@uwemaurer
Copy link

uwemaurer commented Jul 28, 2020

It is a bug. I looked at the code and the problem is that it the scroll positions are using drawingData which only available after onLayout and it also resets after changing a property.

So it only works after onLayout has been called and then only until a property is modified.
(eg if you have a "Next" button then you need to do the scrolling first and then call setCurrentCount after that)

@David-gatria
Copy link

David-gatria commented Nov 5, 2020

Can you do an example?, i have the same trouble! thanks!

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

No branches or pull requests

3 participants