Add a BlogActivity that shows a list of blog posts

This commit lays the groundwork for #415
This commit is contained in:
Torsten Grote
2016-06-07 17:44:45 -03:00
parent d05237d2c1
commit 365fbb45ad
14 changed files with 540 additions and 14 deletions

View File

@@ -0,0 +1,52 @@
package org.briarproject.android.blogs;
import org.briarproject.api.blogs.BlogPostHeader;
import org.briarproject.api.identity.Author;
import org.briarproject.api.identity.Author.Status;
import org.briarproject.api.sync.MessageId;
// This class is not thread-safe
class BlogPostItem {
private final BlogPostHeader header;
private final byte[] body;
private boolean read;
BlogPostItem(BlogPostHeader header, byte[] body) {
this.header = header;
this.body = body;
read = header.isRead();
}
public MessageId getId() {
return header.getId();
}
public String getTitle() {
return header.getTitle();
}
public byte[] getBody() {
return body;
}
public long getTimestamp() {
return header.getTimestamp();
}
public Author getAuthor() {
return header.getAuthor();
}
Status getAuthorStatus() {
return header.getAuthorStatus();
}
public void setRead(boolean read) {
this.read = read;
}
public boolean isRead() {
return read;
}
}