Removed subject line from wire format, added content type.

This commit is contained in:
akwizgran
2013-03-02 04:45:02 +00:00
parent 882420ebc2
commit a651e8ef73
24 changed files with 239 additions and 149 deletions

View File

@@ -45,6 +45,13 @@ implements OnItemClickListener {
else star.setImageResource(R.drawable.rating_not_important);
layout.addView(star);
if(!item.getContentType().equals("text/plain")) {
ImageView attachment = new ImageView(ctx);
attachment.setPadding(0, 5, 5, 5);
attachment.setImageResource(R.drawable.content_attachment);
layout.addView(attachment);
}
TextView subject = new TextView(ctx);
// Give me all the unused width
subject.setLayoutParams(new LayoutParams(WRAP_CONTENT, WRAP_CONTENT,

View File

@@ -112,21 +112,21 @@ implements OnClickListener, DatabaseListener {
ContactId contactId = db.addContact("Carol");
// Insert some fake messages to and from the contact
Message m = messageFactory.createPrivateMessage(null,
"First message's subject is short",
"First message's body".getBytes("UTF-8"));
"text/plain",
"First message is short".getBytes("UTF-8"));
db.addLocalPrivateMessage(m, contactId);
db.setReadFlag(m.getId(), true);
db.setStarredFlag(m.getId(), true);
Thread.sleep(1000);
m = messageFactory.createPrivateMessage(m.getId(),
"Second message's subject is also short",
"Second message's body".getBytes("UTF-8"));
"image/jpeg", new byte[1000]);
db.receiveMessage(contactId, m);
Thread.sleep(1000);
m = messageFactory.createPrivateMessage(m.getId(),
"Third message's subject is quite long to test"
+ " line wrapping and exciting stuff like that",
"Third message's body".getBytes("UTF-8"));
"text/plain",
("Third message is quite long to test line"
+ " wrapping and subject line extraction and"
+ " all that fun stuff").getBytes("UTF-8"));
db.addLocalPrivateMessage(m, contactId);
db.setReadFlag(m.getId(), true);
}