Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
marktony committed Sep 26, 2016
1 parent 5f72589 commit 2293d8f
Show file tree
Hide file tree
Showing 13 changed files with 737 additions and 121 deletions.
7 changes: 7 additions & 0 deletions .idea/dictionaries/lizha.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions app/build.gradle
Expand Up @@ -24,10 +24,11 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.1.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile files('libs/volley.jar')
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.google.code.gson:gson:2.7'
}
Expand Up @@ -11,7 +11,7 @@
import java.util.List;

import io.github.marktony.reader.R;
import io.github.marktony.reader.data.JiandanArticle;
import io.github.marktony.reader.data.Jiandan;
import io.github.marktony.reader.interfaze.OnRecyclerViewClickListener;
import io.github.marktony.reader.interfaze.OnRecyclerViewLongClickListener;

Expand All @@ -23,12 +23,12 @@ public class JiandanArticleAdapter extends RecyclerView.Adapter<JiandanArticleAd

private final Context context;
private LayoutInflater inflater;
private final List<JiandanArticle> list;
private final List<Jiandan.Comment> list;

private OnRecyclerViewClickListener listener;
private OnRecyclerViewLongClickListener longClickListener;

public JiandanArticleAdapter(Context context, ArrayList<JiandanArticle> list) {
public JiandanArticleAdapter(Context context, ArrayList<Jiandan.Comment> list) {
this.context = context;
this.list = list;
this.inflater = LayoutInflater.from(context);
Expand All @@ -41,7 +41,7 @@ public JiandanViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

@Override
public void onBindViewHolder(JiandanViewHolder holder, int position) {
JiandanArticle article = list.get(position);
Jiandan.Comment article = list.get(position);
holder.tvAuthor.setText(article.getComment_author());
holder.tvTime.setText(article.getComment_date());
holder.tvContent.setText(article.getComment_content());
Expand Down
271 changes: 271 additions & 0 deletions app/src/main/java/io/github/marktony/reader/data/Jiandan.java
@@ -0,0 +1,271 @@
package io.github.marktony.reader.data;

import java.util.ArrayList;

/**
* Created by Lizhaotailang on 2016/9/26.
*/

public class Jiandan {

private String status;
private int current_page;
private int total_comments;
private int page_count;
private int count;
private ArrayList<Comment> comments;

public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}

public int getCurrent_page() {
return current_page;
}

public void setCurrent_page(int current_page) {
this.current_page = current_page;
}

public int getTotal_comments() {
return total_comments;
}

public void setTotal_comments(int total_comments) {
this.total_comments = total_comments;
}

public int getPage_count() {
return page_count;
}

public void setPage_count(int page_count) {
this.page_count = page_count;
}

public int getCount() {
return count;
}

public void setCount(int count) {
this.count = count;
}

public ArrayList<Comment> getComments() {
return comments;
}

public void setComments(ArrayList<Comment> comments) {
this.comments = comments;
}

public class Comment {
private String comment_ID;
private String comment_post_ID;
private String comment_author;
private String comment_author_email;
private String comment_author_url;
private String comment_author_IP;
private String comment_date;
private String comment_date_gmt;
private String comment_content;
private String comment_karma;
private String comment_approved;
private String comment_agent;
private String comment_type;
private String comment_parent;
private String user_id;
private String comment_subscribe;
private String comment_reply_ID;
private String vote_positive;
private String vote_negative;
private String vote_ip_pool;
private String text_content;
private ArrayList<Video> videos;

public String getComment_ID() {
return comment_ID;
}

public void setComment_ID(String comment_ID) {
this.comment_ID = comment_ID;
}

public String getComment_post_ID() {
return comment_post_ID;
}

public void setComment_post_ID(String comment_post_ID) {
this.comment_post_ID = comment_post_ID;
}

public String getComment_author() {
return comment_author;
}

public void setComment_author(String comment_author) {
this.comment_author = comment_author;
}

public String getComment_author_email() {
return comment_author_email;
}

public void setComment_author_email(String comment_author_email) {
this.comment_author_email = comment_author_email;
}

public String getComment_author_url() {
return comment_author_url;
}

public void setComment_author_url(String comment_author_url) {
this.comment_author_url = comment_author_url;
}

public String getComment_author_IP() {
return comment_author_IP;
}

public void setComment_author_IP(String comment_author_IP) {
this.comment_author_IP = comment_author_IP;
}

public String getComment_date() {
return comment_date;
}

public void setComment_date(String comment_date) {
this.comment_date = comment_date;
}

public String getComment_date_gmt() {
return comment_date_gmt;
}

public void setComment_date_gmt(String comment_date_gmt) {
this.comment_date_gmt = comment_date_gmt;
}

public String getComment_content() {
return comment_content;
}

public void setComment_content(String comment_content) {
this.comment_content = comment_content;
}

public String getComment_karma() {
return comment_karma;
}

public void setComment_karma(String comment_karma) {
this.comment_karma = comment_karma;
}

public String getComment_approved() {
return comment_approved;
}

public void setComment_approved(String comment_approved) {
this.comment_approved = comment_approved;
}

public String getComment_agent() {
return comment_agent;
}

public void setComment_agent(String comment_agent) {
this.comment_agent = comment_agent;
}

public String getComment_type() {
return comment_type;
}

public void setComment_type(String comment_type) {
this.comment_type = comment_type;
}

public String getComment_parent() {
return comment_parent;
}

public void setComment_parent(String comment_parent) {
this.comment_parent = comment_parent;
}

public String getUser_id() {
return user_id;
}

public void setUser_id(String user_id) {
this.user_id = user_id;
}

public String getComment_subscribe() {
return comment_subscribe;
}

public void setComment_subscribe(String comment_subscribe) {
this.comment_subscribe = comment_subscribe;
}

public String getComment_reply_ID() {
return comment_reply_ID;
}

public void setComment_reply_ID(String comment_reply_ID) {
this.comment_reply_ID = comment_reply_ID;
}

public String getVote_positive() {
return vote_positive;
}

public void setVote_positive(String vote_positive) {
this.vote_positive = vote_positive;
}

public String getVote_negative() {
return vote_negative;
}

public void setVote_negative(String vote_negative) {
this.vote_negative = vote_negative;
}

public String getVote_ip_pool() {
return vote_ip_pool;
}

public void setVote_ip_pool(String vote_ip_pool) {
this.vote_ip_pool = vote_ip_pool;
}

public String getText_content() {
return text_content;
}

public void setText_content(String text_content) {
this.text_content = text_content;
}

public ArrayList<Video> getVideos() {
return videos;
}

public void setVideos(ArrayList<Video> videos) {
this.videos = videos;
}
}

public class Video {

}

}

This file was deleted.

@@ -0,0 +1,23 @@
package io.github.marktony.reader.data;

import com.android.volley.VolleyError;

/**
* Created by Lizhaotailang on 2016/9/26.
*/

public interface OnStringListener {

/**
* 请求成功时回调
* @param result
*/
void onSuccess(String result);

/**
* 请求失败时回调
* @param error
*/
void onError(VolleyError error);

}

0 comments on commit 2293d8f

Please sign in to comment.