Browse Source

Fixed crash, simplification

main
M66B 6 years ago
parent
commit
e8032df960
3 changed files with 10 additions and 10 deletions
  1. +3
    -3
      app/src/main/java/eu/faircode/email/FragmentCompose.java
  2. +5
    -5
      app/src/main/java/eu/faircode/email/FragmentMessage.java
  3. +2
    -2
      app/src/main/java/eu/faircode/email/MessageHelper.java

+ 3
- 3
app/src/main/java/eu/faircode/email/FragmentCompose.java View File

@ -865,9 +865,9 @@ public class FragmentCompose extends FragmentEx {
final String action = getArguments().getString("action");
Log.i(Helper.TAG, "Loaded draft id=" + draft.id + " action=" + action);
etTo.setText(draft.to == null ? null : MessageHelper.getFormattedAddresses(draft.to, true));
etCc.setText(draft.cc == null ? null : MessageHelper.getFormattedAddresses(draft.cc, true));
etBcc.setText(draft.bcc == null ? null : MessageHelper.getFormattedAddresses(draft.bcc, true));
etTo.setText(MessageHelper.getFormattedAddresses(draft.to, true));
etCc.setText(MessageHelper.getFormattedAddresses(draft.cc, true));
etBcc.setText(MessageHelper.getFormattedAddresses(draft.bcc, true));
etSubject.setText(draft.subject);
etBody.setText(null);


+ 5
- 5
app/src/main/java/eu/faircode/email/FragmentMessage.java View File

@ -375,16 +375,16 @@ public class FragmentMessage extends FragmentEx {
if (savedInstanceState == null) {
setSubtitle(Helper.localizeFolderName(getContext(), message.folderName));
tvFrom.setText(message.from == null ? null : MessageHelper.getFormattedAddresses(message.from, true));
tvFrom.setText(MessageHelper.getFormattedAddresses(message.from, true));
tvTime.setText(message.sent == null ? null : df.format(new Date(message.sent)));
tvTo.setText(message.to == null ? null : MessageHelper.getFormattedAddresses(message.to, true));
tvTo.setText(MessageHelper.getFormattedAddresses(message.to, true));
tvSubject.setText(message.subject);
tvCount.setText(Integer.toString(message.count));
tvReplyTo.setText(message.reply == null ? null : MessageHelper.getFormattedAddresses(message.reply, true));
tvCc.setText(message.cc == null ? null : MessageHelper.getFormattedAddresses(message.cc, true));
tvBcc.setText(message.bcc == null ? null : MessageHelper.getFormattedAddresses(message.bcc, true));
tvReplyTo.setText(MessageHelper.getFormattedAddresses(message.reply, true));
tvCc.setText(MessageHelper.getFormattedAddresses(message.cc, true));
tvBcc.setText(MessageHelper.getFormattedAddresses(message.bcc, true));
tvError.setText(message.error);
} else {


+ 2
- 2
app/src/main/java/eu/faircode/email/MessageHelper.java View File

@ -252,8 +252,8 @@ public class MessageHelper {
}
static String getFormattedAddresses(Address[] addresses, boolean full) {
if (addresses == null)
return null;
if (addresses == null || addresses.length == 0)
return "";
List<String> formatted = new ArrayList<>();
for (Address address : addresses)


Loading…
Cancel
Save