mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-12 07:07:18 +00:00
Moved auto seen to advanced account settings
This commit is contained in:
parent
4b4625dcfc
commit
c7190d0a61
9 changed files with 1902 additions and 32 deletions
1866
app/schemas/eu.faircode.email.DB/102.json
Normal file
1866
app/schemas/eu.faircode.email.DB/102.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -58,7 +58,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
|
|||
// https://developer.android.com/topic/libraries/architecture/room.html
|
||||
|
||||
@Database(
|
||||
version = 101,
|
||||
version = 102,
|
||||
entities = {
|
||||
EntityIdentity.class,
|
||||
EntityAccount.class,
|
||||
|
@ -1013,6 +1013,13 @@ public abstract class DB extends RoomDatabase {
|
|||
db.execSQL("ALTER TABLE `identity` ADD COLUMN `sender_extra_regex` TEXT");
|
||||
}
|
||||
})
|
||||
.addMigrations(new Migration(101, 102) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
||||
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
||||
db.execSQL("ALTER TABLE `account` ADD COLUMN `auto_seen` INTEGER NOT NULL DEFAULT 1");
|
||||
}
|
||||
})
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -86,6 +86,8 @@ public class EntityAccount extends EntityOrder implements Serializable {
|
|||
public Boolean notify = false;
|
||||
@NonNull
|
||||
public Boolean browse = true;
|
||||
@NonNull
|
||||
public Boolean auto_seen = true;
|
||||
public Character separator;
|
||||
public Long swipe_left;
|
||||
public Long swipe_right;
|
||||
|
|
|
@ -106,6 +106,7 @@ public class FragmentAccount extends FragmentBase {
|
|||
private CheckBox cbNotify;
|
||||
private TextView tvNotifyPro;
|
||||
private CheckBox cbBrowse;
|
||||
private CheckBox cbAutoSeen;
|
||||
private EditText etInterval;
|
||||
private CheckBox cbPartialFetch;
|
||||
|
||||
|
@ -202,6 +203,7 @@ public class FragmentAccount extends FragmentBase {
|
|||
cbNotify = view.findViewById(R.id.cbNotify);
|
||||
tvNotifyPro = view.findViewById(R.id.tvNotifyPro);
|
||||
cbBrowse = view.findViewById(R.id.cbBrowse);
|
||||
cbAutoSeen = view.findViewById(R.id.cbAutoSeen);
|
||||
etInterval = view.findViewById(R.id.etInterval);
|
||||
cbPartialFetch = view.findViewById(R.id.cbPartialFetch);
|
||||
|
||||
|
@ -714,6 +716,7 @@ public class FragmentAccount extends FragmentBase {
|
|||
args.putBoolean("primary", cbPrimary.isChecked());
|
||||
args.putBoolean("notify", cbNotify.isChecked());
|
||||
args.putBoolean("browse", cbBrowse.isChecked());
|
||||
args.putBoolean("auto_seen", cbAutoSeen.isChecked());
|
||||
args.putString("interval", etInterval.getText().toString());
|
||||
args.putBoolean("partial_fetch", cbPartialFetch.isChecked());
|
||||
|
||||
|
@ -768,6 +771,7 @@ public class FragmentAccount extends FragmentBase {
|
|||
boolean primary = args.getBoolean("primary");
|
||||
boolean notify = args.getBoolean("notify");
|
||||
boolean browse = args.getBoolean("browse");
|
||||
boolean auto_seen = args.getBoolean("auto_seen");
|
||||
String interval = args.getString("interval");
|
||||
boolean partial_fetch = args.getBoolean("partial_fetch");
|
||||
|
||||
|
@ -844,6 +848,8 @@ public class FragmentAccount extends FragmentBase {
|
|||
return true;
|
||||
if (!Objects.equals(account.browse, browse))
|
||||
return true;
|
||||
if (!Objects.equals(account.auto_seen, auto_seen))
|
||||
return true;
|
||||
if (!Objects.equals(account.poll_interval, Integer.parseInt(interval)))
|
||||
return true;
|
||||
if (!Objects.equals(account.partial_fetch, partial_fetch))
|
||||
|
@ -963,6 +969,7 @@ public class FragmentAccount extends FragmentBase {
|
|||
account.primary = (account.synchronize && primary);
|
||||
account.notify = notify;
|
||||
account.browse = browse;
|
||||
account.auto_seen = auto_seen;
|
||||
account.poll_interval = Integer.parseInt(interval);
|
||||
account.partial_fetch = partial_fetch;
|
||||
|
||||
|
@ -1209,6 +1216,7 @@ public class FragmentAccount extends FragmentBase {
|
|||
cbSynchronize.setChecked(account == null ? true : account.synchronize);
|
||||
cbPrimary.setChecked(account == null ? false : account.primary);
|
||||
cbBrowse.setChecked(account == null ? true : account.browse);
|
||||
cbAutoSeen.setChecked(account == null ? true : account.auto_seen);
|
||||
etInterval.setText(account == null ? "" : Long.toString(account.poll_interval));
|
||||
cbPartialFetch.setChecked(account == null ? true : account.partial_fetch);
|
||||
|
||||
|
|
|
@ -3194,7 +3194,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
long id = args.getLong("id");
|
||||
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean expand_read = prefs.getBoolean("expand_read", true);
|
||||
boolean inline_images = prefs.getBoolean("inline_images", false);
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
|
@ -3214,7 +3213,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
return null;
|
||||
|
||||
if (message.uid == null) {
|
||||
if (expand_read && !message.ui_seen && account.pop)
|
||||
if (!message.ui_seen && account.pop)
|
||||
EntityOperation.queue(context, message, EntityOperation.SEEN, true);
|
||||
} else {
|
||||
if (!message.content)
|
||||
|
@ -3227,7 +3226,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
EntityOperation.queue(context, message, EntityOperation.ATTACHMENT, attachment.id);
|
||||
}
|
||||
|
||||
if (expand_read && !message.ui_seen && !folder.read_only)
|
||||
if (account.auto_seen && !message.ui_seen && !folder.read_only)
|
||||
EntityOperation.queue(context, message, EntityOperation.SEEN, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
private SwitchCompat swSwipeNav;
|
||||
private SwitchCompat swReversed;
|
||||
private SwitchCompat swDoubleTap;
|
||||
private SwitchCompat swExpandRead;
|
||||
private SwitchCompat swAutoExpand;
|
||||
private SwitchCompat swExpandOne;
|
||||
private SwitchCompat swAutoClose;
|
||||
|
@ -57,7 +56,7 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
private SwitchCompat swDisableTracking;
|
||||
|
||||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
"pull", "autoscroll", "swipenav", "reversed", "doubletap", "expand_read", "autoexpand", "expand_one", "autoclose", "onclose",
|
||||
"pull", "autoscroll", "swipenav", "reversed", "doubletap", "autoexpand", "expand_one", "autoclose", "onclose",
|
||||
"collapse", "autoread", "automove", "discard_delete", "disable_tracking"
|
||||
};
|
||||
|
||||
|
@ -76,7 +75,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
swSwipeNav = view.findViewById(R.id.swSwipeNav);
|
||||
swReversed = view.findViewById(R.id.swReversed);
|
||||
swDoubleTap = view.findViewById(R.id.swDoubleTap);
|
||||
swExpandRead = view.findViewById(R.id.swExpandRead);
|
||||
swAutoExpand = view.findViewById(R.id.swAutoExpand);
|
||||
swExpandOne = view.findViewById(R.id.swExpandOne);
|
||||
swAutoClose = view.findViewById(R.id.swAutoClose);
|
||||
|
@ -128,13 +126,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
}
|
||||
});
|
||||
|
||||
swExpandRead.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("expand_read", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swAutoExpand.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
|
@ -260,7 +251,6 @@ public class FragmentOptionsBehavior extends FragmentBase implements SharedPrefe
|
|||
swSwipeNav.setChecked(prefs.getBoolean("swipenav", true));
|
||||
swReversed.setChecked(prefs.getBoolean("reversed", false));
|
||||
swDoubleTap.setChecked(prefs.getBoolean("doubletap", false));
|
||||
swExpandRead.setChecked(prefs.getBoolean("expand_read", true));
|
||||
swAutoExpand.setChecked(prefs.getBoolean("autoexpand", true));
|
||||
swExpandOne.setChecked(prefs.getBoolean("expand_one", true));
|
||||
swAutoClose.setChecked(prefs.getBoolean("autoclose", true));
|
||||
|
|
|
@ -443,6 +443,15 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbBrowse" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbAutoSeen"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/title_advanced_expand_read"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvBrowseHint" />
|
||||
|
||||
<!-- keep alive -->
|
||||
|
||||
<TextView
|
||||
|
@ -453,7 +462,7 @@
|
|||
android:text="@string/title_keep_alive_interval"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvBrowseHint" />
|
||||
app:layout_constraintTop_toBottomOf="@id/cbAutoSeen" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etInterval"
|
||||
|
@ -812,6 +821,7 @@
|
|||
cbNotify,tvNotifyPro,
|
||||
cbSynchronize,cbPrimary,
|
||||
cbBrowse,tvBrowseHint,
|
||||
cbAutoSeen,
|
||||
tvInterval,etInterval,tvIntervalRemark,
|
||||
cbPartialFetch,tvPartialFetchRemark" />
|
||||
|
||||
|
|
|
@ -69,18 +69,6 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/swReversed"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swExpandRead"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:checked="true"
|
||||
android:text="@string/title_advanced_expand_read"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swDoubleTap"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swAutoExpand"
|
||||
android:layout_width="0dp"
|
||||
|
@ -90,7 +78,7 @@
|
|||
android:text="@string/title_advanced_autoexpand"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swExpandRead"
|
||||
app:layout_constraintTop_toBottomOf="@id/swDoubleTap"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -235,8 +235,6 @@
|
|||
<string name="title_advanced_rlah">Roam like at home</string>
|
||||
<string name="title_advanced_manage_connectivity">Manage connectivity</string>
|
||||
|
||||
<string name="title_advanced_browse">Browse messages on the server</string>
|
||||
|
||||
<string name="title_advanced_startup">Show on start screen</string>
|
||||
<string name="title_advanced_cards">Show cards</string>
|
||||
<string name="title_advanced_date_header">Group by date</string>
|
||||
|
@ -269,7 +267,6 @@
|
|||
<string name="title_advanced_swipenav">Swipe left/right to go to next/previous conversation</string>
|
||||
<string name="title_advanced_reversed">Reverse navigation direction</string>
|
||||
<string name="title_advanced_double_tap">Double tap to mark message read/unread</string>
|
||||
<string name="title_advanced_expand_read">Mark messages read on expanding</string>
|
||||
<string name="title_advanced_autoexpand">Automatically expand messages</string>
|
||||
<string name="title_advanced_expand_one">Expand only one message at a time</string>
|
||||
<string name="title_advanced_collapse">Collapse messages in conversations on \'back\'</string>
|
||||
|
@ -422,6 +419,9 @@
|
|||
<string name="title_oauth_support">OAuth is not supported</string>
|
||||
<string name="title_review">Review</string>
|
||||
|
||||
<string name="title_advanced_browse">Browse messages on the server</string>
|
||||
<string name="title_advanced_expand_read">Mark messages read on expanding</string>
|
||||
|
||||
<string name="title_synchronize_now">Synchronize now</string>
|
||||
<string name="title_synchronize_all">Synchronize all messages</string>
|
||||
<string name="title_synchronize_enabled">Synchronize</string>
|
||||
|
|
Loading…
Add table
Reference in a new issue