Looking for assistance with a puzzling issue.
Inside my Android app, there's a fragment containing a webview along with other elements. The webview showcases an HTML table that acts as a game board with 8x8 cells, resembling a Chess board.
The challenge lies in making the table occupy the screen entirely while maintaining a perfectly square shape (consistent width and height).
How can I achieve this task? Simply setting the width and height to 100% in the HTML doesn't result in a square table. Using fixed dimensions leads to non-responsive resizing across various screen sizes. Attempting to scale the table based on the webview's size using WebView.getWidth() isn't straightforward either because the webview's size is unknown until the page loads, and the page load depends on knowing the webview's size...
A few additional notes (although their relevance is unclear):
The fragment's layout gets inflated from a specified file in Fragment.onCreateView. Later, within Fragment.onActivityCreated, the Java code adds the webview to the fragment. The HTML content is also dynamically generated through Java code.