Show sent date if set, show new emails with bold subject and from

This commit is contained in:
str4d
2014-02-27 10:14:21 +00:00
parent 8c1077d090
commit 494e771430
2 changed files with 23 additions and 1 deletions

View File

@@ -29,4 +29,13 @@
android:layout_below="@+id/email_from"
android:text="Content" />
<TextView
android:id="@+id/email_sent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/email_subject"
android:text="##:## XX"
android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>

View File

@@ -2,6 +2,7 @@ package i2p.bote;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.text.DateFormat;
import java.util.List;
import javax.mail.MessagingException;
@@ -9,6 +10,7 @@ import javax.mail.MessagingException;
import i2p.bote.email.Email;
import i2p.bote.fileencryption.PasswordException;
import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -40,9 +42,20 @@ public class EmailListAdapter extends ArrayAdapter<Email> {
TextView subject = (TextView) v.findViewById(R.id.email_subject);
TextView from = (TextView) v.findViewById(R.id.email_from);
TextView content = (TextView) v.findViewById(R.id.email_content);
TextView sent = (TextView) v.findViewById(R.id.email_sent);
try {
subject.setText(email.getSubject());
from.setText(BoteHelper.getNameAndShortDestination(email.getOneFromAddress()));
from.setText(BoteHelper.getNameAndShortDestination(
email.getOneFromAddress()));
if (email.getSentDate() != null)
sent.setText(DateFormat.getInstance().format(
email.getSentDate()));
if (email.isNew()) {
subject.setTypeface(Typeface.DEFAULT_BOLD);
from.setTypeface(Typeface.DEFAULT_BOLD);
}
} catch (MessagingException e) {
subject.setText("ERROR: " + e.getMessage());
} catch (PasswordException e) {