1、修复AppController push被禁用的问题
2、修复deprecated api call, Resources.getColor()
This commit is contained in:
@ -3,6 +3,7 @@ package com.gh.gamecenter.adapter;
|
||||
import android.content.*;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.RecyclerView.ViewHolder;
|
||||
import android.text.Html;
|
||||
@ -446,14 +447,14 @@ public class MessageDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
}
|
||||
|
||||
|
||||
holder.commentLikeCountTv.setTextColor(mContext.getResources().getColor(R.color.hint));
|
||||
holder.commentLikeCountTv.setTextColor(ContextCompat.getColor(mContext, R.color.hint));
|
||||
holder.commentLikeIv.setImageResource(R.drawable.ic_like_unselect);
|
||||
|
||||
if (commentEntity.getVote() == 0) {
|
||||
holder.commentLikeCountTv.setVisibility(View.GONE);
|
||||
} else { // 检查是否已点赞
|
||||
if (mVoteDao.isVote(commentEntity.getId()) && commentEntity.getVote() >= 1) {
|
||||
holder.commentLikeCountTv.setTextColor(mContext.getResources().getColor(R.color.theme));
|
||||
holder.commentLikeCountTv.setTextColor(ContextCompat.getColor(mContext, R.color.theme));
|
||||
holder.commentLikeIv.setImageResource(R.drawable.ic_like_select);
|
||||
}
|
||||
holder.commentLikeCountTv.setVisibility(View.VISIBLE);
|
||||
@ -484,12 +485,12 @@ public class MessageDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
holder.commentLikeIv.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (holder.commentLikeCountTv.getCurrentTextColor() == mContext.getResources().getColor(R.color.theme)) {
|
||||
if (holder.commentLikeCountTv.getCurrentTextColor() == ContextCompat.getColor(mContext, R.color.theme)) {
|
||||
Utils.toast(mContext, "已经点过赞啦!");
|
||||
return;
|
||||
}
|
||||
finalCommentEntity.setVote(finalCommentEntity.getVote() + 1);
|
||||
holder.commentLikeCountTv.setTextColor(mContext.getResources().getColor(R.color.theme));
|
||||
holder.commentLikeCountTv.setTextColor(ContextCompat.getColor(mContext, R.color.theme));
|
||||
holder.commentLikeIv.setImageResource(R.drawable.ic_like_select);
|
||||
holder.commentLikeCountTv.setText(String.valueOf(finalCommentEntity.getVote()));
|
||||
holder.commentLikeCountTv.setVisibility(View.VISIBLE);
|
||||
@ -519,7 +520,7 @@ public class MessageDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
public void postFailed(Throwable e) {
|
||||
|
||||
finalCommentEntity.setVote(finalCommentEntity.getVote() - 1);
|
||||
holder.commentLikeCountTv.setTextColor(mContext.getResources().getColor(R.color.hint));
|
||||
holder.commentLikeCountTv.setTextColor(ContextCompat.getColor(mContext, R.color.hint));
|
||||
holder.commentLikeIv.setImageResource(R.drawable.ic_like_unselect);
|
||||
holder.commentLikeCountTv.setText(String.valueOf(finalCommentEntity.getVote()));
|
||||
if (finalCommentEntity.getVote() == 0) {
|
||||
|
||||
Reference in New Issue
Block a user