mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Add a BlogActivity that shows a list of blog posts
This commit lays the groundwork for #415
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user