mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 14:46:31 +02:00
Improved scroll to top
This commit is contained in:
@@ -130,6 +130,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
static final String ACTION_EDIT_ANSWER = BuildConfig.APPLICATION_ID + ".EDIT_ANSWER";
|
||||
static final String ACTION_EDIT_RULES = BuildConfig.APPLICATION_ID + ".EDIT_RULES";
|
||||
static final String ACTION_EDIT_RULE = BuildConfig.APPLICATION_ID + ".EDIT_RULE";
|
||||
static final String ACTION_NEW_MESSAGE = BuildConfig.APPLICATION_ID + ".NEW_MESSAGE";
|
||||
|
||||
private static final int UPDATE_TIMEOUT = 15 * 1000; // milliseconds
|
||||
private static final long EXIT_DELAY = 2500L; // milliseconds
|
||||
@@ -616,6 +617,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
iff.addAction(ACTION_EDIT_ANSWER);
|
||||
iff.addAction(ACTION_EDIT_RULES);
|
||||
iff.addAction(ACTION_EDIT_RULE);
|
||||
iff.addAction(ACTION_NEW_MESSAGE);
|
||||
lbm.registerReceiver(receiver, iff);
|
||||
|
||||
checkUpdate(false);
|
||||
@@ -1153,6 +1155,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
onEditRules(intent);
|
||||
else if (ACTION_EDIT_RULE.equals(action))
|
||||
onEditRule(intent);
|
||||
else if (ACTION_NEW_MESSAGE.equals(action))
|
||||
onNewMessage(intent);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1257,6 +1261,25 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
fragmentTransaction.commit();
|
||||
}
|
||||
|
||||
private List<Long> updatedFolders = new ArrayList<>();
|
||||
|
||||
boolean isFolderUpdated(long folder) {
|
||||
boolean value = updatedFolders.contains(folder);
|
||||
if (value)
|
||||
updatedFolders.remove(folder);
|
||||
return value;
|
||||
}
|
||||
|
||||
private void onNewMessage(Intent intent) {
|
||||
long folder = intent.getLongExtra("folder", -1);
|
||||
boolean unified = intent.getBooleanExtra("unified", false);
|
||||
|
||||
if (!updatedFolders.contains(folder))
|
||||
updatedFolders.add(folder);
|
||||
if (unified && !updatedFolders.contains(-1L))
|
||||
updatedFolders.add(-1L);
|
||||
}
|
||||
|
||||
private class UpdateInfo {
|
||||
String tag_name; // version
|
||||
String html_url;
|
||||
|
||||
Reference in New Issue
Block a user