去除volley 中TAG的滥用导致无法重复加载同一url,项目整理

This commit is contained in:
huangzhuanghua
2016-11-29 10:49:45 +08:00
parent 47f978a4fa
commit a31d2cd28b
80 changed files with 461 additions and 610 deletions

View File

@ -25,7 +25,6 @@ import com.gh.common.util.NewsUtils;
import com.gh.common.util.PostCommentUtils;
import com.gh.common.util.Utils;
import com.gh.common.view.CardLinearLayout;
import com.gh.gamecenter.GameNewsActivity;
import com.gh.gamecenter.MessageDetailActivity;
import com.gh.gamecenter.NewsDetailActivity;
import com.gh.gamecenter.R;
@ -114,12 +113,12 @@ public class MessageDetailAdapter extends RecyclerView.Adapter<RecyclerView.View
mConcernEntity = (ConcernEntity) AppController.get("ConcernEntity", true);
addHotComment(0);
}
}
private void addHotComment(int offset) {
String hotCommentUrl = Config.COMMENT_HOST + "article/" + mConcernEntity.getId() +
"/comment?order=hot&limit=" + 10 + "&offset=" + offset;
"/comment?order=hot&limit=10&offset=" + offset;
JsonArrayExtendedRequest request = new JsonArrayExtendedRequest(hotCommentUrl,
new Response.Listener<JSONArray>() {
@Override
@ -142,14 +141,14 @@ public class MessageDetailAdapter extends RecyclerView.Adapter<RecyclerView.View
}
});
AppController.addToRequestQueue(request, GameNewsActivity.TAG);
AppController.addToRequestQueue(request);
}
public void addNormalComment(int offset) {
isLoading = true;
String commentUrl = Config.COMMENT_HOST + "article/" + mConcernEntity.getId() +
"/comment?limit=" + 10 + "&offset=" + offset;
"/comment?limit=10&offset=" + offset;
JsonArrayExtendedRequest request = new JsonArrayExtendedRequest(commentUrl,
new Response.Listener<JSONArray>() {
@ -181,7 +180,7 @@ public class MessageDetailAdapter extends RecyclerView.Adapter<RecyclerView.View
}
});
AppController.addToRequestQueue(request, GameNewsActivity.TAG);
AppController.addToRequestQueue(request);
}
@ -510,7 +509,7 @@ public class MessageDetailAdapter extends RecyclerView.Adapter<RecyclerView.View
return;
}
finalCommentEntity.setVote(finalCommentEntity.getVote() + 1);
PostCommentUtils.addCommentVoto(finalCommentEntity.getId(), mContext);
PostCommentUtils.addCommentVoto(mContext, finalCommentEntity.getId());
holder.commentLikeCountTv.setTextColor(mContext.getResources().getColor(R.color.theme));
holder.commentLikeIv.setImageResource(R.drawable.comment_like_select);
holder.commentLikeCountTv.setText(String.valueOf(finalCommentEntity.getVote()));
@ -594,6 +593,10 @@ public class MessageDetailAdapter extends RecyclerView.Adapter<RecyclerView.View
return mConcernEntity.getId();
}
public ConcernEntity getConcernEntity() {
return mConcernEntity;
}
public boolean isLoading() {
return isLoading;
}