use of android.support.test.espresso.ViewAction in project material-components-android by material-components.
the class CollapsingToolbarLayoutActions method setContentScrimColor.
public static ViewAction setContentScrimColor(@ColorInt final int color) {
return new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return isDisplayed();
}
@Override
public String getDescription() {
return "Set the content scrim to a color";
}
@Override
public void perform(UiController uiController, View view) {
uiController.loopMainThreadUntilIdle();
CollapsingToolbarLayout ctl = (CollapsingToolbarLayout) view;
ctl.setContentScrimColor(color);
uiController.loopMainThreadUntilIdle();
}
};
}
use of android.support.test.espresso.ViewAction in project material-components-android by material-components.
the class FloatingActionButtonActions method setBackgroundTintList.
public static ViewAction setBackgroundTintList(@ColorInt final ColorStateList tint) {
return new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return isAssignableFrom(FloatingActionButton.class);
}
@Override
public String getDescription() {
return "Sets FloatingActionButton background tint";
}
@Override
public void perform(UiController uiController, View view) {
uiController.loopMainThreadUntilIdle();
final FloatingActionButton fab = (FloatingActionButton) view;
fab.setBackgroundTintList(tint);
uiController.loopMainThreadUntilIdle();
}
};
}
use of android.support.test.espresso.ViewAction in project material-components-android by material-components.
the class FloatingActionButtonActions method setCompatElevation.
public static ViewAction setCompatElevation(final float size) {
return new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return isAssignableFrom(FloatingActionButton.class);
}
@Override
public String getDescription() {
return "Sets FloatingActionButton elevation";
}
@Override
public void perform(UiController uiController, View view) {
uiController.loopMainThreadUntilIdle();
final FloatingActionButton fab = (FloatingActionButton) view;
fab.setCompatElevation(size);
uiController.loopMainThreadUntilIdle();
}
};
}
use of android.support.test.espresso.ViewAction in project material-components-android by material-components.
the class NavigationViewActions method setItemTextAppearance.
/** Sets item text appearance on the content of the navigation view. */
public static ViewAction setItemTextAppearance(@StyleRes final int resId) {
return new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return isDisplayed();
}
@Override
public String getDescription() {
return "Set item text appearance";
}
@Override
public void perform(UiController uiController, View view) {
uiController.loopMainThreadUntilIdle();
NavigationView navigationView = (NavigationView) view;
navigationView.setItemTextAppearance(resId);
uiController.loopMainThreadUntilIdle();
}
};
}
use of android.support.test.espresso.ViewAction in project material-components-android by material-components.
the class NavigationViewActions method setItemIconTintList.
/** Sets item icon tint list on the content of the navigation view. */
public static ViewAction setItemIconTintList(@Nullable final ColorStateList tint) {
return new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return isDisplayed();
}
@Override
public String getDescription() {
return "Set item icon tint list";
}
@Override
public void perform(UiController uiController, View view) {
uiController.loopMainThreadUntilIdle();
NavigationView navigationView = (NavigationView) view;
navigationView.setItemIconTintList(tint);
uiController.loopMainThreadUntilIdle();
}
};
}
Aggregations