mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-28 11:58:23 +01:00
Delineate comments with hidden scores (#1147)
* Delineate comments with hidden scores. * Same change for fully collapsed comments.
This commit is contained in:
parent
540ba6e74e
commit
9b8cd3816f
@ -223,8 +223,14 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment
|
|||||||
((CommentViewHolder) holder).markwonAdapter.setMarkdown(mMarkwon, comment.getCommentMarkdown());
|
((CommentViewHolder) holder).markwonAdapter.setMarkdown(mMarkwon, comment.getCommentMarkdown());
|
||||||
((CommentViewHolder) holder).markwonAdapter.notifyDataSetChanged();
|
((CommentViewHolder) holder).markwonAdapter.notifyDataSetChanged();
|
||||||
|
|
||||||
((CommentViewHolder) holder).scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
String commentText = "";
|
||||||
comment.getScore() + comment.getVoteType()));
|
if (comment.isScoreHidden()) {
|
||||||
|
commentText = mActivity.getString(R.string.hidden);
|
||||||
|
} else {
|
||||||
|
commentText = Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
||||||
|
comment.getScore() + comment.getVoteType());
|
||||||
|
}
|
||||||
|
((CommentViewHolder) holder).scoreTextView.setText(commentText);
|
||||||
|
|
||||||
switch (comment.getVoteType()) {
|
switch (comment.getVoteType()) {
|
||||||
case Comment.VOTE_TYPE_UPVOTE:
|
case Comment.VOTE_TYPE_UPVOTE:
|
||||||
@ -565,8 +571,10 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment
|
|||||||
scoreTextView.setTextColor(mCommentIconAndInfoColor);
|
scoreTextView.setTextColor(mCommentIconAndInfoColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!comment.isScoreHidden()) {
|
||||||
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
||||||
comment.getScore() + comment.getVoteType()));
|
comment.getScore() + comment.getVoteType()));
|
||||||
|
}
|
||||||
|
|
||||||
VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() {
|
VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -588,10 +596,12 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment
|
|||||||
|
|
||||||
if (currentPosition == position) {
|
if (currentPosition == position) {
|
||||||
downvoteButton.setColorFilter(mCommentIconAndInfoColor, PorterDuff.Mode.SRC_IN);
|
downvoteButton.setColorFilter(mCommentIconAndInfoColor, PorterDuff.Mode.SRC_IN);
|
||||||
|
if (!comment.isScoreHidden()) {
|
||||||
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
||||||
comment.getScore() + comment.getVoteType()));
|
comment.getScore() + comment.getVoteType()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onVoteThingFail(int position) {
|
public void onVoteThingFail(int position) {
|
||||||
@ -631,8 +641,10 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment
|
|||||||
scoreTextView.setTextColor(mCommentIconAndInfoColor);
|
scoreTextView.setTextColor(mCommentIconAndInfoColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!comment.isScoreHidden()) {
|
||||||
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
||||||
comment.getScore() + comment.getVoteType()));
|
comment.getScore() + comment.getVoteType()));
|
||||||
|
}
|
||||||
|
|
||||||
VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() {
|
VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -654,10 +666,12 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment
|
|||||||
|
|
||||||
if (currentPosition == position) {
|
if (currentPosition == position) {
|
||||||
upvoteButton.setColorFilter(mCommentIconAndInfoColor, PorterDuff.Mode.SRC_IN);
|
upvoteButton.setColorFilter(mCommentIconAndInfoColor, PorterDuff.Mode.SRC_IN);
|
||||||
|
if (!comment.isScoreHidden()) {
|
||||||
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
||||||
comment.getScore() + comment.getVoteType()));
|
comment.getScore() + comment.getVoteType()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onVoteThingFail(int position1) {
|
public void onVoteThingFail(int position1) {
|
||||||
|
@ -439,11 +439,20 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
|||||||
|
|
||||||
((CommentViewHolder) holder).mMarkwonAdapter.setMarkdown(mCommentMarkwon, comment.getCommentMarkdown());
|
((CommentViewHolder) holder).mMarkwonAdapter.setMarkdown(mCommentMarkwon, comment.getCommentMarkdown());
|
||||||
((CommentViewHolder) holder).mMarkwonAdapter.notifyDataSetChanged();
|
((CommentViewHolder) holder).mMarkwonAdapter.notifyDataSetChanged();
|
||||||
((CommentViewHolder) holder).scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
|
||||||
comment.getScore() + comment.getVoteType()));
|
String commentText = "";
|
||||||
((CommentViewHolder) holder).topScoreTextView.setText(mActivity.getString(R.string.top_score,
|
String topScoreText = "";
|
||||||
|
if (comment.isScoreHidden()) {
|
||||||
|
commentText = mActivity.getString(R.string.hidden);
|
||||||
|
} else {
|
||||||
|
commentText = Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
||||||
|
comment.getScore() + comment.getVoteType());
|
||||||
|
topScoreText = mActivity.getString(R.string.top_score,
|
||||||
Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
||||||
comment.getScore() + comment.getVoteType())));
|
comment.getScore() + comment.getVoteType()));
|
||||||
|
}
|
||||||
|
((CommentViewHolder) holder).scoreTextView.setText(commentText);
|
||||||
|
((CommentViewHolder) holder).topScoreTextView.setText(topScoreText);
|
||||||
|
|
||||||
((CommentViewHolder) holder).commentIndentationView.setShowOnlyOneDivider(mShowOnlyOneCommentLevelIndicator);
|
((CommentViewHolder) holder).commentIndentationView.setShowOnlyOneDivider(mShowOnlyOneCommentLevelIndicator);
|
||||||
((CommentViewHolder) holder).commentIndentationView.setLevelAndColors(comment.getDepth(), verticalBlockColors);
|
((CommentViewHolder) holder).commentIndentationView.setLevelAndColors(comment.getDepth(), verticalBlockColors);
|
||||||
@ -546,8 +555,10 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
|||||||
} else {
|
} else {
|
||||||
((CommentFullyCollapsedViewHolder) holder).commentTimeTextView.setText(Utils.getFormattedTime(mLocale, comment.getCommentTimeMillis(), mTimeFormatPattern));
|
((CommentFullyCollapsedViewHolder) holder).commentTimeTextView.setText(Utils.getFormattedTime(mLocale, comment.getCommentTimeMillis(), mTimeFormatPattern));
|
||||||
}
|
}
|
||||||
|
if (!comment.isScoreHidden()) {
|
||||||
((CommentFullyCollapsedViewHolder) holder).scoreTextView.setText(mActivity.getString(R.string.top_score,
|
((CommentFullyCollapsedViewHolder) holder).scoreTextView.setText(mActivity.getString(R.string.top_score,
|
||||||
Utils.getNVotes(mShowAbsoluteNumberOfVotes, comment.getScore() + comment.getVoteType())));
|
Utils.getNVotes(mShowAbsoluteNumberOfVotes, comment.getScore() + comment.getVoteType())));
|
||||||
|
}
|
||||||
((CommentFullyCollapsedViewHolder) holder).commentIndentationView.setShowOnlyOneDivider(mShowOnlyOneCommentLevelIndicator);
|
((CommentFullyCollapsedViewHolder) holder).commentIndentationView.setShowOnlyOneDivider(mShowOnlyOneCommentLevelIndicator);
|
||||||
((CommentFullyCollapsedViewHolder) holder).commentIndentationView.setLevelAndColors(comment.getDepth(), verticalBlockColors);
|
((CommentFullyCollapsedViewHolder) holder).commentIndentationView.setLevelAndColors(comment.getDepth(), verticalBlockColors);
|
||||||
}
|
}
|
||||||
@ -1355,11 +1366,13 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
|||||||
topScoreTextView.setTextColor(mSecondaryTextColor);
|
topScoreTextView.setTextColor(mSecondaryTextColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!comment.isScoreHidden()) {
|
||||||
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
||||||
comment.getScore() + comment.getVoteType()));
|
comment.getScore() + comment.getVoteType()));
|
||||||
topScoreTextView.setText(mActivity.getString(R.string.top_score,
|
topScoreTextView.setText(mActivity.getString(R.string.top_score,
|
||||||
Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
||||||
comment.getScore() + comment.getVoteType())));
|
comment.getScore() + comment.getVoteType())));
|
||||||
|
}
|
||||||
|
|
||||||
VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() {
|
VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -1383,6 +1396,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
|||||||
|
|
||||||
if (currentPosition == position) {
|
if (currentPosition == position) {
|
||||||
downvoteButton.setColorFilter(mCommentIconAndInfoColor, PorterDuff.Mode.SRC_IN);
|
downvoteButton.setColorFilter(mCommentIconAndInfoColor, PorterDuff.Mode.SRC_IN);
|
||||||
|
if (!comment.isScoreHidden()) {
|
||||||
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
||||||
comment.getScore() + comment.getVoteType()));
|
comment.getScore() + comment.getVoteType()));
|
||||||
topScoreTextView.setText(mActivity.getString(R.string.top_score,
|
topScoreTextView.setText(mActivity.getString(R.string.top_score,
|
||||||
@ -1390,6 +1404,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
|||||||
comment.getScore() + comment.getVoteType())));
|
comment.getScore() + comment.getVoteType())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onVoteThingFail(int position) {
|
public void onVoteThingFail(int position) {
|
||||||
@ -1432,11 +1447,13 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
|||||||
topScoreTextView.setTextColor(mSecondaryTextColor);
|
topScoreTextView.setTextColor(mSecondaryTextColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!comment.isScoreHidden()) {
|
||||||
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
||||||
comment.getScore() + comment.getVoteType()));
|
comment.getScore() + comment.getVoteType()));
|
||||||
topScoreTextView.setText(mActivity.getString(R.string.top_score,
|
topScoreTextView.setText(mActivity.getString(R.string.top_score,
|
||||||
Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
||||||
comment.getScore() + comment.getVoteType())));
|
comment.getScore() + comment.getVoteType())));
|
||||||
|
}
|
||||||
|
|
||||||
int position = getBindingAdapterPosition();
|
int position = getBindingAdapterPosition();
|
||||||
VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() {
|
VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() {
|
||||||
@ -1461,6 +1478,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
|||||||
|
|
||||||
if (currentPosition == position) {
|
if (currentPosition == position) {
|
||||||
upvoteButton.setColorFilter(mCommentIconAndInfoColor, PorterDuff.Mode.SRC_IN);
|
upvoteButton.setColorFilter(mCommentIconAndInfoColor, PorterDuff.Mode.SRC_IN);
|
||||||
|
if (!comment.isScoreHidden()) {
|
||||||
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
|
||||||
comment.getScore() + comment.getVoteType()));
|
comment.getScore() + comment.getVoteType()));
|
||||||
topScoreTextView.setText(mActivity.getString(R.string.top_score,
|
topScoreTextView.setText(mActivity.getString(R.string.top_score,
|
||||||
@ -1468,6 +1486,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
|||||||
comment.getScore() + comment.getVoteType())));
|
comment.getScore() + comment.getVoteType())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onVoteThingFail(int position1) {
|
public void onVoteThingFail(int position1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user