소스 검색

Fix loading time

Infinite 3 년 전
부모
커밋
04d3d8a828

+ 8 - 0
app/src/main/java/club/thepenguins/android/api/APIService.java

@@ -2,7 +2,9 @@ package club.thepenguins.android.api;
 
 import java.util.List;
 
+import club.thepenguins.android.data.AuthorPosts;
 import club.thepenguins.android.data.Image;
+import club.thepenguins.android.data.IndividualPost;
 import club.thepenguins.android.data.Posts;
 import retrofit2.Call;
 import retrofit2.http.GET;
@@ -19,4 +21,10 @@ public interface APIService {
     @GET("wp-json/wp/v2/posts?_embed")
     Call<List<Posts>> getCategoryPosts(@Query("categories") String id);
 
+    @GET(".")
+    Call<IndividualPost> getPostContent();
+
+    @GET("wp-json/wp/v2/posts?_embed")
+    Call<AuthorPosts> getAuthorPosts(@Query("author") String id);
+
 }

+ 775 - 0
app/src/main/java/club/thepenguins/android/data/AuthorPosts.java

@@ -0,0 +1,775 @@
+package club.thepenguins.android.data;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+
+public class AuthorPosts {
+
+    @SerializedName("id")
+    @Expose
+    private Integer id;
+    @SerializedName("date")
+    @Expose
+    private String date;
+    @SerializedName("date_gmt")
+    @Expose
+    private String dateGmt;
+    @SerializedName("guid")
+    @Expose
+    private Guid guid;
+    @SerializedName("modified")
+    @Expose
+    private String modified;
+    @SerializedName("modified_gmt")
+    @Expose
+    private String modifiedGmt;
+    @SerializedName("slug")
+    @Expose
+    private String slug;
+    @SerializedName("status")
+    @Expose
+    private String status;
+    @SerializedName("type")
+    @Expose
+    private String type;
+    @SerializedName("link")
+    @Expose
+    private String link;
+    @SerializedName("title")
+    @Expose
+    private Title title;
+    @SerializedName("content")
+    @Expose
+    private Content content;
+    @SerializedName("excerpt")
+    @Expose
+    private Excerpt excerpt;
+    @SerializedName("author")
+    @Expose
+    private Integer author;
+    @SerializedName("featured_media")
+    @Expose
+    private Integer featuredMedia;
+    @SerializedName("comment_status")
+    @Expose
+    private String commentStatus;
+    @SerializedName("ping_status")
+    @Expose
+    private String pingStatus;
+    @SerializedName("sticky")
+    @Expose
+    private Boolean sticky;
+    @SerializedName("template")
+    @Expose
+    private String template;
+    @SerializedName("format")
+    @Expose
+    private String format;
+    @SerializedName("meta")
+    @Expose
+    private List<Object> meta = null;
+    @SerializedName("categories")
+    @Expose
+    private List<Integer> categories = null;
+    @SerializedName("tags")
+    @Expose
+    private List<Integer> tags = null;
+    @SerializedName("yoast_head")
+    @Expose
+    private String yoastHead;
+    @SerializedName("_links")
+    @Expose
+    private Links links;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getDate() {
+        return date;
+    }
+
+    public void setDate(String date) {
+        this.date = date;
+    }
+
+    public String getDateGmt() {
+        return dateGmt;
+    }
+
+    public void setDateGmt(String dateGmt) {
+        this.dateGmt = dateGmt;
+    }
+
+    public Guid getGuid() {
+        return guid;
+    }
+
+    public void setGuid(Guid guid) {
+        this.guid = guid;
+    }
+
+    public String getModified() {
+        return modified;
+    }
+
+    public void setModified(String modified) {
+        this.modified = modified;
+    }
+
+    public String getModifiedGmt() {
+        return modifiedGmt;
+    }
+
+    public void setModifiedGmt(String modifiedGmt) {
+        this.modifiedGmt = modifiedGmt;
+    }
+
+    public String getSlug() {
+        return slug;
+    }
+
+    public void setSlug(String slug) {
+        this.slug = slug;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getLink() {
+        return link;
+    }
+
+    public void setLink(String link) {
+        this.link = link;
+    }
+
+    public Title getTitle() {
+        return title;
+    }
+
+    public void setTitle(Title title) {
+        this.title = title;
+    }
+
+    public Content getContent() {
+        return content;
+    }
+
+    public void setContent(Content content) {
+        this.content = content;
+    }
+
+    public Excerpt getExcerpt() {
+        return excerpt;
+    }
+
+    public void setExcerpt(Excerpt excerpt) {
+        this.excerpt = excerpt;
+    }
+
+    public Integer getAuthor() {
+        return author;
+    }
+
+    public void setAuthor(Integer author) {
+        this.author = author;
+    }
+
+    public Integer getFeaturedMedia() {
+        return featuredMedia;
+    }
+
+    public void setFeaturedMedia(Integer featuredMedia) {
+        this.featuredMedia = featuredMedia;
+    }
+
+    public String getCommentStatus() {
+        return commentStatus;
+    }
+
+    public void setCommentStatus(String commentStatus) {
+        this.commentStatus = commentStatus;
+    }
+
+    public String getPingStatus() {
+        return pingStatus;
+    }
+
+    public void setPingStatus(String pingStatus) {
+        this.pingStatus = pingStatus;
+    }
+
+    public Boolean getSticky() {
+        return sticky;
+    }
+
+    public void setSticky(Boolean sticky) {
+        this.sticky = sticky;
+    }
+
+    public String getTemplate() {
+        return template;
+    }
+
+    public void setTemplate(String template) {
+        this.template = template;
+    }
+
+    public String getFormat() {
+        return format;
+    }
+
+    public void setFormat(String format) {
+        this.format = format;
+    }
+
+    public List<Object> getMeta() {
+        return meta;
+    }
+
+    public void setMeta(List<Object> meta) {
+        this.meta = meta;
+    }
+
+    public List<Integer> getCategories() {
+        return categories;
+    }
+
+    public void setCategories(List<Integer> categories) {
+        this.categories = categories;
+    }
+
+    public List<Integer> getTags() {
+        return tags;
+    }
+
+    public void setTags(List<Integer> tags) {
+        this.tags = tags;
+    }
+
+    public String getYoastHead() {
+        return yoastHead;
+    }
+
+    public void setYoastHead(String yoastHead) {
+        this.yoastHead = yoastHead;
+    }
+
+    public Links getLinks() {
+        return links;
+    }
+
+    public void setLinks(Links links) {
+        this.links = links;
+    }
+
+
+    public class About {
+
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class Author {
+
+        @SerializedName("embeddable")
+        @Expose
+        private Boolean embeddable;
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public Boolean getEmbeddable() {
+            return embeddable;
+        }
+
+        public void setEmbeddable(Boolean embeddable) {
+            this.embeddable = embeddable;
+        }
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+
+    public class Collection {
+
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class Content {
+
+        @SerializedName("rendered")
+        @Expose
+        private String rendered;
+        @SerializedName("protected")
+        @Expose
+        private Boolean _protected;
+
+        public String getRendered() {
+            return rendered;
+        }
+
+        public void setRendered(String rendered) {
+            this.rendered = rendered;
+        }
+
+        public Boolean getProtected() {
+            return _protected;
+        }
+
+        public void setProtected(Boolean _protected) {
+            this._protected = _protected;
+        }
+
+    }
+
+    public class Cury {
+
+        @SerializedName("name")
+        @Expose
+        private String name;
+        @SerializedName("href")
+        @Expose
+        private String href;
+        @SerializedName("templated")
+        @Expose
+        private Boolean templated;
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+        public Boolean getTemplated() {
+            return templated;
+        }
+
+        public void setTemplated(Boolean templated) {
+            this.templated = templated;
+        }
+
+    }
+
+    public class Excerpt {
+
+        @SerializedName("rendered")
+        @Expose
+        private String rendered;
+        @SerializedName("protected")
+        @Expose
+        private Boolean _protected;
+
+        public String getRendered() {
+            return rendered;
+        }
+
+        public void setRendered(String rendered) {
+            this.rendered = rendered;
+        }
+
+        public Boolean getProtected() {
+            return _protected;
+        }
+
+        public void setProtected(Boolean _protected) {
+            this._protected = _protected;
+        }
+
+    }
+
+    public class Guid {
+
+        @SerializedName("rendered")
+        @Expose
+        private String rendered;
+
+        public String getRendered() {
+            return rendered;
+        }
+
+        public void setRendered(String rendered) {
+            this.rendered = rendered;
+        }
+
+    }
+
+    public class Links {
+
+        @SerializedName("self")
+        @Expose
+        private List<Self> self = null;
+        @SerializedName("collection")
+        @Expose
+        private List<Collection> collection = null;
+        @SerializedName("about")
+        @Expose
+        private List<About> about = null;
+        @SerializedName("author")
+        @Expose
+        private List<Author> author = null;
+        @SerializedName("replies")
+        @Expose
+        private List<Reply> replies = null;
+        @SerializedName("version-history")
+        @Expose
+        private List<VersionHistory> versionHistory = null;
+        @SerializedName("predecessor-version")
+        @Expose
+        private List<PredecessorVersion> predecessorVersion = null;
+        @SerializedName("wp:featuredmedia")
+        @Expose
+        private List<WpFeaturedmedium> wpFeaturedmedia = null;
+        @SerializedName("wp:attachment")
+        @Expose
+        private List<WpAttachment> wpAttachment = null;
+        @SerializedName("wp:term")
+        @Expose
+        private List<WpTerm> wpTerm = null;
+        @SerializedName("curies")
+        @Expose
+        private List<Cury> curies = null;
+
+        public List<Self> getSelf() {
+            return self;
+        }
+
+        public void setSelf(List<Self> self) {
+            this.self = self;
+        }
+
+        public List<Collection> getCollection() {
+            return collection;
+        }
+
+        public void setCollection(List<Collection> collection) {
+            this.collection = collection;
+        }
+
+        public List<About> getAbout() {
+            return about;
+        }
+
+        public void setAbout(List<About> about) {
+            this.about = about;
+        }
+
+        public List<Author> getAuthor() {
+            return author;
+        }
+
+        public void setAuthor(List<Author> author) {
+            this.author = author;
+        }
+
+        public List<Reply> getReplies() {
+            return replies;
+        }
+
+        public void setReplies(List<Reply> replies) {
+            this.replies = replies;
+        }
+
+        public List<VersionHistory> getVersionHistory() {
+            return versionHistory;
+        }
+
+        public void setVersionHistory(List<VersionHistory> versionHistory) {
+            this.versionHistory = versionHistory;
+        }
+
+        public List<PredecessorVersion> getPredecessorVersion() {
+            return predecessorVersion;
+        }
+
+        public void setPredecessorVersion(List<PredecessorVersion> predecessorVersion) {
+            this.predecessorVersion = predecessorVersion;
+        }
+
+        public List<WpFeaturedmedium> getWpFeaturedmedia() {
+            return wpFeaturedmedia;
+        }
+
+        public void setWpFeaturedmedia(List<WpFeaturedmedium> wpFeaturedmedia) {
+            this.wpFeaturedmedia = wpFeaturedmedia;
+        }
+
+        public List<WpAttachment> getWpAttachment() {
+            return wpAttachment;
+        }
+
+        public void setWpAttachment(List<WpAttachment> wpAttachment) {
+            this.wpAttachment = wpAttachment;
+        }
+
+        public List<WpTerm> getWpTerm() {
+            return wpTerm;
+        }
+
+        public void setWpTerm(List<WpTerm> wpTerm) {
+            this.wpTerm = wpTerm;
+        }
+
+        public List<Cury> getCuries() {
+            return curies;
+        }
+
+        public void setCuries(List<Cury> curies) {
+            this.curies = curies;
+        }
+
+    }
+
+    public class PredecessorVersion {
+
+        @SerializedName("id")
+        @Expose
+        private Integer id;
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public Integer getId() {
+            return id;
+        }
+
+        public void setId(Integer id) {
+            this.id = id;
+        }
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class Reply {
+
+        @SerializedName("embeddable")
+        @Expose
+        private Boolean embeddable;
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public Boolean getEmbeddable() {
+            return embeddable;
+        }
+
+        public void setEmbeddable(Boolean embeddable) {
+            this.embeddable = embeddable;
+        }
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class Self {
+
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class Title {
+
+        @SerializedName("rendered")
+        @Expose
+        private String rendered;
+
+        public String getRendered() {
+            return rendered;
+        }
+
+        public void setRendered(String rendered) {
+            this.rendered = rendered;
+        }
+
+    }
+
+    public class VersionHistory {
+
+        @SerializedName("count")
+        @Expose
+        private Integer count;
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public Integer getCount() {
+            return count;
+        }
+
+        public void setCount(Integer count) {
+            this.count = count;
+        }
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class WpAttachment {
+
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class WpFeaturedmedium {
+
+        @SerializedName("embeddable")
+        @Expose
+        private Boolean embeddable;
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public Boolean getEmbeddable() {
+            return embeddable;
+        }
+
+        public void setEmbeddable(Boolean embeddable) {
+            this.embeddable = embeddable;
+        }
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class WpTerm {
+
+        @SerializedName("taxonomy")
+        @Expose
+        private String taxonomy;
+        @SerializedName("embeddable")
+        @Expose
+        private Boolean embeddable;
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public String getTaxonomy() {
+            return taxonomy;
+        }
+
+        public void setTaxonomy(String taxonomy) {
+            this.taxonomy = taxonomy;
+        }
+
+        public Boolean getEmbeddable() {
+            return embeddable;
+        }
+
+        public void setEmbeddable(Boolean embeddable) {
+            this.embeddable = embeddable;
+        }
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+}

+ 775 - 0
app/src/main/java/club/thepenguins/android/data/IndividualPost.java

@@ -0,0 +1,775 @@
+package club.thepenguins.android.data;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+
+public class IndividualPost {
+
+    @SerializedName("id")
+    @Expose
+    private Integer id;
+    @SerializedName("date")
+    @Expose
+    private String date;
+    @SerializedName("date_gmt")
+    @Expose
+    private String dateGmt;
+    @SerializedName("guid")
+    @Expose
+    private Guid guid;
+    @SerializedName("modified")
+    @Expose
+    private String modified;
+    @SerializedName("modified_gmt")
+    @Expose
+    private String modifiedGmt;
+    @SerializedName("slug")
+    @Expose
+    private String slug;
+    @SerializedName("status")
+    @Expose
+    private String status;
+    @SerializedName("type")
+    @Expose
+    private String type;
+    @SerializedName("link")
+    @Expose
+    private String link;
+    @SerializedName("title")
+    @Expose
+    private Title title;
+    @SerializedName("content")
+    @Expose
+    private Content content;
+    @SerializedName("excerpt")
+    @Expose
+    private Excerpt excerpt;
+    @SerializedName("author")
+    @Expose
+    private Integer author;
+    @SerializedName("featured_media")
+    @Expose
+    private Integer featuredMedia;
+    @SerializedName("comment_status")
+    @Expose
+    private String commentStatus;
+    @SerializedName("ping_status")
+    @Expose
+    private String pingStatus;
+    @SerializedName("sticky")
+    @Expose
+    private Boolean sticky;
+    @SerializedName("template")
+    @Expose
+    private String template;
+    @SerializedName("format")
+    @Expose
+    private String format;
+    @SerializedName("meta")
+    @Expose
+    private List<Object> meta = null;
+    @SerializedName("categories")
+    @Expose
+    private List<Integer> categories = null;
+    @SerializedName("tags")
+    @Expose
+    private List<Integer> tags = null;
+    @SerializedName("yoast_head")
+    @Expose
+    private String yoastHead;
+    @SerializedName("_links")
+    @Expose
+    private Links links;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getDate() {
+        return date;
+    }
+
+    public void setDate(String date) {
+        this.date = date;
+    }
+
+    public String getDateGmt() {
+        return dateGmt;
+    }
+
+    public void setDateGmt(String dateGmt) {
+        this.dateGmt = dateGmt;
+    }
+
+    public Guid getGuid() {
+        return guid;
+    }
+
+    public void setGuid(Guid guid) {
+        this.guid = guid;
+    }
+
+    public String getModified() {
+        return modified;
+    }
+
+    public void setModified(String modified) {
+        this.modified = modified;
+    }
+
+    public String getModifiedGmt() {
+        return modifiedGmt;
+    }
+
+    public void setModifiedGmt(String modifiedGmt) {
+        this.modifiedGmt = modifiedGmt;
+    }
+
+    public String getSlug() {
+        return slug;
+    }
+
+    public void setSlug(String slug) {
+        this.slug = slug;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getLink() {
+        return link;
+    }
+
+    public void setLink(String link) {
+        this.link = link;
+    }
+
+    public Title getTitle() {
+        return title;
+    }
+
+    public void setTitle(Title title) {
+        this.title = title;
+    }
+
+    public Content getContent() {
+        return content;
+    }
+
+    public void setContent(Content content) {
+        this.content = content;
+    }
+
+    public Excerpt getExcerpt() {
+        return excerpt;
+    }
+
+    public void setExcerpt(Excerpt excerpt) {
+        this.excerpt = excerpt;
+    }
+
+    public Integer getAuthor() {
+        return author;
+    }
+
+    public void setAuthor(Integer author) {
+        this.author = author;
+    }
+
+    public Integer getFeaturedMedia() {
+        return featuredMedia;
+    }
+
+    public void setFeaturedMedia(Integer featuredMedia) {
+        this.featuredMedia = featuredMedia;
+    }
+
+    public String getCommentStatus() {
+        return commentStatus;
+    }
+
+    public void setCommentStatus(String commentStatus) {
+        this.commentStatus = commentStatus;
+    }
+
+    public String getPingStatus() {
+        return pingStatus;
+    }
+
+    public void setPingStatus(String pingStatus) {
+        this.pingStatus = pingStatus;
+    }
+
+    public Boolean getSticky() {
+        return sticky;
+    }
+
+    public void setSticky(Boolean sticky) {
+        this.sticky = sticky;
+    }
+
+    public String getTemplate() {
+        return template;
+    }
+
+    public void setTemplate(String template) {
+        this.template = template;
+    }
+
+    public String getFormat() {
+        return format;
+    }
+
+    public void setFormat(String format) {
+        this.format = format;
+    }
+
+    public List<Object> getMeta() {
+        return meta;
+    }
+
+    public void setMeta(List<Object> meta) {
+        this.meta = meta;
+    }
+
+    public List<Integer> getCategories() {
+        return categories;
+    }
+
+    public void setCategories(List<Integer> categories) {
+        this.categories = categories;
+    }
+
+    public List<Integer> getTags() {
+        return tags;
+    }
+
+    public void setTags(List<Integer> tags) {
+        this.tags = tags;
+    }
+
+    public String getYoastHead() {
+        return yoastHead;
+    }
+
+    public void setYoastHead(String yoastHead) {
+        this.yoastHead = yoastHead;
+    }
+
+    public Links getLinks() {
+        return links;
+    }
+
+    public void setLinks(Links links) {
+        this.links = links;
+    }
+
+
+    public class About {
+
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class Author {
+
+        @SerializedName("embeddable")
+        @Expose
+        private Boolean embeddable;
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public Boolean getEmbeddable() {
+            return embeddable;
+        }
+
+        public void setEmbeddable(Boolean embeddable) {
+            this.embeddable = embeddable;
+        }
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class Collection {
+
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class Content {
+
+        @SerializedName("rendered")
+        @Expose
+        private String rendered;
+        @SerializedName("protected")
+        @Expose
+        private Boolean _protected;
+
+        public String getRendered() {
+            return rendered;
+        }
+
+        public void setRendered(String rendered) {
+            this.rendered = rendered;
+        }
+
+        public Boolean getProtected() {
+            return _protected;
+        }
+
+        public void setProtected(Boolean _protected) {
+            this._protected = _protected;
+        }
+
+    }
+
+    public class Cury {
+
+        @SerializedName("name")
+        @Expose
+        private String name;
+        @SerializedName("href")
+        @Expose
+        private String href;
+        @SerializedName("templated")
+        @Expose
+        private Boolean templated;
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+        public Boolean getTemplated() {
+            return templated;
+        }
+
+        public void setTemplated(Boolean templated) {
+            this.templated = templated;
+        }
+
+    }
+
+    public class Excerpt {
+
+        @SerializedName("rendered")
+        @Expose
+        private String rendered;
+        @SerializedName("protected")
+        @Expose
+        private Boolean _protected;
+
+        public String getRendered() {
+            return rendered;
+        }
+
+        public void setRendered(String rendered) {
+            this.rendered = rendered;
+        }
+
+        public Boolean getProtected() {
+            return _protected;
+        }
+
+        public void setProtected(Boolean _protected) {
+            this._protected = _protected;
+        }
+
+    }
+
+    public class Guid {
+
+        @SerializedName("rendered")
+        @Expose
+        private String rendered;
+
+        public String getRendered() {
+            return rendered;
+        }
+
+        public void setRendered(String rendered) {
+            this.rendered = rendered;
+        }
+
+    }
+
+
+    public class Links {
+
+        @SerializedName("self")
+        @Expose
+        private List<Self> self = null;
+        @SerializedName("collection")
+        @Expose
+        private List<Collection> collection = null;
+        @SerializedName("about")
+        @Expose
+        private List<About> about = null;
+        @SerializedName("author")
+        @Expose
+        private List<Author> author = null;
+        @SerializedName("replies")
+        @Expose
+        private List<Reply> replies = null;
+        @SerializedName("version-history")
+        @Expose
+        private List<VersionHistory> versionHistory = null;
+        @SerializedName("predecessor-version")
+        @Expose
+        private List<PredecessorVersion> predecessorVersion = null;
+        @SerializedName("wp:featuredmedia")
+        @Expose
+        private List<WpFeaturedmedium> wpFeaturedmedia = null;
+        @SerializedName("wp:attachment")
+        @Expose
+        private List<WpAttachment> wpAttachment = null;
+        @SerializedName("wp:term")
+        @Expose
+        private List<WpTerm> wpTerm = null;
+        @SerializedName("curies")
+        @Expose
+        private List<Cury> curies = null;
+
+        public List<Self> getSelf() {
+            return self;
+        }
+
+        public void setSelf(List<Self> self) {
+            this.self = self;
+        }
+
+        public List<Collection> getCollection() {
+            return collection;
+        }
+
+        public void setCollection(List<Collection> collection) {
+            this.collection = collection;
+        }
+
+        public List<About> getAbout() {
+            return about;
+        }
+
+        public void setAbout(List<About> about) {
+            this.about = about;
+        }
+
+        public List<Author> getAuthor() {
+            return author;
+        }
+
+        public void setAuthor(List<Author> author) {
+            this.author = author;
+        }
+
+        public List<Reply> getReplies() {
+            return replies;
+        }
+
+        public void setReplies(List<Reply> replies) {
+            this.replies = replies;
+        }
+
+        public List<VersionHistory> getVersionHistory() {
+            return versionHistory;
+        }
+
+        public void setVersionHistory(List<VersionHistory> versionHistory) {
+            this.versionHistory = versionHistory;
+        }
+
+        public List<PredecessorVersion> getPredecessorVersion() {
+            return predecessorVersion;
+        }
+
+        public void setPredecessorVersion(List<PredecessorVersion> predecessorVersion) {
+            this.predecessorVersion = predecessorVersion;
+        }
+
+        public List<WpFeaturedmedium> getWpFeaturedmedia() {
+            return wpFeaturedmedia;
+        }
+
+        public void setWpFeaturedmedia(List<WpFeaturedmedium> wpFeaturedmedia) {
+            this.wpFeaturedmedia = wpFeaturedmedia;
+        }
+
+        public List<WpAttachment> getWpAttachment() {
+            return wpAttachment;
+        }
+
+        public void setWpAttachment(List<WpAttachment> wpAttachment) {
+            this.wpAttachment = wpAttachment;
+        }
+
+        public List<WpTerm> getWpTerm() {
+            return wpTerm;
+        }
+
+        public void setWpTerm(List<WpTerm> wpTerm) {
+            this.wpTerm = wpTerm;
+        }
+
+        public List<Cury> getCuries() {
+            return curies;
+        }
+
+        public void setCuries(List<Cury> curies) {
+            this.curies = curies;
+        }
+
+    }
+
+    public class PredecessorVersion {
+
+        @SerializedName("id")
+        @Expose
+        private Integer id;
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public Integer getId() {
+            return id;
+        }
+
+        public void setId(Integer id) {
+            this.id = id;
+        }
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class Reply {
+
+        @SerializedName("embeddable")
+        @Expose
+        private Boolean embeddable;
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public Boolean getEmbeddable() {
+            return embeddable;
+        }
+
+        public void setEmbeddable(Boolean embeddable) {
+            this.embeddable = embeddable;
+        }
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class Self {
+
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class Title {
+
+        @SerializedName("rendered")
+        @Expose
+        private String rendered;
+
+        public String getRendered() {
+            return rendered;
+        }
+
+        public void setRendered(String rendered) {
+            this.rendered = rendered;
+        }
+
+    }
+
+    public class VersionHistory {
+
+        @SerializedName("count")
+        @Expose
+        private Integer count;
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public Integer getCount() {
+            return count;
+        }
+
+        public void setCount(Integer count) {
+            this.count = count;
+        }
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class WpAttachment {
+
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class WpFeaturedmedium {
+
+        @SerializedName("embeddable")
+        @Expose
+        private Boolean embeddable;
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public Boolean getEmbeddable() {
+            return embeddable;
+        }
+
+        public void setEmbeddable(Boolean embeddable) {
+            this.embeddable = embeddable;
+        }
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+
+    public class WpTerm {
+
+        @SerializedName("taxonomy")
+        @Expose
+        private String taxonomy;
+        @SerializedName("embeddable")
+        @Expose
+        private Boolean embeddable;
+        @SerializedName("href")
+        @Expose
+        private String href;
+
+        public String getTaxonomy() {
+            return taxonomy;
+        }
+
+        public void setTaxonomy(String taxonomy) {
+            this.taxonomy = taxonomy;
+        }
+
+        public Boolean getEmbeddable() {
+            return embeddable;
+        }
+
+        public void setEmbeddable(Boolean embeddable) {
+            this.embeddable = embeddable;
+        }
+
+        public String getHref() {
+            return href;
+        }
+
+        public void setHref(String href) {
+            this.href = href;
+        }
+
+    }
+}

+ 17 - 0
app/src/main/java/club/thepenguins/android/data/PostContent.java

@@ -0,0 +1,17 @@
+package club.thepenguins.android.data;
+
+public class PostContent {
+    public String Content;
+
+    public PostContent(String content) {
+        Content = content;
+    }
+
+    public String getContent() {
+        return Content;
+    }
+
+    public void setContent(String content) {
+        Content = content;
+    }
+}

+ 1 - 1
app/src/main/java/club/thepenguins/android/fragments/HomeFragment.java

@@ -135,7 +135,7 @@ public class HomeFragment extends Fragment {
                 mListPost = response.body();
                 for (int i = 0; i < response.body().size(); i++) {
 
-                    list.add(new Model(response.body().get(i).getTitle().getRendered(), response.body().get(i).getContent().getRendered(), response.body().get(i).getEmbedded().getWpFeaturedmedia().get(0).getSourceUrl(), response.body().get(i).getContent().getRendered(), response.body().get(i).getEmbedded().getAuthor().get(0).getName()));
+                    list.add(new Model(response.body().get(i).getTitle().getRendered(), response.body().get(i).getContent().getRendered(), response.body().get(i).getEmbedded().getWpFeaturedmedia().get(0).getSourceUrl(), response.body().get(i).getLinks().getSelf().get(0).getHref(), response.body().get(i).getEmbedded().getAuthor().get(0).getName()));
 
                     Log.d("Home", "onResponse: " + response.body().get(i).getEmbedded().getWpFeaturedmedia().get(0).getSourceUrl());
                 }

+ 81 - 16
app/src/main/java/club/thepenguins/android/fragments/PostFragment.java

@@ -4,11 +4,14 @@ import android.os.Bundle;
 
 import androidx.fragment.app.Fragment;
 
+import android.os.Handler;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.webkit.WebView;
 import android.widget.ImageView;
+import android.widget.ProgressBar;
 import android.widget.TextView;
 
 import com.squareup.picasso.Callback;
@@ -20,7 +23,16 @@ import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
 
+import java.util.ArrayList;
+
 import club.thepenguins.android.R;
+import club.thepenguins.android.api.APIService;
+import club.thepenguins.android.data.IndividualPost;
+import club.thepenguins.android.data.PostContent;
+import retrofit2.Call;
+import retrofit2.Response;
+import retrofit2.Retrofit;
+import retrofit2.converter.gson.GsonConverterFactory;
 
 
 public class PostFragment extends Fragment {
@@ -33,6 +45,8 @@ public class PostFragment extends Fragment {
     private String mParam2;
     private String mParam3;
     private String mParam4;
+    private ArrayList<PostContent> postData;
+    private ProgressBar progressBar;
 
     public PostFragment() {
         // Required empty public constructor
@@ -73,6 +87,7 @@ public class PostFragment extends Fragment {
         TextView textView2 = rootView.findViewById(R.id.postTitle);
         textView2.setText(mParam3);
         textView.setText(mParam4);
+        progressBar = rootView.findViewById(R.id.progress);
 
 
         Picasso.get()
@@ -98,38 +113,88 @@ public class PostFragment extends Fragment {
                     }
                 });
 
+        postData = new ArrayList<>();
+        postData.clear();
 
-        Document doc = Jsoup.parse(mParam1);
+        getRetrofit(mParam1);
+        Log.d("TAG", "onCreateView: " + mParam1);
 
-        Elements images = doc.select("img");
-        Elements iframes = doc.select("iframe");
+        final Handler handler = new Handler();
+        handler.postDelayed(new Runnable() {
+            @Override
+            public void run() {
 
-        for (Element image : images) {
+                Document doc = Jsoup.parse(postData.get(0).getContent());
 
-            image.attr("width", "100%");
-            image.attr("height", "240px");
+                Elements images = doc.select("img");
+                Elements iframes = doc.select("iframe");
 
-        }
+                for (Element image : images) {
 
-        for (Element iframe : iframes) {
+                    image.attr("width", "100%");
+                    image.attr("height", "240px");
 
-            if (iframe.attr("width").isEmpty()) {
-                iframe.attr("width", "100%");
-            }
+                }
 
-        }
+                for (Element iframe : iframes) {
 
-        String htmlString = doc.html();
+                    if (iframe.attr("width").isEmpty()) {
+                        iframe.attr("width", "100%");
+                    }
+
+                }
 
+                String htmlString = doc.html();
 
-        WebView myWebView = rootView.findViewById(R.id.webview);
 
-        myWebView.loadDataWithBaseURL(null, htmlString, "text/html", "UTF-8", null);
-        myWebView.getSettings().getJavaScriptEnabled();
+                WebView myWebView = rootView.findViewById(R.id.webview);
+
+                myWebView.loadDataWithBaseURL(null, htmlString, "text/html", "UTF-8", null);
+                myWebView.getSettings().getJavaScriptEnabled();
+                progressBar.setVisibility(View.GONE);
+            }
+        }, 2000);
 
 
         return rootView;
     }
 
+    private void getRetrofit(String postUrl) {
+
+        progressBar.setVisibility(View.VISIBLE);
+
+
+        Retrofit retrofit = new Retrofit.Builder()
+                .baseUrl(postUrl + "/")
+                .addConverterFactory(GsonConverterFactory.create())
+                .build();
+
+        APIService service = retrofit.create(APIService.class);
+        Call<IndividualPost> call = service.getPostContent();
+
+
+        call.enqueue(new retrofit2.Callback<IndividualPost>() {
+            @Override
+            public void onResponse(Call<IndividualPost> call, Response<IndividualPost> response) {
+
+
+                if (postData.size() > 1) {
+                    postData.clear();
+                }
+
+
+                postData.add(new PostContent(response.body().getContent().getRendered()));
+
+
+            }
+
+            @Override
+            public void onFailure(Call<IndividualPost> call, Throwable t) {
+
+                Log.d("PostRecyclerAdapter", "onFailure: ", t);
+            }
+        });
+    }
+
 
 }

+ 8 - 1
app/src/main/res/layout/fragment_post.xml

@@ -77,12 +77,19 @@
 
             </RelativeLayout>
 
+            <ProgressBar
+                android:id="@+id/progress"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_below="@+id/relative1"
+                android:visibility="gone" />
+
 
             <WebView
                 android:id="@+id/webview"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_below="@+id/relative1"
+                android:layout_below="@+id/progress"
                 android:nestedScrollingEnabled="true" />
 
         </RelativeLayout>