HTML scrolling events in an Android WebView that's inside a ScrollView
<p>I have a web page for testing purposes ( <a href="https://storage.googleapis.com/htmltestingbucket/nested_scroll_helper.html" rel="nofollow">https://storage.googleapis.com/htmltestingbucket/nested_scroll_helper.html</a> ) that just prints a counter of the scroll event the html has caught in a fixed header </p>

<p>When the Android WebView is the only scroll-able element in the fragment everything is fine and the WebView sends the scroll events to the page</p>

<p>If I want to add native elements above and below the WebView then things get much more complex.</p>

<pre><code>&lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:custom="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"&gt;

    &lt;LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"&gt;

        &lt;TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="20dp"
            android:text="SOMETHING ABOVE THE WEBVIEW" /&gt;

        &lt;WebView
            android:id="@+id/webview"
            android:layout_width="match_parent"
            android:layout_height="match_parent" /&gt;

        &lt;TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="20dp"
            android:text="SOMETHING BELOW THE WEBVIEW" /&gt;

    &lt;/LinearLayout&gt;
&lt;/ScrollView&gt;
</code></pre>

<p>I know it's not good to have a WebView inside a ScrollView but I have to provide a single scrolling experience with hybrid content and proper scrolling events in the html document.
I found plenty of questions on the matter but I was able to create a full end-to-end solution</p>

<hr>

<p>Also, I know lint has an Offical check for that:</p>

<blockquote>
  <p>NestedScrolling
  --------------- Summary: Nested scrolling widgets</p>
  
  <p>Priority: 7 / 10 Severity: Warning Category: Correctness</p>
  
  <p>A scrolling widget such as a ScrollView should not contain any nested
  scrolling widgets since this has various usability issues</p>
</blockquote>

<p>And yet, I can't implement the web view content in native so I need an alternative way to do that</p>