|
|
@ -415,6 +415,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
private ImageButton ibTrash;
|
|
|
|
private ImageButton ibTrash;
|
|
|
|
private ImageButton ibJunk;
|
|
|
|
private ImageButton ibJunk;
|
|
|
|
private ImageButton ibInbox;
|
|
|
|
private ImageButton ibInbox;
|
|
|
|
|
|
|
|
private ImageButton ibTools;
|
|
|
|
private ImageButton ibMore;
|
|
|
|
private ImageButton ibMore;
|
|
|
|
private TextView tvSignedData;
|
|
|
|
private TextView tvSignedData;
|
|
|
|
|
|
|
|
|
|
|
@ -615,6 +616,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
ibTrash = vsBody.findViewById(R.id.ibTrash);
|
|
|
|
ibTrash = vsBody.findViewById(R.id.ibTrash);
|
|
|
|
ibJunk = vsBody.findViewById(R.id.ibJunk);
|
|
|
|
ibJunk = vsBody.findViewById(R.id.ibJunk);
|
|
|
|
ibInbox = vsBody.findViewById(R.id.ibInbox);
|
|
|
|
ibInbox = vsBody.findViewById(R.id.ibInbox);
|
|
|
|
|
|
|
|
ibTools = vsBody.findViewById(R.id.ibTools);
|
|
|
|
ibMore = vsBody.findViewById(R.id.ibMore);
|
|
|
|
ibMore = vsBody.findViewById(R.id.ibMore);
|
|
|
|
tvSignedData = vsBody.findViewById(R.id.tvSignedData);
|
|
|
|
tvSignedData = vsBody.findViewById(R.id.tvSignedData);
|
|
|
|
|
|
|
|
|
|
|
@ -704,6 +706,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
ibTrash.setOnClickListener(this);
|
|
|
|
ibTrash.setOnClickListener(this);
|
|
|
|
ibJunk.setOnClickListener(this);
|
|
|
|
ibJunk.setOnClickListener(this);
|
|
|
|
ibInbox.setOnClickListener(this);
|
|
|
|
ibInbox.setOnClickListener(this);
|
|
|
|
|
|
|
|
ibTools.setOnClickListener(this);
|
|
|
|
ibMore.setOnClickListener(this);
|
|
|
|
ibMore.setOnClickListener(this);
|
|
|
|
|
|
|
|
|
|
|
|
ibDownloading.setOnClickListener(this);
|
|
|
|
ibDownloading.setOnClickListener(this);
|
|
|
@ -790,6 +793,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
ibTrash.setOnClickListener(null);
|
|
|
|
ibTrash.setOnClickListener(null);
|
|
|
|
ibJunk.setOnClickListener(null);
|
|
|
|
ibJunk.setOnClickListener(null);
|
|
|
|
ibInbox.setOnClickListener(null);
|
|
|
|
ibInbox.setOnClickListener(null);
|
|
|
|
|
|
|
|
ibTools.setOnClickListener(null);
|
|
|
|
ibMore.setOnClickListener(null);
|
|
|
|
ibMore.setOnClickListener(null);
|
|
|
|
|
|
|
|
|
|
|
|
ibDownloading.setOnClickListener(null);
|
|
|
|
ibDownloading.setOnClickListener(null);
|
|
|
@ -1283,6 +1287,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
ibTrash.setVisibility(View.GONE);
|
|
|
|
ibTrash.setVisibility(View.GONE);
|
|
|
|
ibJunk.setVisibility(View.GONE);
|
|
|
|
ibJunk.setVisibility(View.GONE);
|
|
|
|
ibInbox.setVisibility(View.GONE);
|
|
|
|
ibInbox.setVisibility(View.GONE);
|
|
|
|
|
|
|
|
ibTools.setVisibility(View.GONE);
|
|
|
|
ibMore.setVisibility(View.GONE);
|
|
|
|
ibMore.setVisibility(View.GONE);
|
|
|
|
tvSignedData.setVisibility(View.GONE);
|
|
|
|
tvSignedData.setVisibility(View.GONE);
|
|
|
|
|
|
|
|
|
|
|
@ -1412,6 +1417,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
ibTrash.setVisibility(View.GONE);
|
|
|
|
ibTrash.setVisibility(View.GONE);
|
|
|
|
ibJunk.setVisibility(View.GONE);
|
|
|
|
ibJunk.setVisibility(View.GONE);
|
|
|
|
ibInbox.setVisibility(View.GONE);
|
|
|
|
ibInbox.setVisibility(View.GONE);
|
|
|
|
|
|
|
|
ibTools.setVisibility(View.GONE);
|
|
|
|
ibMore.setVisibility(EntityFolder.OUTBOX.equals(message.folderType) ? View.GONE : View.VISIBLE);
|
|
|
|
ibMore.setVisibility(EntityFolder.OUTBOX.equals(message.folderType) ? View.GONE : View.VISIBLE);
|
|
|
|
tvSignedData.setVisibility(View.GONE);
|
|
|
|
tvSignedData.setVisibility(View.GONE);
|
|
|
|
|
|
|
|
|
|
|
@ -1468,6 +1474,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// Setup actions
|
|
|
|
// Setup actions
|
|
|
|
|
|
|
|
setupTools(message, scroll, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void setupTools(final TupleMessageEx message, final boolean scroll, final boolean bind) {
|
|
|
|
Bundle sargs = new Bundle();
|
|
|
|
Bundle sargs = new Bundle();
|
|
|
|
sargs.putLong("id", message.id);
|
|
|
|
sargs.putLong("id", message.id);
|
|
|
|
sargs.putLong("account", message.account);
|
|
|
|
sargs.putLong("account", message.account);
|
|
|
@ -1525,22 +1535,26 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
boolean button_rule = prefs.getBoolean("button_rule", false);
|
|
|
|
boolean button_rule = prefs.getBoolean("button_rule", false);
|
|
|
|
boolean expand_all = prefs.getBoolean("expand_all", false);
|
|
|
|
boolean expand_all = prefs.getBoolean("expand_all", false);
|
|
|
|
boolean expand_one = prefs.getBoolean("expand_one", true);
|
|
|
|
boolean expand_one = prefs.getBoolean("expand_one", true);
|
|
|
|
|
|
|
|
boolean tools = prefs.getBoolean("message_tools", true);
|
|
|
|
|
|
|
|
|
|
|
|
ibTrash.setTag(delete);
|
|
|
|
ibTrash.setTag(delete);
|
|
|
|
|
|
|
|
|
|
|
|
ibRule.setVisibility(button_rule && !outbox &&
|
|
|
|
ibRule.setVisibility(tools && button_rule && !outbox &&
|
|
|
|
message.accountProtocol == EntityAccount.TYPE_IMAP ? View.VISIBLE : View.GONE);
|
|
|
|
message.accountProtocol == EntityAccount.TYPE_IMAP ? View.VISIBLE : View.GONE);
|
|
|
|
ibUnsubscribe.setVisibility(message.unsubscribe == null ? View.GONE : View.VISIBLE);
|
|
|
|
ibUnsubscribe.setVisibility(!tools || message.unsubscribe == null ? View.GONE : View.VISIBLE);
|
|
|
|
ibAnswer.setVisibility(outbox || (!expand_all && expand_one) ? View.GONE : View.VISIBLE);
|
|
|
|
ibAnswer.setVisibility(!tools || outbox || (!expand_all && expand_one) ? View.GONE : View.VISIBLE);
|
|
|
|
ibMove.setVisibility(move && button_move ? View.VISIBLE : View.GONE);
|
|
|
|
ibMove.setVisibility(tools && move && button_move ? View.VISIBLE : View.GONE);
|
|
|
|
ibArchive.setVisibility(archive && button_archive_trash ? View.VISIBLE : View.GONE);
|
|
|
|
ibArchive.setVisibility(tools && archive && button_archive_trash ? View.VISIBLE : View.GONE);
|
|
|
|
ibTrash.setVisibility(trash && button_archive_trash ? View.VISIBLE : View.GONE);
|
|
|
|
ibTrash.setVisibility(tools && trash && button_archive_trash ? View.VISIBLE : View.GONE);
|
|
|
|
ibJunk.setVisibility(junk ? View.VISIBLE : View.GONE);
|
|
|
|
ibJunk.setVisibility(tools && junk ? View.VISIBLE : View.GONE);
|
|
|
|
ibInbox.setVisibility(inbox ? View.VISIBLE : View.GONE);
|
|
|
|
ibInbox.setVisibility(tools && inbox ? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
ibTools.setImageLevel(tools ? 0 : 1);
|
|
|
|
ibTrashBottom.setVisibility(trash && button_archive_trash ? View.VISIBLE : View.GONE);
|
|
|
|
ibTools.setVisibility(View.VISIBLE);
|
|
|
|
ibArchiveBottom.setVisibility(archive && button_archive_trash ? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
|
|
|
|
ibTrashBottom.setVisibility(tools && trash && button_archive_trash ? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
ibArchiveBottom.setVisibility(tools && archive && button_archive_trash ? View.VISIBLE : View.GONE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (bind)
|
|
|
|
bindBody(message, scroll);
|
|
|
|
bindBody(message, scroll);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2745,6 +2759,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
case R.id.ibInbox:
|
|
|
|
case R.id.ibInbox:
|
|
|
|
onActionInbox(message);
|
|
|
|
onActionInbox(message);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case R.id.ibTools:
|
|
|
|
|
|
|
|
onActionTools(message);
|
|
|
|
|
|
|
|
break;
|
|
|
|
case R.id.ibMore:
|
|
|
|
case R.id.ibMore:
|
|
|
|
onActionMore(message);
|
|
|
|
onActionMore(message);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -3634,6 +3651,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
properties.move(message.id, EntityFolder.INBOX);
|
|
|
|
properties.move(message.id, EntityFolder.INBOX);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void onActionTools(TupleMessageEx message) {
|
|
|
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
|
|
|
|
boolean message_tools = !prefs.getBoolean("message_tools", true);
|
|
|
|
|
|
|
|
prefs.edit().putBoolean("message_tools", message_tools).apply();
|
|
|
|
|
|
|
|
setupTools(message, false, false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void onActionMore(TupleMessageEx message) {
|
|
|
|
private void onActionMore(TupleMessageEx message) {
|
|
|
|
boolean show_headers = properties.getValue("headers", message.id);
|
|
|
|
boolean show_headers = properties.getValue("headers", message.id);
|
|
|
|
boolean full = properties.getValue("full", message.id);
|
|
|
|
boolean full = properties.getValue("full", message.id);
|
|
|
|