From 38be0ba01f6dd08c0be1a830e0d0389405949a56 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Mon, 7 Jan 2019 19:03:49 +0800 Subject: New feature: Subscribe or unsubscribe to a subreddit. Allow clear text traffic in Android Pie. Rewrite some code in lambda. --- .../main/java/SubredditDatabase/SubredditData.java | 35 ++++------------------ 1 file changed, 5 insertions(+), 30 deletions(-) (limited to 'app/src/main/java/SubredditDatabase/SubredditData.java') 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; } -- cgit v1.2.3