List of usage examples for android.view ViewStub getInflatedId
@IdRes public int getInflatedId()
From source file:android.support.design.widget.BaseDynamicCoordinatorLayoutTest.java
/** * Inflates the <code>ViewStub</code> with the passed layout resource. *///from ww w. j a va 2s . c o m protected ViewAction inflateViewStub(final @LayoutRes int layoutResId) { return new ViewAction() { @Override public Matcher<View> getConstraints() { return allOf(isAssignableFrom(ViewStub.class), hasParent()); } @Override public String getDescription() { return "Inflates view stub"; } @Override public void perform(UiController uiController, View view) { uiController.loopMainThreadUntilIdle(); ViewStub viewStub = (ViewStub) view; viewStub.setLayoutResource(layoutResId); viewStub.inflate(); mCoordinatorLayout = (CoordinatorLayout) mActivityTestRule.getActivity() .findViewById(viewStub.getInflatedId()); uiController.loopMainThreadUntilIdle(); } }; }