-
stars : 1
-
title : 第96期
-
type : Girl
-
url : http://gank.io/images/f4f6d68bf30147e1bdd4ddbc6ad7c2a2
-
views : 131
*/
private String _id;
private String author;
private String category;
private String createdAt;
private String desc;
private int likeCounts;
private String publishedAt;
private int stars;
private String title;
private String type;
private String url;
private int views;
private List images;
private boolean select = false;
public String get_id() {
return _id;
}
public void set_id(String _id) {
this._id = _id;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getCreatedAt() {
return createdAt;
}
public void setCreatedAt(String createdAt) {
this.createdAt = createdAt;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public int getLikeCounts() {
return likeCounts;
}
public void setLikeCounts(int likeCounts) {
this.likeCounts = likeCounts;
}
public String getPublishedAt() {
return publishedAt;
}
public void setPublishedAt(String publishedAt) {
this.publishedAt = publishedAt;
}
public int getStars() {
return stars;
}
public void setStars(int stars) {
this.stars = stars;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public int getViews() {
return views;
}
public void setViews(int views) {
this.views = views;
}
public List getImages() {
return images;
}
public void setImages(List images) {
this.images = images;
}
public boolean isSelect() {
return select;
}
public void setSelect(boolean select) {
this.select = select;
}
}
}
再创建一个JsonData.java,存放用于转换的JSON数据
代码如下,复制粘贴即可:
package com.llw.recyclerviewusedemo;
public class JsonData {
public static String JSON = “{“data”:[{”_id":“5e959250808d6d2fe6b56eda”,“author”:“\u9e22\u5a9b”,“category”:“Girl”,“createdAt”:“2020-05-25 08:00:00”,“desc”:“\u4e0e\u5176\u5b89\u6170\u81ea\u5df1\u5e73\u51e1\u53ef\u8d35\uff0c\n\u4e0d\u5982\u62fc\u5c3d\u5168\u529b\u6d3b\u5f97\u6f02\u4eae\u3002 \u200b \u200b\u200b\u200b\u200b”,“images”:[“http://gank.io/images/f4f6d68bf30147e1bdd4ddbc6ad7c2a2”],“likeCounts”:0,“publishedAt”:“2020-05-25 08:00:00”,“stars”:1,“title”:“\u7b2c96\u671f”,“type”:“Girl”,“url”:“http://gank.io/images/f4f6d68bf30147e1bdd4ddbc6ad7c2a2”,“views”:131},{“_id”:“5e95923f808d6d2fe6b56ed8”,“author”:“\u9e22\u5a9b”,“category”:“Girl”,“createdAt”:“2020-05-24 08:00:00”,“desc”:“\u8fd9\u4e16\u754c\u603b\u6709\u4eba\u5728\u7b28\u62d9\u5730\u7231\u7740\u4f60\uff0c\u60f3\u628a\u5168\u90e8\u7684\u6e29\u67d4\u90fd\u7ed9\u4f60\u3002 \u200b\u200b\u200b\u200b”,“images”:[“http://gank.io/images/dc75cbde1d98448183e2f9514b4d1320”],“likeCounts”:0,“publishedAt”:“2020-05-24 08:00:00”,“stars”:1,“title”:“\u7b2c95\u671f”,“type”:“Girl”,“url”:“http://gank.io/images/dc75cbde1d98448183e2f9514b4d1320”,“views”:133},{“_id”:“5e95922e808d6d2fe6b56ed6”,“author”:“\u9e22\u5a9b”,“category”:“Girl”,“createdAt”:“2020-05-23 08:00:00”,“desc”:“\u966a\u4f34\u672c\u6765\u5c31\u662f\u8fd9\u4e16\u754c\u4e0a\u6700\u4e86\u4e0d\u8d77\u7684\u5b89\u6170\u200b\u3002”,“images”:[“http://gank.io/images/6b2efa591564475fb8bc32291fb0007c”],“likeCounts”:0,“publishedAt”:“2020-05-23 08:00:00”,“stars”:1,“title”:“\u7b2c94\u671f”,“type”:“Girl”,“url”:“http://gank.io/images/6b2efa591564475fb8bc32291fb0007c”,“views”:135},{“_id”:“5e959200ee6ba981da2af34d”,“author”:“\u9e22\u5a9b”,“category”:“Girl”,“createdAt”:“2020-05-22 08:00:00”,“desc”:“\u957f\u4e0d\u8fc7\u6267\u5ff5\uff0c\u77ed\u4e0d\u8fc7\u5584\u53d8\u3002”,“images”:[“http://gank.io/images/d6bba8cf5b8c40f9ad229844475e9149”],“likeCounts”:0,“publishedAt”:“2020-05-22 08:00:00”,“stars”:1,“title”:“\u7b2c93\u671f”,“type”:“Girl”,“url”:“http://gank.io/images/d6bba8cf5b8c40f9ad229844475e9149”,“views”:192},{“_id”:“5e9591dcee6ba981da2af34b”,“author”:“\u9e22\u5a9b”,“category”:“Girl”,“createdAt”:“2020-05-21 08:00:00”,“desc”:“\u65e0\u8bba\u591a\u4e48\u8270\u96be\u7684\u73b0\u5728\uff0c\u7ec8\u4f1a\u7ffb\u7bc7\u3002\n\u671d\u672a\u6765\u5927\u6b65\u5411\u524d\u5427\uff0c\u522b\u4e27\uff0c\u522b\u6b62\u6b65\u3002”,“images”:[“http://gank.io/images/9fa43020cf724c69842eec3e13f6d21c”],“likeCounts”:1,“publishedAt”:“2020-05-21 08:00:00”,“stars”:1,“title”:“\u7b2c92\u671f”,“type”:“Girl”,“url”:“http://gank.io/images/9fa43020cf724c69842eec3e13f6d21c”,“views”:176},{“_id”:“5e9591c60bd5529b54e712af”,“author”:“\u9e22\u5a9b”,“category”:“Girl”,“createdAt”:“2020-05-20 08:00:00”,“desc”:“\u5e0c\u671b\u4e0b\u4e00\u6b21\uff0c\u80fd\u559c\u6b22\u4e0a\u4e00\u4e2a\u4e5f\u559c\u6b22\u81ea\u5df1\u7684\u4eba \u200b\u200b\u200b\u200b\u3002”,“images”:[“http://gank.io/images/d237f507bf1946d2b0976e581f8aab9b”],“likeCounts”:0,“publishedAt”:“2020-05-20 08:00:00”,“stars”