Merge pull request #4117 from ByteHamster/webview-min-height
Reduced probability for closing player accidentally
This commit is contained in:
commit
626c6aebe5
@ -47,6 +47,17 @@ public class ItemDescriptionFragment extends Fragment {
|
||||
// Restoring the scroll position might not always work
|
||||
webvDescription.postDelayed(ItemDescriptionFragment.this::restoreFromPreference, 50);
|
||||
});
|
||||
|
||||
root.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
|
||||
@Override
|
||||
public void onLayoutChange(View v, int left, int top, int right,
|
||||
int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
|
||||
if (root.getMeasuredHeight() != webvDescription.getMinimumHeight()) {
|
||||
webvDescription.setMinimumHeight(root.getMeasuredHeight());
|
||||
}
|
||||
root.removeOnLayoutChangeListener(this);
|
||||
}
|
||||
});
|
||||
registerForContextMenu(webvDescription);
|
||||
return root;
|
||||
}
|
||||
|
@ -165,4 +165,11 @@ public class ShownotesWebView extends WebView implements View.OnLongClickListene
|
||||
public void setPageFinishedListener(Runnable pageFinishedListener) {
|
||||
this.pageFinishedListener = pageFinishedListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
setMeasuredDimension(Math.max(getMeasuredWidth(), getMinimumWidth()),
|
||||
Math.max(getMeasuredHeight(), getMinimumHeight()));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user