diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java
index 7de4140302..2a702bd610 100644
--- a/app/src/main/java/eu/faircode/email/FragmentCompose.java
+++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java
@@ -278,6 +278,7 @@ public class FragmentCompose extends FragmentBase {
private ContentResolver resolver;
private AdapterAttachment adapter;
+ private boolean autoscroll_editor;
private int compose_color;
private String compose_font;
private boolean compose_monospaced;
@@ -344,6 +345,7 @@ public class FragmentCompose extends FragmentBase {
final Context context = getContext();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ autoscroll_editor = prefs.getBoolean("autoscroll_editor", false);
compose_color = prefs.getInt("compose_color", Color.TRANSPARENT);
compose_font = prefs.getString("compose_font", "");
compose_monospaced = prefs.getBoolean("compose_monospaced", false);
@@ -701,11 +703,14 @@ public class FragmentCompose extends FragmentBase {
}
}
- if (count - before > 1)
- inserted = true;
- else if (count - before == 1) {
- char c = text.charAt(start + count - 1);
- inserted = Character.isWhitespace(c);
+ // Autoscroll was fixed by Android 14 beta 2
+ if (autoscroll_editor) {
+ if (count - before > 1)
+ inserted = true;
+ else if (count - before == 1) {
+ char c = text.charAt(start + count - 1);
+ inserted = Character.isWhitespace(c);
+ }
}
}
diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
index fcd9a0a141..b416334904 100644
--- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
+++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
@@ -204,6 +204,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private TextView tvThreadRange;
private SeekBar sbThreadRange;
private ImageButton ibSqliteCache;
+ private SwitchCompat swAutoScroll;
private SwitchCompat swUndoManager;
private SwitchCompat swBrowserZoom;
private SwitchCompat swFakeDark;
@@ -284,7 +285,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"test1", "test2", "test3", "test4", "test5",
"emergency_file", "work_manager", // "external_storage",
"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",
+ "autoscroll_editor", "undo_manager",
"browser_zoom", "fake_dark",
"show_recent",
"use_modseq", "preamble", "uid_command", "perform_expunge", "uid_expunge",
@@ -445,6 +447,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
sbChunkSize = view.findViewById(R.id.sbChunkSize);
tvThreadRange = view.findViewById(R.id.tvThreadRange);
sbThreadRange = view.findViewById(R.id.sbThreadRange);
+ swAutoScroll = view.findViewById(R.id.swAutoScroll);
swUndoManager = view.findViewById(R.id.swUndoManager);
swBrowserZoom = view.findViewById(R.id.swBrowserZoom);
swFakeDark = view.findViewById(R.id.swFakeDark);
@@ -1542,6 +1545,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
+ swAutoScroll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
+ prefs.edit().putBoolean("autoscroll_editor", checked).apply();
+ }
+ });
+
swUndoManager.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -2448,6 +2458,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
tvThreadRange.setText(getString(R.string.title_advanced_thread_range, range));
sbThreadRange.setProgress(thread_range);
+ swAutoScroll.setChecked(prefs.getBoolean("autoscroll_editor", false));
swUndoManager.setChecked(prefs.getBoolean("undo_manager", false));
swBrowserZoom.setChecked(prefs.getBoolean("browser_zoom", false));
swFakeDark.setChecked(prefs.getBoolean("fake_dark", false));
diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml
index e439a5c47a..17a130ceca 100644
--- a/app/src/main/res/layout/fragment_options_misc.xml
+++ b/app/src/main/res/layout/fragment_options_misc.xml
@@ -1610,6 +1610,17 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvThreadRange" />
+
+
sqlite cache: %1$s %% - %2$s
Chunk size: %1$d
Thread range: %1$d days
+ Auto scroll editor
Use Android\'s undo manager
Use browser zoom
Fake dark