Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- }
- private static Matcher<View> childAtPosition(
- final Matcher<View> parentMatcher, final int position) {
- return new TypeSafeMatcher<View>() {
- @Override
- public void describeTo(Description description) {
- description.appendText("Child at position " + position + " in parent ");
- parentMatcher.describeTo(description);
- }
- @Override
- public boolean matchesSafely(View view) {
- ViewParent parent = view.getParent();
- return parent instanceof ViewGroup && parentMatcher.matches(parent)
- && view.equals(((ViewGroup) parent).getChildAt(position));
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement