pull/210/head
M66B 2 years ago
parent a272d9de77
commit a7eeb1840a

@ -316,7 +316,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private int level; private int level;
private boolean canDarken; private boolean canDarken;
private boolean fake_dark; private boolean fake_dark;
private boolean webview_legacy;
private boolean show_recent; private boolean show_recent;
private boolean gotoTop = false; private boolean gotoTop = false;
@ -7360,7 +7359,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
this.canDarken = WebViewEx.isFeatureSupported(context, WebViewFeature.ALGORITHMIC_DARKENING); this.canDarken = WebViewEx.isFeatureSupported(context, WebViewFeature.ALGORITHMIC_DARKENING);
this.fake_dark = prefs.getBoolean("fake_dark", false); this.fake_dark = prefs.getBoolean("fake_dark", false);
this.webview_legacy = prefs.getBoolean("webview_legacy", false);
this.show_recent = prefs.getBoolean("show_recent", false); this.show_recent = prefs.getBoolean("show_recent", false);
DiffUtil.ItemCallback<TupleMessageEx> callback = new DiffUtil.ItemCallback<TupleMessageEx>() { DiffUtil.ItemCallback<TupleMessageEx> callback = new DiffUtil.ItemCallback<TupleMessageEx>() {

@ -193,7 +193,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SeekBar sbThreadRange; private SeekBar sbThreadRange;
private ImageButton ibSqliteCache; private ImageButton ibSqliteCache;
private SwitchCompat swUndoManager; private SwitchCompat swUndoManager;
private SwitchCompat swWebViewLegacy;
private SwitchCompat swBrowserZoom; private SwitchCompat swBrowserZoom;
private SwitchCompat swFakeDark; private SwitchCompat swFakeDark;
private SwitchCompat swShowRecent; private SwitchCompat swShowRecent;
@ -264,7 +263,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"query_threads", "query_threads",
"sqlite_integrity_check", "wal", "sqlite_checkpoints", "sqlite_analyze", "sqlite_auto_vacuum", "sqlite_sync_extra", "sqlite_cache", "sqlite_integrity_check", "wal", "sqlite_checkpoints", "sqlite_analyze", "sqlite_auto_vacuum", "sqlite_sync_extra", "sqlite_cache",
"chunk_size", "thread_range", "undo_manager", "chunk_size", "thread_range", "undo_manager",
"webview_legacy", "browser_zoom", "fake_dark", "browser_zoom", "fake_dark",
"show_recent", "show_recent",
"use_modseq", "uid_command", "perform_expunge", "uid_expunge", "use_modseq", "uid_command", "perform_expunge", "uid_expunge",
"auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop", "use_top", "auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop", "use_top",
@ -410,7 +409,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
tvThreadRange = view.findViewById(R.id.tvThreadRange); tvThreadRange = view.findViewById(R.id.tvThreadRange);
sbThreadRange = view.findViewById(R.id.sbThreadRange); sbThreadRange = view.findViewById(R.id.sbThreadRange);
swUndoManager = view.findViewById(R.id.swUndoManager); swUndoManager = view.findViewById(R.id.swUndoManager);
swWebViewLegacy = view.findViewById(R.id.swWebViewLegacy);
swBrowserZoom = view.findViewById(R.id.swBrowserZoom); swBrowserZoom = view.findViewById(R.id.swBrowserZoom);
swFakeDark = view.findViewById(R.id.swFakeDark); swFakeDark = view.findViewById(R.id.swFakeDark);
swShowRecent = view.findViewById(R.id.swShowRecent); swShowRecent = view.findViewById(R.id.swShowRecent);
@ -1394,14 +1392,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
} }
}); });
swWebViewLegacy.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
swWebViewLegacy.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("webview_legacy", checked).apply();
}
});
swBrowserZoom.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE); swBrowserZoom.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
swBrowserZoom.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swBrowserZoom.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
@ -2230,7 +2220,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
sbThreadRange.setProgress(thread_range); sbThreadRange.setProgress(thread_range);
swUndoManager.setChecked(prefs.getBoolean("undo_manager", false)); swUndoManager.setChecked(prefs.getBoolean("undo_manager", false));
swWebViewLegacy.setChecked(prefs.getBoolean("webview_legacy", false));
swBrowserZoom.setChecked(prefs.getBoolean("browser_zoom", false)); swBrowserZoom.setChecked(prefs.getBoolean("browser_zoom", false));
swFakeDark.setChecked(prefs.getBoolean("fake_dark", false)); swFakeDark.setChecked(prefs.getBoolean("fake_dark", false));
swShowRecent.setChecked(prefs.getBoolean("show_recent", false)); swShowRecent.setChecked(prefs.getBoolean("show_recent", false));

