Conditionally open unified inbox from notification

This commit is contained in:
M66B 2023-10-09 08:11:34 +02:00
parent 892ed3a0ad
commit 3474561692
1 changed files with 14 additions and 10 deletions

View File

@ -2019,19 +2019,23 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
boolean notify_open_folder = prefs.getBoolean("notify_open_folder", false); boolean notify_open_folder = prefs.getBoolean("notify_open_folder", false);
if (account > 0 && folder > 0 && !TextUtils.isEmpty(type) && notify_open_folder) { if (account > 0 && folder > 0 && !TextUtils.isEmpty(type) && notify_open_folder) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) { if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
getSupportFragmentManager().popBackStack("messages", FragmentManager.POP_BACK_STACK_INCLUSIVE); if (group >= 0)
getSupportFragmentManager().popBackStack("unified", 0);
else {
getSupportFragmentManager().popBackStack("messages", FragmentManager.POP_BACK_STACK_INCLUSIVE);
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putLong("account", account); args.putLong("account", account);
args.putLong("folder", folder); args.putLong("folder", folder);
args.putString("type", type); args.putString("type", type);
FragmentMessages fragment = new FragmentMessages(); FragmentMessages fragment = new FragmentMessages();
fragment.setArguments(args); fragment.setArguments(args);
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("messages"); fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("messages");
fragmentTransaction.commit(); fragmentTransaction.commit();
}
} }
} }
onViewThread(intent); onViewThread(intent);