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

hasFocus() not working for ListView in a ViewPager #99

Open
GoogleCodeExporter opened this issue Mar 18, 2015 · 1 comment
Open

hasFocus() not working for ListView in a ViewPager #99

GoogleCodeExporter opened this issue Mar 18, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link
Collaborator

What steps will reproduce the problem?
1. Create a ViewPager with some tabs, each of which contains a Fragment. In 
that Fragment, add a single ListView. 
2. ViewPager will implicitly add a second instance of your ListView for caching 
purposes. 
3. Use onData to point to this ListView in a test. 
4. One of the ListViews will have focus = true; the other will have focus = 
false
5. Using allOf(withId(R.id.LISTVIEWID), hasFocus()) will point to both of the 
ListViews and lead to an Ambiguous view exception, even though one is labeled 
to have focus and the other is labeled to not have focus. 

What is the expected output? What do you see instead?

Since only one of the instances of the ListView has focus, I expect to return 
only one ListView from my allOf() call, but I see an Ambiguous view exception 
instead. 


What version of the product are you using? On what operating system?
Using Espresso 1.1 r-3 on Mavericks. 


Original issue reported on code.google.com by mike.mcg...@indiegogo.com on 3 Oct 2014 at 5:52

@GoogleCodeExporter
Copy link
Collaborator Author

Haven't confirmed for sure, but I'm guessing that at some point (perhaps during 
a transition), both of the lists have focus. Do you mind confirming and perhaps 
providing a code snippet that demonstrates the issue?

Original comment by vale...@google.com on 19 Nov 2014 at 10:58

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