mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 11:28:41 +01:00
Scroll up when navigating from new messages notification
This commit is contained in:
@@ -98,7 +98,7 @@ public class ActivitySetup extends ActivityBilling implements FragmentManager.On
|
||||
public void onBackStackChanged() {
|
||||
if (getSupportFragmentManager().getBackStackEntryCount() == 0) {
|
||||
if (hasAccount)
|
||||
startActivity(new Intent(this, ActivityView.class).putExtra("setup", true));
|
||||
startActivity(new Intent(this, ActivityView.class));
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
private ListView drawerList;
|
||||
private ActionBarDrawerToggle drawerToggle;
|
||||
|
||||
private boolean newIntent = false;
|
||||
private boolean newMessages = false;
|
||||
private long attachment = -1;
|
||||
|
||||
private static final int ATTACHMENT_BUFFER_SIZE = 8192; // bytes
|
||||
@@ -357,10 +357,6 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
if (intent.getBooleanExtra("setup", false))
|
||||
intent.getExtras().remove("setup");
|
||||
else
|
||||
newIntent = true;
|
||||
checkIntent(intent);
|
||||
super.onNewIntent(intent);
|
||||
}
|
||||
@@ -378,9 +374,12 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
iff.addAction(ACTION_STORE_ATTACHMENT);
|
||||
lbm.registerReceiver(receiver, iff);
|
||||
|
||||
if (newIntent) {
|
||||
newIntent = false;
|
||||
getSupportFragmentManager().popBackStack("unified", 0);
|
||||
if (newMessages) {
|
||||
newMessages = false;
|
||||
FragmentManager fm = getSupportFragmentManager();
|
||||
fm.popBackStack("unified", 0);
|
||||
FragmentMessages fragment = (FragmentMessages) fm.findFragmentById(R.id.content_frame);
|
||||
fragment.onNewMessages();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -439,6 +438,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
||||
intent.setAction(null);
|
||||
setIntent(intent);
|
||||
|
||||
newMessages = true;
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("time", new Date().getTime());
|
||||
|
||||
|
||||
@@ -670,4 +670,8 @@ public class FragmentMessages extends FragmentEx {
|
||||
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("folders");
|
||||
fragmentTransaction.commit();
|
||||
}
|
||||
|
||||
void onNewMessages() {
|
||||
rvMessage.scrollToPosition(0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user