Limit WebView height

This commit is contained in:
M66B 2022-10-12 19:40:13 +02:00
parent 7f83e2912d
commit c2a53562e0
1 changed files with 4 additions and 2 deletions

View File

@ -245,13 +245,15 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
// Unable to create layer for WebViewEx, size 1088x16384 max size 16383 color type 4 has context 1)
int limitHeight = MeasureSpec.makeMeasureSpec(16000, MeasureSpec.AT_MOST);
if (legacy) {
if (height > getMinimumHeight())
super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST));
else
super.onMeasure(widthMeasureSpec, heightMeasureSpec); // Unspecified
super.onMeasure(widthMeasureSpec, limitHeight);
} else {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
super.onMeasure(widthMeasureSpec, limitHeight);
}
int mh = getMeasuredHeight();