TypeTextAction

public final class TypeTextAction
extends Object implements ViewAction

java.lang.Object
   ↳ android.support.test.espresso.action.TypeTextAction


启用在视图上键入文字。

Summary

Public constructors

TypeTextAction(String stringToBeTyped)

用给定的字符串构造 TypeTextAction

TypeTextAction(String stringToBeTyped, boolean tapToFocus)

用给定的字符串构造 TypeTextAction

Public methods

Matcher<View> getConstraints()

ViewActions的一种机制来指定它们可以操作的视图类型。

String getDescription()

返回视图操作的描述。

void perform(UiController uiController, View view)

在给定视图上执行此操作。

Inherited methods

From class java.lang.Object
From interface android.support.test.espresso.ViewAction

Public constructors

TypeTextAction

TypeTextAction (String stringToBeTyped)

用给定的字符串构造TypeTextAction 如果字符串为空,则会导致无操作(无法输入任何内容)。 默认情况下,此操作会在点击之前将点击事件发送到视图的中心以获得焦点。

Parameters
stringToBeTyped String: String To be typed by TypeTextAction

TypeTextAction

TypeTextAction (String stringToBeTyped, 
                boolean tapToFocus)

用给定的字符串构造TypeTextAction 如果字符串为空,则会导致无操作(无法输入任何内容)。

Parameters
stringToBeTyped String: String To be typed by TypeTextAction
tapToFocus boolean: indicates whether a tap should be sent to the underlying view before typing.

Public methods

getConstraints

Matcher<View> getConstraints ()

ViewActions的一种机制来指定它们可以操作的视图类型。 ViewAction可以要求传递的视图符合某些约束。 例如,它可能希望确保视图已经在设备的可视物理屏幕中或具有某种类型。

Returns
Matcher<View> a Matcher that will be tested prior to calling perform.

getDescription

String getDescription ()

返回视图操作的描述。 描述不应该太长,并且应该很好地适用于以下这样的句子:“对带ID的视图执行%description%动作...”

Returns
String

perform

void perform (UiController uiController, 
                View view)

在给定视图上执行此操作。

Parameters
uiController UiController: the controller to use to interact with the UI.
view View: the view to act upon. never null.