1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 02:07:12 +00:00

Open underlying message list when opening thread from widget for specific folder

This commit is contained in:
M66B 2020-09-01 16:26:01 +02:00
parent 0e5b00dac9
commit 0bebca4bf8
2 changed files with 23 additions and 1 deletions

View file

@ -1036,8 +1036,28 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
intent.putExtra("thread", action.split(":", 2)[1]);
onViewThread(intent);
} else if (action.equals("widget"))
} else if (action.equals("widget")) {
long account = intent.getLongExtra("account", -1);
long folder = intent.getLongExtra("folder", -1);
if (account > 0 && folder > 0) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
getSupportFragmentManager().popBackStack("messages", FragmentManager.POP_BACK_STACK_INCLUSIVE);
Bundle args = new Bundle();
//args.putString("type", intent.getStringExtra("type"));
args.putLong("account", account);
args.putLong("folder", folder);
FragmentMessages fragment = new FragmentMessages();
fragment.setArguments(args);
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("messages");
fragmentTransaction.commit();
}
}
onViewThread(intent);
}
}
if (intent.hasExtra(Intent.EXTRA_PROCESS_TEXT)) {

View file

@ -89,6 +89,8 @@ public class WidgetUnified extends AppWidgetProvider {
Intent thread = new Intent(context, ActivityView.class);
thread.setAction("widget");
thread.putExtra("account", account);
thread.putExtra("folder", folder);
thread.putExtra("filter_archive", !EntityFolder.ARCHIVE.equals(type));
thread.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent piItem = PendingIntent.getActivity(