mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Introduce RssFeedViewModel
Furnishing the RssFeed function as a single activity with fragments for Manage and Import.
This commit is contained in:
@@ -10,7 +10,7 @@ import javax.annotation.concurrent.Immutable;
|
||||
|
||||
@Immutable
|
||||
@NotNullByDefault
|
||||
public class Feed {
|
||||
public class Feed implements Comparable<Feed> {
|
||||
|
||||
private final String url;
|
||||
private final Blog blog;
|
||||
@@ -94,4 +94,13 @@ public class Feed {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Feed o) {
|
||||
if (this == o) return 0;
|
||||
long aTime = getAdded(), bTime = o.getAdded();
|
||||
if (aTime > bTime) return -1;
|
||||
if (aTime < bTime) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.briarproject.briar.api.feed;
|
||||
|
||||
import org.briarproject.bramble.api.db.DbException;
|
||||
import org.briarproject.bramble.api.db.Transaction;
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.bramble.api.sync.ClientId;
|
||||
|
||||
@@ -23,7 +24,7 @@ public interface FeedManager {
|
||||
/**
|
||||
* Adds an RSS feed as a new dedicated blog.
|
||||
*/
|
||||
void addFeed(String url) throws DbException, IOException;
|
||||
Feed addFeed(String url) throws DbException, IOException;
|
||||
|
||||
/**
|
||||
* Removes an RSS feed.
|
||||
@@ -35,4 +36,8 @@ public interface FeedManager {
|
||||
*/
|
||||
List<Feed> getFeeds() throws DbException;
|
||||
|
||||
/**
|
||||
* Returns a list of all added RSS feeds
|
||||
*/
|
||||
List<Feed> getFeeds(Transaction txn) throws DbException;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user