mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 07:01:05 +00:00
Navigate to unified inbox from notification or widget
This commit is contained in:
parent
b0eeff6846
commit
203fcc1eba
3 changed files with 12 additions and 5 deletions
|
@ -359,15 +359,20 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
Intent intent = getIntent();
|
||||
String action = intent.getAction();
|
||||
Log.i(Helper.TAG, "View intent=" + intent + " action=" + action);
|
||||
if (action != null && action.startsWith("thread")) {
|
||||
if (action != null) {
|
||||
intent.setAction(null);
|
||||
setIntent(intent);
|
||||
|
||||
ViewModelMessages model = ViewModelProviders.of(this).get(ViewModelMessages.class);
|
||||
model.setMessages(null);
|
||||
if ("unified".equals(action))
|
||||
getSupportFragmentManager().popBackStack("unified", 0);
|
||||
|
||||
intent.putExtra("thread", action.split(":", 2)[1]);
|
||||
onViewThread(intent);
|
||||
else if (action.startsWith("thread")) {
|
||||
ViewModelMessages model = ViewModelProviders.of(this).get(ViewModelMessages.class);
|
||||
model.setMessages(null);
|
||||
|
||||
intent.putExtra("thread", action.split(":", 2)[1]);
|
||||
onViewThread(intent);
|
||||
}
|
||||
}
|
||||
|
||||
if (getIntent().hasExtra(Intent.EXTRA_PROCESS_TEXT)) {
|
||||
|
|
|
@ -384,6 +384,7 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
|
||||
// Build pending intent
|
||||
Intent view = new Intent(this, ActivityView.class);
|
||||
view.setAction("unified");
|
||||
view.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
PendingIntent piView = PendingIntent.getActivity(
|
||||
this, ActivityView.REQUEST_UNIFIED, view, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
|
|
@ -47,6 +47,7 @@ public class Widget extends AppWidgetProvider {
|
|||
|
||||
private static void update(int[] appWidgetIds, AppWidgetManager appWidgetManager, Context context, int count) {
|
||||
Intent intent = new Intent(context, ActivityView.class);
|
||||
intent.setAction("unified");
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
PendingIntent pi = PendingIntent.getActivity(context, ActivityView.REQUEST_UNIFIED, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
for (int id : appWidgetIds) {
|
||||
|
|
Loading…
Reference in a new issue