@ -48,7 +48,6 @@ import java.util.Objects;
public class WebViewEx extends WebView implements DownloadListener, View.OnLongClickListener { public class WebViewEx extends WebView implements DownloadListener, View.OnLongClickListener {
private int height; private int height;
private int maxHeight; private int maxHeight;
private boolean legacy;
private IWebView intf; private IWebView intf;
private Runnable onPageLoaded; private Runnable onPageLoaded;
private String hash; private String hash;
@ -115,7 +114,6 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
boolean browser_zoom = (prefs.getBoolean("browser_zoom", false) && BuildConfig.DEBUG); boolean browser_zoom = (prefs.getBoolean("browser_zoom", false) && BuildConfig.DEBUG);
int message_zoom = prefs.getInt("message_zoom", 100); int message_zoom = prefs.getInt("message_zoom", 100);
boolean monospaced = prefs.getBoolean("monospaced", false); boolean monospaced = prefs.getBoolean("monospaced", false);
legacy = (prefs.getBoolean("webview_legacy", false) && BuildConfig.DEBUG);
WebSettings settings = getSettings(); WebSettings settings = getSettings();
@ -247,19 +245,10 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
// Unable to create layer for WebViewEx, size 1088x16384 max size 16383 color type 4 has context 1) // Unable to create layer for WebViewEx, size 1088x16384 max size 16383 color type 4 has context 1)
int limitHeight = MeasureSpec.makeMeasureSpec(16000, MeasureSpec.AT_MOST); int limitHeight = MeasureSpec.makeMeasureSpec(16000, MeasureSpec.AT_MOST);
if (legacy) { super.onMeasure(widthMeasureSpec, limitHeight);
if (height > getMinimumHeight())
super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST));
else
super.onMeasure(widthMeasureSpec, limitHeight);
} else {
super.onMeasure(widthMeasureSpec, limitHeight);
}
int mh = getMeasuredHeight(); int mh = getMeasuredHeight();
Log.i("Measured height=" + mh + " last=" + height + "/" + maxHeight + " ch=" + getContentHeight()); Log.i("Measured height=" + mh + " last=" + height + "/" + maxHeight + " ch=" + getContentHeight());
if (mh == 0 && legacy)
setMeasuredDimension(getMeasuredWidth(), height);
} }
@Override @Override

@ -1343,18 +1343,6 @@
app:layout_constraintTop_toBottomOf="@id/sbThreadRange" app:layout_constraintTop_toBottomOf="@id/sbThreadRange"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swWebViewLegacy"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_webview_legacy"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swUndoManager"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swBrowserZoom" android:id="@+id/swBrowserZoom"
android:layout_width="0dp" android:layout_width="0dp"
@ -1364,7 +1352,7 @@
android:text="@string/title_advanced_browser_zoom" android:text="@string/title_advanced_browser_zoom"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swWebViewLegacy" app:layout_constraintTop_toBottomOf="@id/swUndoManager"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat

@ -801,7 +801,6 @@
<string name="title_advanced_chunk_size" translatable="false">Chunk size: %1$d</string> <string name="title_advanced_chunk_size" translatable="false">Chunk size: %1$d</string>
<string name="title_advanced_thread_range" translatable="false">Thread range: %1$d days</string> <string name="title_advanced_thread_range" translatable="false">Thread range: %1$d days</string>
<string name="title_advanced_undo_manager" translatable="false">Use Android\'s undo manager</string> <string name="title_advanced_undo_manager" translatable="false">Use Android\'s undo manager</string>
<string name="title_advanced_webview_legacy" translatable="false">Old WebView behavior</string>
<string name="title_advanced_browser_zoom" translatable="false">Use browser zoom</string> <string name="title_advanced_browser_zoom" translatable="false">Use browser zoom</string>
<string name="title_advanced_fake_dark" translatable="false">Fake dark</string> <string name="title_advanced_fake_dark" translatable="false">Fake dark</string>
<string name="title_advanced_show_recent" translatable="false">Show recent flag</string> <string name="title_advanced_show_recent" translatable="false">Show recent flag</string>

Loading…
Cancel
Save