Android 8: WebView - vertical scrollbar - incorrect work

Viewed 478

I has activity with webView. Here layout xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <WebView
        android:id="@+id/webview"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>

Here activity code:

public class TestActivity extends AppCompatActivity {
    public static final String HTML_TEXT = "HTML_TEXT";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.test_activity);
        String htmlText = getIntent().getExtras().getString(HTML_TEXT);
        WebView webview = (WebView) findViewById(R.id.webview);
        webview.getSettings().setJavaScriptEnabled(true);

        String resultHTML = "<html><head><meta charset=utf-8></head><body>" + htmlText + "</body></html>";
        webview.loadDataWithBaseURL("fake://", resultHTML, "text/html", StringUtil.encodingUTF8, null);
    }
}

And here result:

enter image description here

And as you can see on right side success show scrollbar when scrolling. This work on Android 4.0, 5.0, 6.0, 7.0. OK.

But on Android 8.0 (Emulator) when scrolling to item "Test many posts 7/15" (about half screen) scrollbar is hide. I'm scrolling to bottom of screen but scrollbar not show.

Here result:

enter image description here

and scrolling to bottom of screen (scrollbar is hide):

enter image description here

How fix this?

1 Answers
Related