android.support.test.internal.util.Checks Java Examples

The following examples show how to use android.support.test.internal.util.Checks. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Matchers.java    From redux-android-sample with Apache License 2.0 5 votes vote down vote up
public static Matcher<View> withBGColor(final int color) {
    Checks.checkNotNull(color);
    return new BoundedMatcher<View, View>(View.class) {
        @Override
        public boolean matchesSafely(View view) {
            int currentColor = ((ColorDrawable) view.getBackground()).getColor();
            return color == currentColor;
        }
        @Override
        public void describeTo(Description description) {
            description.appendText("with background color: " + color);
        }
    };
}
 
Example #2
Source File: TestUtils.java    From Scoops with Apache License 2.0 5 votes vote down vote up
public static Matcher<View> withTextColor(final int color) {
    Checks.checkNotNull(color);
    return new BoundedMatcher<View, TextView>(TextView.class) {
        @Override
        public boolean matchesSafely(TextView warning) {
            return color == warning.getCurrentTextColor();
        }
        @Override
        public void describeTo(Description description) {
            description.appendText("with text color: ");
        }
    };
}
 
Example #3
Source File: BasicUITests.java    From restcomm-android-sdk with GNU Affero General Public License v3.0 5 votes vote down vote up
public static Matcher<View> withTextColor(final int color) {
    Checks.checkNotNull(color);
    return new BoundedMatcher<View, TextView>(TextView.class) {
        @Override
        public boolean matchesSafely(TextView textView) {
            return color == textView.getCurrentTextColor();
        }
        @Override
        public void describeTo(Description description) {
            description.appendText("Expected Color: " + color);
        }
    };
}