mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-26 01:34:45 +01:00
Fix unable to vote.
This commit is contained in:
parent
3dc2d9fee2
commit
9b796cf621
@ -1392,8 +1392,6 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (holder instanceof LoadMoreCommentsFailedViewHolder) {
|
|
||||||
((LoadMoreCommentsFailedViewHolder) holder).errorTextView.setText(R.string.load_comments_failed);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1872,7 +1870,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
|
|||||||
|
|
||||||
mDownvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
mDownvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||||
|
|
||||||
if (previousUpvoteButtonColorFilter == null) {
|
if (previousVoteType != 1) {
|
||||||
//Not upvoted before
|
//Not upvoted before
|
||||||
mPost.setVoteType(1);
|
mPost.setVoteType(1);
|
||||||
newVoteType = RedditUtils.DIR_UPVOTE;
|
newVoteType = RedditUtils.DIR_UPVOTE;
|
||||||
@ -1946,7 +1944,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
|
|||||||
|
|
||||||
mUpvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
mUpvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||||
|
|
||||||
if (previousDownvoteButtonColorFilter == null) {
|
if (previousVoteType != -1) {
|
||||||
//Not upvoted before
|
//Not upvoted before
|
||||||
mPost.setVoteType(-1);
|
mPost.setVoteType(-1);
|
||||||
newVoteType = RedditUtils.DIR_DOWNVOTE;
|
newVoteType = RedditUtils.DIR_DOWNVOTE;
|
||||||
@ -2209,6 +2207,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
|
|||||||
LoadMoreCommentsFailedViewHolder(@NonNull View itemView) {
|
LoadMoreCommentsFailedViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
ButterKnife.bind(this, itemView);
|
ButterKnife.bind(this, itemView);
|
||||||
|
errorTextView.setText(R.string.load_comments_failed);
|
||||||
retryButton.setOnClickListener(view -> mCommentRecyclerViewAdapterCallback.retryFetchingMoreComments());
|
retryButton.setOnClickListener(view -> mCommentRecyclerViewAdapterCallback.retryFetchingMoreComments());
|
||||||
itemView.setBackgroundColor(mCommentBackgroundColor);
|
itemView.setBackgroundColor(mCommentBackgroundColor);
|
||||||
errorTextView.setTextColor(mSecondaryTextColor);
|
errorTextView.setTextColor(mSecondaryTextColor);
|
||||||
|
@ -609,7 +609,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
|||||||
|
|
||||||
((PostViewHolder) holder).downvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
((PostViewHolder) holder).downvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||||
|
|
||||||
if (previousUpvoteButtonColorFilter == null) {
|
if (previousVoteType != 1) {
|
||||||
//Not upvoted before
|
//Not upvoted before
|
||||||
post.setVoteType(1);
|
post.setVoteType(1);
|
||||||
newVoteType = RedditUtils.DIR_UPVOTE;
|
newVoteType = RedditUtils.DIR_UPVOTE;
|
||||||
@ -680,7 +680,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
|||||||
|
|
||||||
((PostViewHolder) holder).upvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
((PostViewHolder) holder).upvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||||
|
|
||||||
if (previousDownvoteButtonColorFilter == null) {
|
if (previousVoteType != -1) {
|
||||||
//Not downvoted before
|
//Not downvoted before
|
||||||
post.setVoteType(-1);
|
post.setVoteType(-1);
|
||||||
newVoteType = RedditUtils.DIR_DOWNVOTE;
|
newVoteType = RedditUtils.DIR_DOWNVOTE;
|
||||||
@ -1155,7 +1155,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
|||||||
|
|
||||||
((PostCompactViewHolder) holder).downvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
((PostCompactViewHolder) holder).downvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||||
|
|
||||||
if (previousUpvoteButtonColorFilter == null) {
|
if (previousVoteType != 1) {
|
||||||
//Not upvoted before
|
//Not upvoted before
|
||||||
post.setVoteType(1);
|
post.setVoteType(1);
|
||||||
newVoteType = RedditUtils.DIR_UPVOTE;
|
newVoteType = RedditUtils.DIR_UPVOTE;
|
||||||
@ -1226,7 +1226,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
|||||||
|
|
||||||
((PostCompactViewHolder) holder).upvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
((PostCompactViewHolder) holder).upvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||||
|
|
||||||
if (previousDownvoteButtonColorFilter == null) {
|
if (previousVoteType != -1) {
|
||||||
//Not downvoted before
|
//Not downvoted before
|
||||||
post.setVoteType(-1);
|
post.setVoteType(-1);
|
||||||
newVoteType = RedditUtils.DIR_DOWNVOTE;
|
newVoteType = RedditUtils.DIR_DOWNVOTE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user