mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-31 10:01:22 +01:00
Synchronize on demand
This commit is contained in:
@@ -29,6 +29,7 @@ import java.text.Collator;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -162,6 +163,17 @@ public class EntityFolder implements Serializable {
|
||||
public EntityFolder() {
|
||||
}
|
||||
|
||||
long getSyncDays() {
|
||||
int days = sync_days;
|
||||
if (last_sync != null) {
|
||||
int ago_days = (int) ((new Date().getTime() - last_sync) / (24 * 3600 * 1000L)) + 1;
|
||||
if (ago_days > days)
|
||||
days = ago_days;
|
||||
}
|
||||
|
||||
return (initialize ? Math.min(DEFAULT_INIT, keep_days) : days);
|
||||
}
|
||||
|
||||
static int getIcon(String type) {
|
||||
if (EntityFolder.INBOX.equals(type))
|
||||
return R.drawable.baseline_move_to_inbox_24;
|
||||
|
||||
Reference in New Issue
Block a user