-
Notifications
You must be signed in to change notification settings - Fork 360
/
Action.java
32 lines (24 loc) · 946 Bytes
/
Action.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.beloo.widget.chipslayoutmanager.util;
import android.support.test.espresso.UiController;
import android.support.test.espresso.ViewAction;
import android.view.View;
import org.hamcrest.Matcher;
import static android.support.test.espresso.matcher.ViewMatchers.isAssignableFrom;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static org.hamcrest.Matchers.allOf;
public abstract class Action<T extends View> implements ViewAction {
@Override
public Matcher<View> getConstraints() {
return allOf(isAssignableFrom(View.class), isDisplayed());
}
@Override
public String getDescription() {
return "action " + this.getClass().getSimpleName();
}
@Override
public final void perform(UiController uiController, View view) {
performAction(uiController, (T) view);
}
public void performAction(UiController uiController, T view) {
}
}