fix(webview): restore hardware acceleration and load test_red.html to establish baseline

This commit is contained in:
MrPiglr 2026-02-12 13:40:22 -07:00
parent 76a39ff701
commit 61ce24a320

View file

@ -30,14 +30,11 @@ public class MainActivity extends BridgeActivity {
private void loadCustomUrl() {
WebView webView = this.bridge.getWebView();
runOnUiThread(() -> {
// DISABLE HARDWARE ACCELERATION - Common fix for black screens on specific devices
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
Toast.makeText(MainActivity.this, "Software Rendering Enabled", Toast.LENGTH_SHORT).show();
});
// Disable software rendering (Revert)
// webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
// Set WebView background to BLUE to distinguish from default black
webView.setBackgroundColor(0xFF0000FF);
// Set WebView background to BLACK
webView.setBackgroundColor(0xFF000000);
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
@ -73,14 +70,8 @@ public class MainActivity extends BridgeActivity {
// NUCLEAR CACHE CLEAR
webView.clearCache(true);
webView.clearHistory();
webView.clearFormData();
webView.clearSslPreferences();
// TEST 1: Direct HTML Injection (Bypasses File System)
String htmlData = "<html><body style='background-color:green;'><h1>SOFTWARE RENDERING WORKING</h1></body></html>";
webView.loadDataWithBaseURL(null, htmlData, "text/html", "UTF-8", null);
// Force load our local test file
// webView.loadUrl("file:///android_asset/public/test_red.html");
// LOAD THE RED FILE
webView.loadUrl("file:///android_asset/public/test_red.html");
}
}