Half transparent web view background

This commit is contained in:
M66B
2021-07-02 16:49:21 +02:00
parent 5fda0efbee
commit 9519edc9ff

View File

@@ -37,6 +37,7 @@ import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.annotation.NonNull;
import androidx.core.graphics.ColorUtils;
import androidx.preference.PreferenceManager;
import androidx.webkit.WebSettingsCompat;
import androidx.webkit.WebViewFeature;
@@ -116,7 +117,9 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
forced = true;
}
setBackgroundColor(dark && !forced ? Color.WHITE : Color.TRANSPARENT);
setBackgroundColor(dark && !forced
? Color.WHITE
: ColorUtils.setAlphaComponent(Color.WHITE, 127));
float fontSize = 16f /* Default */ * message_zoom / 100f;
if (zoom == 0 /* small */)