Added folder type to widget intent

pull/184/head
M66B 4 years ago
parent 23f3d29aa3
commit 962491354e

@ -1039,19 +1039,15 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
} else if (action.equals("widget")) { } else if (action.equals("widget")) {
long account = intent.getLongExtra("account", -1); long account = intent.getLongExtra("account", -1);
long folder = intent.getLongExtra("folder", -1); long folder = intent.getLongExtra("folder", -1);
String type = intent.getStringExtra("type");
intent.removeExtra("account"); if (account > 0 && folder > 0 && !TextUtils.isEmpty(type)) {
intent.removeExtra("folder");
setIntent(intent);
if (account > 0 && folder > 0) {
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) { if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
getSupportFragmentManager().popBackStack("messages", FragmentManager.POP_BACK_STACK_INCLUSIVE); getSupportFragmentManager().popBackStack("messages", FragmentManager.POP_BACK_STACK_INCLUSIVE);
Bundle args = new Bundle(); Bundle args = new Bundle();
//args.putString("type", intent.getStringExtra("type"));
args.putLong("account", account); args.putLong("account", account);
args.putLong("folder", folder); args.putLong("folder", folder);
args.putString("type", type);
FragmentMessages fragment = new FragmentMessages(); FragmentMessages fragment = new FragmentMessages();
fragment.setArguments(args); fragment.setArguments(args);

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

Loading…
Cancel
Save