@Test public void setWebViewScrollingEnabled_whenScrollableIsFalse_whenMotionEventIsNotActionMove_onTouchListenerShouldReturnFalse() throws Exception { subject.initializeOnTouchListener(false); View.OnTouchListener onTouchListener = shadowOf(subject).getOnTouchListener(); boolean shouldConsumeTouch = onTouchListener.onTouch(subject, touchUp); assertThat(shouldConsumeTouch).isFalse(); shouldConsumeTouch = onTouchListener.onTouch(subject, touchDown); assertThat(shouldConsumeTouch).isFalse(); shouldConsumeTouch = onTouchListener.onTouch(subject, createMotionEvent(MotionEvent.ACTION_CANCEL)); assertThat(shouldConsumeTouch).isFalse(); }
void initializeOnTouchListener(final boolean isScrollable) { setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { mViewGestureDetector.sendTouchEvent(event); return (event.getAction() == MotionEvent.ACTION_MOVE) && !isScrollable; } }); }
BaseHtmlWebView extends BaseWebView implements UserClickListener { void initializeOnTouchListener(final boolean isScrollable) { setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { mViewGestureDetector.sendTouchEvent(event); return (event.getAction() == MotionEvent.ACTION_MOVE) && !isScrollable; } }); } }
BaseHtmlWebView extends BaseWebView implements UserClickListener { void initializeOnTouchListener(final boolean isScrollable) { setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { mViewGestureDetector.sendTouchEvent(event); return (event.getAction() == MotionEvent.ACTION_MOVE) && !isScrollable; } }); } BaseHtmlWebView(Context context, AdReport adReport); }
BaseHtmlWebView extends BaseWebView implements UserClickListener { void initializeOnTouchListener(final boolean isScrollable) { setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { mViewGestureDetector.sendTouchEvent(event); return (event.getAction() == MotionEvent.ACTION_MOVE) && !isScrollable; } }); } BaseHtmlWebView(Context context, AdReport adReport); void init(boolean isScrollable); @Override void loadUrl(String url); @Override void onUserClick(); @Override void onResetUserClick(); @Override boolean wasClicked(); }
BaseHtmlWebView extends BaseWebView implements UserClickListener { void initializeOnTouchListener(final boolean isScrollable) { setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { mViewGestureDetector.sendTouchEvent(event); return (event.getAction() == MotionEvent.ACTION_MOVE) && !isScrollable; } }); } BaseHtmlWebView(Context context, AdReport adReport); void init(boolean isScrollable); @Override void loadUrl(String url); @Override void onUserClick(); @Override void onResetUserClick(); @Override boolean wasClicked();  }