title: How can I catch scrolling of element inside android webview
body: <p>I have a SwipeRefreshLayout view as a parent. Inside it i am using a webview that loads web pages. I want to reload webview by pulling down SwipeRefreshLayout. Here is my xml:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;android.support.v4.widget.SwipeRefreshLayout
          android:id="@+id/refresh_layout"
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;WebView
              android:id="@+id/webView"
              android:layout_width="match_parent"
              android:layout_height="match_parent" /&gt;
  
  &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
  </code></pre>
  
  <p>and java code:</p>
  
  <pre class="lang-java prettyprint-override"><code>mWebView = (WebView) view.findViewById(R.id.webView);
  mWebView.getSettings().setJavaScriptEnabled(true);
  mWebView.loadUrl("http://kashirskoe.vegas-city.ru/renter/");
  
  mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.refresh_layout);
      mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
          @Override
          public void onRefresh() {
              mSwipeRefreshLayout.setRefreshing(true);
              mSwipeRefreshLayout.postDelayed(new Runnable() {
                  @Override
                  public void run() {
                      mWebView.reload();
                      mSwipeRefreshLayout.setRefreshing(false);
                  }
              }, 1000);
          }
      });
  </code></pre>
  
  <p>At the first blush it works perfect. But when the user is scrolling down for example a map control on the web page it's not scrolling. Instead of this SwipeRefreshLayout intercept scrolling and refresh the web page (the example page url is on the code).</p>
  
  <p>I want to disable SwipeRefreshLayout scroll when any web control on the page is scrolling. Like it works in browser Google Chrome. </p>
  
  <p>I think i need to inject and execute JavaScript in the webview in order to detect scroll events on any scroll control on the page. And pass it to android native code. I know how to pass it to native code. </p>
  
  <p>But how can i detect this scroll events in javascript?</p>