Scroll up on navigating from summary notification / widget

This commit is contained in:
M66B 2019-02-09 19:09:46 +00:00
parent a45bee2e7c
commit e64178d530
1 changed files with 15 additions and 10 deletions

View File

@ -347,15 +347,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
}
});
if (getSupportFragmentManager().getFragments().size() == 0 &&
!getIntent().hasExtra(Intent.EXTRA_PROCESS_TEXT)) {
FragmentBase fragment = (unified ? new FragmentMessages() : new FragmentFolders());
fragment.setArguments(new Bundle());
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("unified");
fragmentTransaction.commit();
}
if (getSupportFragmentManager().getFragments().size() == 0 && !getIntent().hasExtra(Intent.EXTRA_PROCESS_TEXT))
init();
if (savedInstanceState != null)
drawerToggle.setDrawerIndicatorEnabled(savedInstanceState.getBoolean("toggle"));
@ -373,6 +366,18 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
updateShortcuts();
}
private void init() {
FragmentBase fragment = (unified ? new FragmentMessages() : new FragmentFolders());
fragment.setArguments(new Bundle());
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fm.beginTransaction();
for (Fragment existing : fm.getFragments())
fragmentTransaction.remove(existing);
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("unified");
fragmentTransaction.commit();
}
private Runnable checkIntent = new Runnable() {
@Override
public void run() {
@ -388,7 +393,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
setIntent(intent);
if ("unified".equals(action))
getSupportFragmentManager().popBackStack("unified", 0);
init();
else if ("error".equals(action))
onDebugInfo();