@Test @MediumTest public void testBasicContent() { Builder popupBuilder = new Builder(); popupBuilder.wireToActionButton(); onView(withId(R.id.test_button)).perform(click()); assertNotNull("Popup window created", mListPopupWindow); assertTrue("Popup window showing", mListPopupWindow.isShowing()); final View mainDecorView = mActivityTestRule.getActivity().getWindow().getDecorView(); onView(withText("Alice")) .inRoot(withDecorView(not(is(mainDecorView)))) .check(matches(isDisplayed())); onView(withText("Bob")) .inRoot(withDecorView(not(is(mainDecorView)))) .check(matches(isDisplayed())); onView(withText("Charlie")) .inRoot(withDecorView(not(is(mainDecorView)))) .check(matches(isDisplayed())); onView(withText("Deirdre")) .inRoot(withDecorView(not(is(mainDecorView)))) .check(matches(isDisplayed())); onView(withText("El")) .inRoot(withDecorView(not(is(mainDecorView)))) .check(matches(isDisplayed())); }
@Override public boolean isShowing() { return mPopup.isShowing(); }
ListPopupWindow implements ShowableListMenu { @Override public boolean isShowing() { return mPopup.isShowing(); } }
ListPopupWindow implements ShowableListMenu { @Override public boolean isShowing() { return mPopup.isShowing(); } ListPopupWindow(@NonNull Context context);  ListPopupWindow(@NonNull Context context, @Nullable AttributeSet attrs);  ListPopupWindow(@NonNull Context context, @Nullable AttributeSet attrs,
            @AttrRes int defStyleAttr);  ListPopupWindow(@NonNull Context context, @Nullable AttributeSet attrs,
            @AttrRes int defStyleAttr, @StyleRes int defStyleRes); }
ListPopupWindow implements ShowableListMenu { @Override public boolean isShowing() { return mPopup.isShowing(); } ListPopupWindow(@NonNull Context context);  ListPopupWindow(@NonNull Context context, @Nullable AttributeSet attrs);  ListPopupWindow(@NonNull Context context, @Nullable AttributeSet attrs,
            @AttrRes int defStyleAttr);  ListPopupWindow(@NonNull Context context, @Nullable AttributeSet attrs,
            @AttrRes int defStyleAttr, @StyleRes int defStyleRes); void setAdapter(@Nullable ListAdapter adapter); void setPromptPosition(int position); int getPromptPosition(); void setModal(boolean modal); boolean isModal(); @RestrictTo(LIBRARY_GROUP) void setForceIgnoreOutsideTouch(boolean forceIgnoreOutsideTouch); @RestrictTo(LIBRARY_GROUP) void setDropDownAlwaysVisible(boolean dropDownAlwaysVisible); @RestrictTo(LIBRARY_GROUP) boolean isDropDownAlwaysVisible(); void setSoftInputMode(int mode); int getSoftInputMode(); void setListSelector(Drawable selector); @Nullable Drawable getBackground(); void setBackgroundDrawable(@Nullable Drawable d); void setAnimationStyle(@StyleRes int animationStyle); @StyleRes int getAnimationStyle(); @Nullable View getAnchorView(); void setAnchorView(@Nullable View anchor); int getHorizontalOffset(); void setHorizontalOffset(int offset); int getVerticalOffset(); void setVerticalOffset(int offset); @RestrictTo(LIBRARY_GROUP) void setEpicenterBounds(Rect bounds); void setDropDownGravity(int gravity); int getWidth(); void setWidth(int width); void setContentWidth(int width); int getHeight(); void setHeight(int height); void setWindowLayoutType(int layoutType); void setOnItemClickListener(@Nullable AdapterView.OnItemClickListener clickListener); void setOnItemSelectedListener(@Nullable OnItemSelectedListener selectedListener); void setPromptView(@Nullable View prompt); void postShow(); @Override void show(); @Override void dismiss(); void setOnDismissListener(@Nullable PopupWindow.OnDismissListener listener); void setInputMethodMode(int mode); int getInputMethodMode(); void setSelection(int position); void clearListSelection(); @Override boolean isShowing(); boolean isInputMethodNotNeeded(); boolean performItemClick(int position); @Nullable Object getSelectedItem(); int getSelectedItemPosition(); long getSelectedItemId(); @Nullable View getSelectedView(); @Override @Nullable ListView getListView(); boolean onKeyDown(int keyCode, @NonNull KeyEvent event); boolean onKeyUp(int keyCode, @NonNull KeyEvent event); boolean onKeyPreIme(int keyCode, @NonNull KeyEvent event); OnTouchListener createDragToOpenListener(View src); @RestrictTo(LIBRARY_GROUP) void setOverlapAnchor(boolean overlapAnchor); }
