Fix awarded comment's background color cannot be changed when searching.

This commit is contained in:
Alex Ning 2021-07-12 23:13:21 +08:00
parent 67416fa3e4
commit f7361b9518
2 changed files with 4 additions and 6 deletions

View File

@ -397,11 +397,6 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
if (holder instanceof CommentViewHolder) { if (holder instanceof CommentViewHolder) {
Comment comment = getCurrentComment(position); Comment comment = getCurrentComment(position);
if (comment != null) { if (comment != null) {
if (position == mSearchCommentIndex) {
holder.itemView.setBackgroundColor(Color.parseColor("#03A9F4"));
} else {
holder.itemView.setBackgroundColor(mCommentBackgroundColor);
}
if (mIsSingleCommentThreadMode && comment.getId().equals(mSingleCommentId)) { if (mIsSingleCommentThreadMode && comment.getId().equals(mSingleCommentId)) {
holder.itemView.setBackgroundColor(mSingleCommentThreadBackgroundColor); holder.itemView.setBackgroundColor(mSingleCommentThreadBackgroundColor);
} else if (comment.getAwards() != null && !comment.getAwards().equals("")) { } else if (comment.getAwards() != null && !comment.getAwards().equals("")) {
@ -520,6 +515,10 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
} else { } else {
((CommentViewHolder) holder).saveButton.setImageResource(R.drawable.ic_bookmark_border_grey_24dp); ((CommentViewHolder) holder).saveButton.setImageResource(R.drawable.ic_bookmark_border_grey_24dp);
} }
if (position == mSearchCommentIndex) {
holder.itemView.setBackgroundColor(Color.parseColor("#03A9F4"));
}
} }
} else if (holder instanceof CommentFullyCollapsedViewHolder) { } else if (holder instanceof CommentFullyCollapsedViewHolder) {
Comment comment = getCurrentComment(position); Comment comment = getCurrentComment(position);

View File

@ -12,7 +12,6 @@ import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.util.Log;
import android.view.HapticFeedbackConstants; import android.view.HapticFeedbackConstants;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;