本文整理匯總了Java中android.support.test.espresso.Espresso.closeSoftKeyboard方法的典型用法代碼示例。如果您正苦於以下問題:Java Espresso.closeSoftKeyboard方法的具體用法?Java Espresso.closeSoftKeyboard怎麽用?Java Espresso.closeSoftKeyboard使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.test.espresso.Espresso
的用法示例。
在下文中一共展示了Espresso.closeSoftKeyboard方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createAccount_accountAppearsOnList
import android.support.test.espresso.Espresso; //導入方法依賴的package包/類
@Test
public void createAccount_accountAppearsOnList() {
openCreateAccountActivity();
// when typed account name
onView(withId(R.id.account_name_edit_text)).perform(typeText(ACCOUNT_1_NAME));
Espresso.closeSoftKeyboard();
// and click save fab
onView(withId(R.id.save_account_fab)).perform(click());
// then screen should close
onView(withId(R.id.account_name_edit_text)).check(doesNotExist());
// and account name should be visible on list
// todo add check
}
示例2: performStartAdventure
import android.support.test.espresso.Espresso; //導入方法依賴的package包/類
protected void performStartAdventure() {
ViewInteraction button = onView(allOf(withText(getString(R.string.create_new_adventure)), isDisplayed()));
button.perform(click());
//Clicks over the proper book using the property order of the GamebookEnum
DataInteraction textView = onData(anything())
.inAdapterView(allOf(withId(R.id.gamebookListView),
childAtPosition(
withClassName(is("android.widget.RelativeLayout")),
0)))
.atPosition(getGamebook().getOrder() - 1);
textView.perform(click());
button = onView(allOf(withText(getString(R.string.create_new_adventure)), isDisplayed()));
button.perform(click());
Espresso.closeSoftKeyboard();
}
示例3: addImage
import android.support.test.espresso.Espresso; //導入方法依賴的package包/類
@Test
public void addImage() {
Intent resultData = new Intent();
Bitmap icon = BitmapFactory.decodeResource(getInstrumentation().getContext().getResources(),
R.drawable.mock_camera_image);
resultData.putExtra("data", icon);
Instrumentation.ActivityResult result =
new Instrumentation.ActivityResult(Activity.RESULT_OK, resultData);
intending(not(isInternal())).respondWith(result);
Espresso.closeSoftKeyboard();
onView(withId(R.id.imageOpacityOverlay)).perform(click());
onView(withId(R.id.imageOpacityOverlay)).check(matches(not(isDisplayed())));
onView(withId(R.id.imageDelete)).perform(click());
onView(withId(R.id.imageOpacityOverlay)).check(matches(isDisplayed()));
}