Enable fake dark by default

pull/209/head
M66B 2 years ago
parent 85939442f0
commit 972b12dbe3

@ -2517,6 +2517,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
boolean show_images = properties.getValue("images", message.id);
boolean show_quotes = (properties.getValue("quotes", message.id) || !collapse_quotes);
boolean dark = Helper.isDarkTheme(context);
boolean force_light = properties.getValue("force_light", message.id);
boolean always_images = prefs.getBoolean("html_always_images", false);
if (always_images && show_full) {
@ -2664,7 +2665,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
float scale = (size == 0 || textSize == 0 ? 1.0f : size / (textSize * message_zoom / 100f));
args.putFloat("scale", scale);
boolean dark = Helper.isDarkTheme(context);
args.putBoolean("fake_dark", !canDarken && fake_dark && dark && !force_light);
new SimpleTask<Object>() {
@ -7120,7 +7120,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
level = prefs.getInt("log_level", Log.getDefaultLogLevel());
this.canDarken = WebViewEx.isFeatureSupported(context, WebViewFeature.ALGORITHMIC_DARKENING);
this.fake_dark = prefs.getBoolean("fake_dark", false);
this.fake_dark = prefs.getBoolean("fake_dark", true);
this.webview_legacy = prefs.getBoolean("webview_legacy", false);
this.show_recent = prefs.getBoolean("show_recent", false);

@ -153,7 +153,8 @@ public class FragmentOptions extends FragmentBase {
"language_detection",
"quick_filter", "quick_scroll",
"experiments", "debug", "log_level", "test1", "test2", "test3", "test4", "test5",
"webview_legacy", "browser_zoom", "show_recent",
"webview_legacy", "browser_zoom", "fake_dark",
"show_recent",
"biometrics",
"default_light"
};

@ -1783,7 +1783,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swUndoManager.setChecked(prefs.getBoolean("undo_manager", false));
swWebViewLegacy.setChecked(prefs.getBoolean("webview_legacy", false));
swBrowserZoom.setChecked(prefs.getBoolean("browser_zoom", false));
swFakeDark.setChecked(prefs.getBoolean("fake_dark", false));
swFakeDark.setChecked(prefs.getBoolean("fake_dark", true));
swShowRecent.setChecked(prefs.getBoolean("show_recent", false));
swModSeq.setChecked(prefs.getBoolean("use_modseq", true));
swUid.setChecked(prefs.getBoolean("uid_command", false));

@ -387,11 +387,12 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
public static boolean isFeatureSupported(Context context, String feature) {
if (WebViewFeature.ALGORITHMIC_DARKENING.equals(feature)) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean fake_dark = prefs.getBoolean("fake_dark", false);
if (fake_dark)
return false;
if (BuildConfig.DEBUG) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean fake_dark = prefs.getBoolean("fake_dark", true);
if (fake_dark)
return false;
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
return false;

Loading…
Cancel
Save