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