Added manage filters/contacts to spam dialog

This commit is contained in:
M66B
2021-10-30 17:02:01 +02:00
parent 686a4d1f9c
commit b9f446f0fa
3 changed files with 72 additions and 2 deletions

View File

@@ -82,6 +82,8 @@ public class FragmentDialogJunk extends FragmentDialogBase {
final TextView tvBlocklist = view.findViewById(R.id.tvBlocklist);
final ImageButton ibInfoBlocklist = view.findViewById(R.id.ibInfoBlocklist);
final Button btnClear = view.findViewById(R.id.btnClear);
final ImageButton ibRules = view.findViewById(R.id.ibRules);
final ImageButton ibManage = view.findViewById(R.id.ibManage);
final Group grpInJunk = view.findViewById(R.id.grpInJunk);
final Group grpMore = view.findViewById(R.id.grpMore);
@@ -271,6 +273,38 @@ public class FragmentDialogJunk extends FragmentDialogBase {
}
});
ibRules.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(v.getContext());
lbm.sendBroadcast(
new Intent(ActivityView.ACTION_EDIT_RULES)
.putExtra("account", account)
.putExtra("protocol", protocol)
.putExtra("folder", folder)
.putExtra("type", type));
dismiss();
}
});
ibManage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle args = new Bundle();
args.putBoolean("junk", true);
FragmentContacts fragment = new FragmentContacts();
fragment.setArguments(args);
FragmentTransaction fragmentTransaction = getParentFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("contacts");
fragmentTransaction.commit();
dismiss();
}
});
try {
boolean common = false;
Address[] froms = InternetAddress.parseHeader(from, false);