|
|
|
@ -439,6 +439,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
private ImageButton ibAnswer;
|
|
|
|
|
private ImageButton ibRule;
|
|
|
|
|
private ImageButton ibUnsubscribe;
|
|
|
|
|
private ImageButton ibRaw;
|
|
|
|
|
private ImageButton ibHeaders;
|
|
|
|
|
private ImageButton ibPrint;
|
|
|
|
|
private ImageButton ibPin;
|
|
|
|
@ -856,6 +857,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
ibAnswer = vsBody.findViewById(R.id.ibAnswer);
|
|
|
|
|
ibRule = vsBody.findViewById(R.id.ibRule);
|
|
|
|
|
ibUnsubscribe = vsBody.findViewById(R.id.ibUnsubscribe);
|
|
|
|
|
ibRaw = vsBody.findViewById(R.id.ibRaw);
|
|
|
|
|
ibHeaders = vsBody.findViewById(R.id.ibHeaders);
|
|
|
|
|
ibPrint = vsBody.findViewById(R.id.ibPrint);
|
|
|
|
|
ibPin = vsBody.findViewById(R.id.ibPin);
|
|
|
|
@ -999,6 +1001,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
ibAnswer.setOnClickListener(this);
|
|
|
|
|
ibRule.setOnClickListener(this);
|
|
|
|
|
ibUnsubscribe.setOnClickListener(this);
|
|
|
|
|
ibRaw.setOnClickListener(this);
|
|
|
|
|
ibHeaders.setOnClickListener(this);
|
|
|
|
|
ibHeaders.setOnLongClickListener(this);
|
|
|
|
|
ibPrint.setOnClickListener(this);
|
|
|
|
@ -1113,6 +1116,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
ibAnswer.setOnClickListener(null);
|
|
|
|
|
ibRule.setOnClickListener(null);
|
|
|
|
|
ibUnsubscribe.setOnClickListener(null);
|
|
|
|
|
ibRaw.setOnClickListener(null);
|
|
|
|
|
ibHeaders.setOnClickListener(null);
|
|
|
|
|
ibHeaders.setOnLongClickListener(null);
|
|
|
|
|
ibPrint.setOnClickListener(null);
|
|
|
|
@ -1676,6 +1680,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
ibAnswer.setVisibility(View.GONE);
|
|
|
|
|
ibRule.setVisibility(View.GONE);
|
|
|
|
|
ibUnsubscribe.setVisibility(View.GONE);
|
|
|
|
|
ibRaw.setVisibility(View.GONE);
|
|
|
|
|
ibHeaders.setVisibility(View.GONE);
|
|
|
|
|
ibPrint.setVisibility(View.GONE);
|
|
|
|
|
ibPin.setVisibility(View.GONE);
|
|
|
|
@ -1927,6 +1932,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
ibAnswer.setVisibility(View.GONE);
|
|
|
|
|
ibRule.setVisibility(View.GONE);
|
|
|
|
|
ibUnsubscribe.setVisibility(View.GONE);
|
|
|
|
|
ibRaw.setVisibility(View.GONE);
|
|
|
|
|
ibHeaders.setVisibility(View.GONE);
|
|
|
|
|
ibPrint.setVisibility(View.GONE);
|
|
|
|
|
ibPin.setVisibility(View.GONE);
|
|
|
|
@ -2114,6 +2120,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
boolean forever = (delete && (!pop || !message.accountLeaveDeleted));
|
|
|
|
|
boolean report = (pop ? inInbox : !inJunk && move);
|
|
|
|
|
boolean headers = (message.uid != null || (pop && message.headers != null));
|
|
|
|
|
boolean raw = (message.uid != null ||
|
|
|
|
|
(EntityFolder.INBOX.equals(message.folderType) &&
|
|
|
|
|
message.accountProtocol == EntityAccount.TYPE_POP));
|
|
|
|
|
|
|
|
|
|
evalProperties(message); // TODO: done again in bindBody
|
|
|
|
|
|
|
|
|
@ -2144,6 +2153,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
boolean button_pin = prefs.getBoolean("button_pin", false);
|
|
|
|
|
boolean button_print = prefs.getBoolean("button_print", false);
|
|
|
|
|
boolean button_headers = prefs.getBoolean("button_headers", false);
|
|
|
|
|
boolean button_raw = prefs.getBoolean("button_raw", false);
|
|
|
|
|
boolean button_unsubscribe = prefs.getBoolean("button_unsubscribe", true);
|
|
|
|
|
boolean button_rule = prefs.getBoolean("button_rule", false);
|
|
|
|
|
boolean swipe_reply = prefs.getBoolean("swipe_reply", false);
|
|
|
|
@ -2163,6 +2173,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
ibAnswer.setVisibility(!tools || outbox || (!expand_all && expand_one) || !threading || swipe_reply ? View.GONE : View.VISIBLE);
|
|
|
|
|
ibRule.setVisibility(tools && button_rule && !outbox && !message.folderReadOnly ? View.VISIBLE : View.GONE);
|
|
|
|
|
ibUnsubscribe.setVisibility(tools && button_unsubscribe && message.unsubscribe != null ? View.VISIBLE : View.GONE);
|
|
|
|
|
ibRaw.setVisibility(tools && button_raw && raw ? View.VISIBLE : View.GONE);
|
|
|
|
|
ibHeaders.setVisibility(tools && button_headers && headers ? View.VISIBLE : View.GONE);
|
|
|
|
|
ibPrint.setVisibility(tools && !outbox && button_print && hasWebView && message.content && Helper.canPrint(context) ? View.VISIBLE : View.GONE);
|
|
|
|
|
ibPin.setVisibility(tools && !outbox && button_pin && pin ? View.VISIBLE : View.GONE);
|
|
|
|
@ -3900,6 +3911,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
onMenuCreateRule(message);
|
|
|
|
|
} else if (id == R.id.ibUnsubscribe) {
|
|
|
|
|
onActionUnsubscribe(message);
|
|
|
|
|
} else if (id == R.id.ibRaw) {
|
|
|
|
|
onMenuRawSave(message);
|
|
|
|
|
} else if (id == R.id.ibHeaders) {
|
|
|
|
|
onMenuShowHeaders(message);
|
|
|
|
|
} else if (id == R.id.ibPrint) {
|
|
|
|
@ -8438,6 +8451,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
final CheckBox cbPin = dview.findViewById(R.id.cbPin);
|
|
|
|
|
final CheckBox cbPrint = dview.findViewById(R.id.cbPrint);
|
|
|
|
|
final CheckBox cbHeaders = dview.findViewById(R.id.cbHeaders);
|
|
|
|
|
final CheckBox cbRaw = dview.findViewById(R.id.cbRaw);
|
|
|
|
|
final CheckBox cbUnsubscribe = dview.findViewById(R.id.cbUnsubscribe);
|
|
|
|
|
|
|
|
|
|
cbTranslate.setVisibility(DeepL.isAvailable(context) ? View.VISIBLE : View.GONE);
|
|
|
|
@ -8463,6 +8477,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
cbPin.setChecked(prefs.getBoolean("button_pin", false));
|
|
|
|
|
cbPrint.setChecked(prefs.getBoolean("button_print", false));
|
|
|
|
|
cbHeaders.setChecked(prefs.getBoolean("button_headers", false));
|
|
|
|
|
cbRaw.setChecked(prefs.getBoolean("button_raw", false));
|
|
|
|
|
cbUnsubscribe.setChecked(prefs.getBoolean("button_unsubscribe", true));
|
|
|
|
|
|
|
|
|
|
return new AlertDialog.Builder(getContext())
|
|
|
|
@ -8491,6 +8506,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
editor.putBoolean("button_pin", cbPin.isChecked());
|
|
|
|
|
editor.putBoolean("button_print", cbPrint.isChecked());
|
|
|
|
|
editor.putBoolean("button_headers", cbHeaders.isChecked());
|
|
|
|
|
editor.putBoolean("button_raw", cbRaw.isChecked());
|
|
|
|
|
editor.putBoolean("button_unsubscribe", cbUnsubscribe.isChecked());
|
|
|
|
|
editor.apply();
|
|
|
|
|
sendResult(Activity.RESULT_OK);
|
|
|
|
|