I have a DialogFragment (displayed as a dialog) whose layout contains a WebView control.
The layout is setup to wrap_content. I’m working on a tablet and do want to display as a dialog but do not want to have the height match that of the screen.
The web view displays HTML content which is defined at build time.
The HTML contains links which can hide and show content (hiding/showing ‘divs’).
As I click on links to expand them then the height of the dialog increases as content is shown.
However, when I collapse entries the height of the dialog does not contract.
My preference would be to fix the height of the dialog after the content has loaded. Failing that to have the height of the dialog decrease as content is hidden.
Thanks in advance, Peter.
Although the code needs cleaning up and there may be neater ways of doing it but I put the following in the
onPageFinishedevent for the WebView and it does the job for me of fixing the dialog height after the html content has been loaded.