Removed folder last sync time

This commit is contained in:
M66B 2022-05-02 23:10:45 +02:00
parent 0a97174113
commit ce0ba25edd
7 changed files with 10 additions and 42 deletions

View File

@ -62,7 +62,6 @@ public class AdapterNavAccountFolder extends RecyclerView.Adapter<AdapterNavAcco
private boolean nav_count_pinned;
private boolean nav_unseen_drafts;
private boolean nav_categories;
private boolean last_sync_time;
private int dp6;
private int dp12;
@ -167,20 +166,17 @@ public class AdapterNavAccountFolder extends RecyclerView.Adapter<AdapterNavAcco
tvItem.setTypeface(count == 0 ? Typeface.DEFAULT : Typeface.DEFAULT_BOLD);
tvItem.setVisibility(expanded ? View.VISIBLE : View.GONE);
if (account.folderName == null || last_sync_time) {
Long last_connected = (account.folderName == null
? account.last_connected
: account.folderLastSync);
if (last_connected != null && expanded) {
if (account.folderName == null) {
if (account.last_connected != null && expanded) {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
if (last_connected < cal.getTimeInMillis())
tvItemExtra.setText(DF.format(last_connected));
if (account.last_connected < cal.getTimeInMillis())
tvItemExtra.setText(DF.format(account.last_connected));
else
tvItemExtra.setText(TF.format(last_connected));
tvItemExtra.setText(TF.format(account.last_connected));
tvItemExtra.setVisibility(View.VISIBLE);
} else
tvItemExtra.setVisibility(View.GONE);
@ -292,7 +288,6 @@ public class AdapterNavAccountFolder extends RecyclerView.Adapter<AdapterNavAcco
this.nav_count_pinned = prefs.getBoolean("nav_count_pinned", false);
this.nav_unseen_drafts = prefs.getBoolean("nav_unseen_drafts", false);
this.nav_categories = prefs.getBoolean("nav_categories", false);
this.last_sync_time = prefs.getBoolean("last_sync_time", false);
boolean highlight_unread = prefs.getBoolean("highlight_unread", true);
int colorHighlight = prefs.getInt("highlight_color", Helper.resolveColor(context, R.attr.colorUnreadHighlight));

View File

@ -84,8 +84,7 @@ public interface DaoAccount {
", NULL AS folderId, NULL AS folderSeparator" +
", NULL AS folderType, -1 AS folderOrder" +
", NULL AS folderName, NULL AS folderDisplay, NULL AS folderColor" +
", 0 AS folderSync, NULL AS folderState" +
", NULL AS folderSyncState, NULL AS folderLastSync" +
", 0 AS folderSync, NULL AS folderState, NULL AS folderSyncState" +
", 0 AS executing" +
", 0 AS messages" +
", (SELECT COUNT(DISTINCT" +
@ -111,8 +110,7 @@ public interface DaoAccount {
", folder.id AS folderId, folder.separator AS folderSeparator" +
", folder.type AS folderType, folder.`order` AS folderOrder" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.color AS folderColor" +
", folder.synchronize AS folderSync, folder.state AS foldeState" +
", folder.sync_state AS folderSyncState, folder.last_sync AS folderLastSync" +
", folder.synchronize AS folderSync, folder.state AS foldeState, folder.sync_state AS folderSyncState" +
", (SELECT COUNT(operation.id) FROM operation" +
" WHERE operation.folder = folder.id" +
" AND state = 'executing') AS executing" +

View File

@ -157,8 +157,7 @@ public class FragmentOptions extends FragmentBase {
"quick_filter", "quick_scroll",
"experiments", "debug", "log_level", "test1", "test2", "test3", "test4", "test5", "webview_legacy",
"biometrics",
"default_light",
"last_sync_time"
"default_light"
};
@Override

View File

@ -174,7 +174,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swExactAlarms;
private SwitchCompat swInfra;
private SwitchCompat swDupMsgId;
private SwitchCompat swLastSync;
private SwitchCompat swTestIab;
private Button btnImportProviders;
private TextView tvProcessors;
@ -217,7 +216,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"use_modseq", "uid_command", "perform_expunge", "uid_expunge",
"auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop",
"keep_alive_poll", "empty_pool", "idle_done", "logarithmic_backoff",
"exact_alarms", "infra", "dkim_verify", "dup_msgids", "last_sync_time", "test_iab"
"exact_alarms", "infra", "dkim_verify", "dup_msgids", "test_iab"
};
private final static String[] RESET_QUESTIONS = new String[]{
@ -346,7 +345,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swExactAlarms = view.findViewById(R.id.swExactAlarms);
swInfra = view.findViewById(R.id.swInfra);
swDupMsgId = view.findViewById(R.id.swDupMsgId);
swLastSync = view.findViewById(R.id.swLastSync);
swTestIab = view.findViewById(R.id.swTestIab);
btnImportProviders = view.findViewById(R.id.btnImportProviders);
tvProcessors = view.findViewById(R.id.tvProcessors);
@ -1170,13 +1168,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
swLastSync.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("last_sync_time", checked).apply();
}
});
swTestIab.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -1774,7 +1765,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swExactAlarms.setChecked(prefs.getBoolean("exact_alarms", true));
swInfra.setChecked(prefs.getBoolean("infra", false));
swDupMsgId.setChecked(prefs.getBoolean("dup_msgids", false));
swLastSync.setChecked(prefs.getBoolean("last_sync_time", false));
swTestIab.setChecked(prefs.getBoolean("test_iab", false));
tvProcessors.setText(getString(R.string.title_advanced_processors, Runtime.getRuntime().availableProcessors()));

View File

@ -34,7 +34,6 @@ public class TupleAccountFolder extends EntityAccount {
public boolean folderSync;
public String folderState;
public String folderSyncState;
public Long folderLastSync;
public int executing;
public int messages;
public int unseen;
@ -74,7 +73,6 @@ public class TupleAccountFolder extends EntityAccount {
this.folderSync == other.folderSync &&
Objects.equals(this.folderState, other.folderState) &&
Objects.equals(this.folderSyncState, other.folderSyncState) &&
Objects.equals(this.folderLastSync, other.folderLastSync) &&
this.executing == other.executing &&
this.messages == other.messages &&
this.unseen == other.unseen);

View File

@ -1435,17 +1435,6 @@
app:layout_constraintTop_toBottomOf="@id/tvDkimVerifyHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swLastSync"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_show_last_sync"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swDupMsgId"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swTestIab"
android:layout_width="0dp"
@ -1454,7 +1443,7 @@
android:text="@string/title_advanced_test_iab"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swLastSync"
app:layout_constraintTop_toBottomOf="@id/swDupMsgId"
app:switchPadding="12dp" />
<Button

View File

@ -750,7 +750,6 @@
<string name="title_advanced_exact_alarms" translatable="false">Use exact timers</string>
<string name="title_advanced_infra" translatable="false">Show infrastructure</string>
<string name="title_advanced_dup_msgid" translatable="false">Duplicates by message ID</string>
<string name="title_advanced_show_last_sync" translatable="false">Show last sync time</string>
<string name="title_advanced_test_iab" translatable="false">Test IAB</string>
<string name="title_advanced_import_providers" translatable="false">Import providers</string>
<string name="title_advanced_processors" translatable="false">Processors: %1$d</string>