mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-15 08:29:24 +00:00
Respect WebView max height
This commit is contained in:
parent
eafc005367
commit
ff5443c645
2 changed files with 17 additions and 10 deletions
|
@ -1952,20 +1952,19 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
tvNoInternetBody.setVisibility(suitable || content ? View.GONE : View.VISIBLE);
|
||||
grpDownloading.setVisibility(content ? View.GONE : View.VISIBLE);
|
||||
|
||||
int height = properties.getHeight(message.id, 0);
|
||||
if (height == 0) {
|
||||
tvBody.setVisibility(View.GONE);
|
||||
boolean show_full = properties.getValue("full", message.id);
|
||||
if (show_full)
|
||||
wvBody.setVisibility(View.GONE);
|
||||
} else {
|
||||
boolean show_full = properties.getValue("full", message.id);
|
||||
if (show_full) {
|
||||
wvBody.setVisibility(View.INVISIBLE);
|
||||
wvBody.setMinimumHeight(height);
|
||||
} else {
|
||||
else {
|
||||
int height = properties.getHeight(message.id, 0);
|
||||
if (height == 0)
|
||||
tvBody.setVisibility(View.GONE);
|
||||
else {
|
||||
tvBody.setVisibility(View.INVISIBLE);
|
||||
tvBody.setMinHeight(height);
|
||||
}
|
||||
}
|
||||
|
||||
vwRipple.setVisibility(View.GONE);
|
||||
pbBody.setVisibility(View.GONE);
|
||||
|
||||
|
@ -2572,7 +2571,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
wvBody = webView;
|
||||
}
|
||||
|
||||
webView.setMinimumHeight(height);
|
||||
webView.setMinimumHeight(dp60);
|
||||
|
||||
int maxHeight = (rv == null ? 0 : rv.getHeight() - rv.getPaddingTop());
|
||||
webView.init(height, maxHeight, size, position, force_light,
|
||||
|
|
|
@ -217,6 +217,12 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
|
|||
settings.setBlockNetworkImage(!show_images);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMinimumHeight(int minHeight) {
|
||||
super.setMinimumHeight(minHeight);
|
||||
Log.i("Set min height=" + minHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
if (legacy) {
|
||||
|
@ -230,6 +236,8 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
|
|||
|
||||
int mh = getMeasuredHeight();
|
||||
Log.i("Measured height=" + mh + " last=" + height + "/" + maxHeight + " ch=" + getContentHeight());
|
||||
if (mh > maxHeight)
|
||||
setMeasuredDimension(getMeasuredWidth(), maxHeight);
|
||||
if (mh == 0 && legacy)
|
||||
setMeasuredDimension(getMeasuredWidth(), height);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue