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

scrollList does not work when listView.getCount()==1 #587

Open
renas opened this issue Aug 20, 2015 · 1 comment
Open

scrollList does not work when listView.getCount()==1 #587

renas opened this issue Aug 20, 2015 · 1 comment

Comments

@renas
Copy link
Contributor

renas commented Aug 20, 2015

From andrew...@126.com on August 27, 2013 06:26:21

What steps will reproduce the problem? when i use scrollListToBottom ,the API does not work for me What is the expected output? What do you see instead? scroll the listview to bottom ,nothing happened What version of the product are you using? On what operating system? robotium 4.1 . Mac OSX 10.7.6

when i observe the source code ,i found that when listView.getCount==1 ,the scrollList will not work
see the source code here:
if (allTheWay) {
scrollListToLine(absListView, absListView.getCount() - 1);
return false;
}
if (absListView.getLastVisiblePosition() >= absListView.getCount() - 1) {
scrollListToLine(absListView,
absListView.getLastVisiblePosition());
return false;
}

        if (absListView.getFirstVisiblePosition() != absListView
                .getLastVisiblePosition())
            scrollListToLine(absListView,
                    absListView.getLastVisiblePosition());

        else
            scrollListToLine(absListView,
                    absListView.getFirstVisiblePosition() + 1);

when getCount==1,then will goto scrollListToLine(absListView, 0),and will not scroll

m solution:add the following code
if(absListView.getCount() == 1){
absListView.smoothScrollToPosition(1);
}
then the listview can scroll to bottom

would you have some suggestions to deal with this situation??
wish your reply!!thank you!

Original issue: http://code.google.com/p/robotium/issues/detail?id=508

@renas
Copy link
Contributor Author

renas commented Aug 20, 2015

From renasr...@gmail.com on August 27, 2013 08:01:35

Thanks for reporting this. Lets see what we can do.

Status: Accepted
Owner: renasr...@gmail.com

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

1 participant