Code example for PopupWindow

Methods: setTouchInterceptor

0
      assertThat((BitmapDrawable) popupWindow.getBackground()).isSameAs(bitmapDrawable);
    } 
 
    @Test 
    public void testTouchInterceptor() { 
      popupWindow.setTouchInterceptor(new View.OnTouchListener() {
        @Override 
        public boolean onTouch(View v, MotionEvent event) {
          return event.getAction() == ACTION_DOWN;
        } 
      }); 
 
      assertTrue(shadowOf(popupWindow).dispatchTouchEvent(obtain(1, 1, ACTION_DOWN, 1f, 1f, 0)));
    } 
  } 
 
  @RunWith(TestRunners.WithDefaults.class) 
  public static class WithContentView { 
 
    private WindowManager windowManager;
    private View contentView;