ListPopupWindow implements ShowableListMenu { @Override public boolean isShowing() { return mPopup.isShowing(); } ListPopupWindow(@NonNull Context context);  ListPopupWindow(@NonNull Context context, @Nullable AttributeSet attrs);  ListPopupWindow(@NonNull Context context, @Nullable AttributeSet attrs,
            @AttrRes int defStyleAttr);  ListPopupWindow(@NonNull Context context, @Nullable AttributeSet attrs,
            @AttrRes int defStyleAttr, @StyleRes int defStyleRes); void setAdapter(@Nullable ListAdapter adapter); void setPromptPosition(int position); int getPromptPosition(); void setModal(boolean modal); boolean isModal(); @RestrictTo(LIBRARY_GROUP) void setForceIgnoreOutsideTouch(boolean forceIgnoreOutsideTouch); @RestrictTo(LIBRARY_GROUP) void setDropDownAlwaysVisible(boolean dropDownAlwaysVisible); @RestrictTo(LIBRARY_GROUP) boolean isDropDownAlwaysVisible(); void setSoftInputMode(int mode); int getSoftInputMode(); void setListSelector(Drawable selector); @Nullable Drawable getBackground(); void setBackgroundDrawable(@Nullable Drawable d); void setAnimationStyle(@StyleRes int animationStyle); @StyleRes int getAnimationStyle(); @Nullable View getAnchorView(); void setAnchorView(@Nullable View anchor); int getHorizontalOffset(); void setHorizontalOffset(int offset); int getVerticalOffset(); void setVerticalOffset(int offset); @RestrictTo(LIBRARY_GROUP) void setEpicenterBounds(Rect bounds); void setDropDownGravity(int gravity); int getWidth(); void setWidth(int width); void setContentWidth(int width); int getHeight(); void setHeight(int height); void setWindowLayoutType(int layoutType); void setOnItemClickListener(@Nullable AdapterView.OnItemClickListener clickListener); void setOnItemSelectedListener(@Nullable OnItemSelectedListener selectedListener); void setPromptView(@Nullable View prompt); void postShow(); @Override void show(); @Override void dismiss(); void setOnDismissListener(@Nullable PopupWindow.OnDismissListener listener); void setInputMethodMode(int mode); int getInputMethodMode(); void setSelection(int position); void clearListSelection(); @Override boolean isShowing(); boolean isInputMethodNotNeeded(); boolean performItemClick(int position); @Nullable Object getSelectedItem(); int getSelectedItemPosition(); long getSelectedItemId(); @Nullable View getSelectedView(); @Override @Nullable ListView getListView(); boolean onKeyDown(int keyCode, @NonNull KeyEvent event); boolean onKeyUp(int keyCode, @NonNull KeyEvent event); boolean onKeyPreIme(int keyCode, @NonNull KeyEvent event); OnTouchListener createDragToOpenListener(View src); @RestrictTo(LIBRARY_GROUP) void setOverlapAnchor(boolean overlapAnchor); static final int POSITION_PROMPT_ABOVE; static final int POSITION_PROMPT_BELOW; static final int MATCH_PARENT; static final int WRAP_CONTENT; static final int INPUT_METHOD_FROM_FOCUSABLE; static final int INPUT_METHOD_NEEDED; static final int INPUT_METHOD_NOT_NEEDED; }