use of android.support.test.espresso.UiController in project collect by opendatakit.
the class AllWidgetsFormTest method setProgress.
public static ViewAction setProgress(final int progress) {
return new ViewAction() {
@Override
public void perform(UiController uiController, View view) {
SeekBar seekBar = (SeekBar) view;
seekBar.setProgress(progress);
}
@Override
public String getDescription() {
return "Set a progress on a SeekBar";
}
@Override
public Matcher<View> getConstraints() {
return ViewMatchers.isAssignableFrom(SeekBar.class);
}
};
}
use of android.support.test.espresso.UiController in project Rocket by mozilla-tw.
the class RecyclerViewTestUtils method clickChildViewWithId.
public static ViewAction clickChildViewWithId(final int id) {
return new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return null;
}
@Override
public String getDescription() {
return "Click on a child view with specified id.";
}
@Override
public void perform(UiController uiController, View view) {
View v = view.findViewById(id);
v.performClick();
}
};
}
use of android.support.test.espresso.UiController in project openhab-android by openhab.
the class BasicWidgetTest method onChildView.
public static ViewAction onChildView(final ViewAction action, @IdRes final int targetViewId) {
return new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return null;
}
@Override
public String getDescription() {
return null;
}
@Override
public void perform(UiController uiController, View view) {
View v = view.findViewById(targetViewId);
action.perform(uiController, v);
}
};
}
use of android.support.test.espresso.UiController in project orgzly-android by orgzly.
the class EspressoUtils method closeSoftKeyboardWithDelay.
/**
* Give keyboard time to close, to avoid java.lang.SecurityException
* if hidden button is clicked next.
*/
static ViewAction closeSoftKeyboardWithDelay() {
return new ViewAction() {
/**
* The delay time to allow the soft keyboard to dismiss.
*/
private static final long KEYBOARD_DISMISSAL_DELAY_MILLIS = 1000L;
/**
* The real {@link CloseKeyboardAction} instance.
*/
private final ViewAction mCloseSoftKeyboard = new CloseKeyboardAction();
@Override
public Matcher<View> getConstraints() {
return mCloseSoftKeyboard.getConstraints();
}
@Override
public String getDescription() {
return mCloseSoftKeyboard.getDescription();
}
@Override
public void perform(final UiController uiController, final View view) {
mCloseSoftKeyboard.perform(uiController, view);
uiController.loopMainThreadForAtLeast(KEYBOARD_DISMISSAL_DELAY_MILLIS);
}
};
}
use of android.support.test.espresso.UiController in project apps-android-wikipedia by wikimedia.
the class ViewTools method clickChildViewWithId.
public static ViewAction clickChildViewWithId(final int id) {
return new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return null;
}
@Override
public String getDescription() {
return "Click on a child view with specified id.";
}
@Override
public void perform(UiController uiController, View view) {
View v = view.findViewById(id);
v.performClick();
}
};
}
Aggregations