diff options
author | Alex Ning <chineseperson5@gmail.com> | 2019-01-07 11:03:49 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2019-01-07 11:03:49 +0000 |
commit | 38be0ba01f6dd08c0be1a830e0d0389405949a56 (patch) | |
tree | b083cf58f4737060f2f18ccabd4770e86ac58ccf /app/src/main/java/SubredditDatabase/SubredditData.java | |
parent | 9d729579bf7ea9e179774766c02ddae105d4ccd7 (diff) | |
download | infinity-for-reddit-38be0ba01f6dd08c0be1a830e0d0389405949a56.tar infinity-for-reddit-38be0ba01f6dd08c0be1a830e0d0389405949a56.tar.gz infinity-for-reddit-38be0ba01f6dd08c0be1a830e0d0389405949a56.tar.bz2 infinity-for-reddit-38be0ba01f6dd08c0be1a830e0d0389405949a56.tar.lz infinity-for-reddit-38be0ba01f6dd08c0be1a830e0d0389405949a56.tar.xz infinity-for-reddit-38be0ba01f6dd08c0be1a830e0d0389405949a56.tar.zst infinity-for-reddit-38be0ba01f6dd08c0be1a830e0d0389405949a56.zip |
New feature: Subscribe or unsubscribe to a subreddit. Allow clear text traffic in Android Pie. Rewrite some code in lambda.
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/SubredditDatabase/SubredditData.java | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/app/src/main/java/SubredditDatabase/SubredditData.java b/app/src/main/java/SubredditDatabase/SubredditData.java index bbd9f7d8..973eda18 100644 --- a/app/src/main/java/SubredditDatabase/SubredditData.java +++ b/app/src/main/java/SubredditDatabase/SubredditData.java @@ -2,23 +2,13 @@ package SubredditDatabase; import android.arch.persistence.room.ColumnInfo; import android.arch.persistence.room.Entity; -import android.arch.persistence.room.PrimaryKey; import android.support.annotation.NonNull; -@Entity(tableName = "subreddits") -public class SubredditData { - @PrimaryKey - @NonNull - @ColumnInfo(name = "id") - private String id; - - @ColumnInfo(name = "name") - private String name; - - @ColumnInfo(name = "icon_url") - private String iconUrl; +import SubscribedSubredditDatabase.SubscribedSubredditData; - @ColumnInfo(name = "banner_url") +@Entity(tableName = "subreddits") +public class SubredditData extends SubscribedSubredditData { + @ColumnInfo(name = "banner") private String bannerUrl; @ColumnInfo(name = "description") @@ -28,27 +18,12 @@ public class SubredditData { private int nSubscribers; public SubredditData(@NonNull String id, String name, String iconUrl, String bannerUrl, String description, int nSubscribers) { - this.id = id; - this.name = name; - this.iconUrl = iconUrl; + super(id, name, iconUrl); this.bannerUrl = bannerUrl; this.description = description; this.nSubscribers = nSubscribers; } - @NonNull - public String getId() { - return id; - } - - public String getName() { - return name; - } - - public String getIconUrl() { - return iconUrl; - } - public String getBannerUrl() { return bannerUrl; } |