Revert "Scroll to top after recreate"

This reverts commit 1e2d0be945.
This commit is contained in:
M66B 2020-03-11 13:23:03 +01:00
parent 431809f164
commit 6a15b4000d
2 changed files with 0 additions and 33 deletions

View File

@ -124,8 +124,6 @@ import static androidx.core.app.NotificationCompat.DEFAULT_SOUND;
import static javax.mail.Folder.READ_WRITE;
class Core {
static final Map<Long, EntityFolder> newMessages = new HashMap<>();
private static final int MAX_NOTIFICATION_COUNT = 25; // per group
private static final long AFTER_SEND_DELAY = 15 * 1000L; // milliseconds
private static final int SYNC_CHUNCK_SIZE = 200;
@ -2305,10 +2303,6 @@ class Core {
// Prepare scroll to top
if (!message.ui_seen && message.received > account.created) {
synchronized (newMessages) {
newMessages.put(folder.id, folder);
}
Intent report = new Intent(FragmentMessages.ACTION_NEW_MESSAGE);
report.putExtra("folder", folder.id);
report.putExtra("unified", folder.unified);

View File

@ -3785,8 +3785,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
if (handleThreadActions(messages))
return;
checkNewMessages();
Log.i("Submit messages=" + messages.size());
adapter.submitList(messages);
@ -4512,10 +4510,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
long fid = intent.getLongExtra("folder", -1);
boolean unified = intent.getBooleanExtra("unified", false);
synchronized (Core.newMessages) {
Core.newMessages.remove(fid);
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean autoscroll = prefs.getBoolean("autoscroll", true);
@ -4525,27 +4519,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
adapter.gotoTop();
}
private void checkNewMessages() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean autoscroll = prefs.getBoolean("autoscroll", true);
boolean newMessages = false;
synchronized (Core.newMessages) {
for (long fid : new ArrayList<>(Core.newMessages.keySet())) {
EntityFolder f = Core.newMessages.get(fid);
if (f != null &&
((viewType == AdapterMessage.ViewType.UNIFIED && f.unified) ||
(viewType == AdapterMessage.ViewType.FOLDER && folder == f.id))) {
newMessages = true;
Core.newMessages.remove(fid);
}
}
}
if (autoscroll && newMessages)
adapter.gotoTop();
}
private void onStoreRaw(Intent intent) {
message = intent.getLongExtra("id", -1);
Intent create = new Intent(Intent.ACTION_CREATE_DOCUMENT);