Fix separated up/down vote counts when on the right side

Closes #123
This commit is contained in:
Balazs Toldi 2023-08-15 21:44:20 +02:00
parent 7849115000
commit 0328f34df2
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58
3 changed files with 33 additions and 5 deletions

View File

@ -1256,6 +1256,8 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
constraintSet.clear(scoreTextView.getId(), ConstraintSet.END);
constraintSet.clear(downvoteButton.getId(), ConstraintSet.START);
constraintSet.clear(downvoteButton.getId(), ConstraintSet.END);
constraintSet.clear(downvoteTextView.getId(), ConstraintSet.START);
constraintSet.clear(downvoteTextView.getId(), ConstraintSet.END);
constraintSet.clear(expandButton.getId(), ConstraintSet.START);
constraintSet.clear(expandButton.getId(), ConstraintSet.END);
constraintSet.clear(saveButton.getId(), ConstraintSet.START);
@ -1268,8 +1270,15 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
constraintSet.connect(upvoteButton.getId(), ConstraintSet.START, placeholder.getId(), ConstraintSet.END);
constraintSet.connect(scoreTextView.getId(), ConstraintSet.END, downvoteButton.getId(), ConstraintSet.START);
constraintSet.connect(scoreTextView.getId(), ConstraintSet.START, upvoteButton.getId(), ConstraintSet.END);
constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END);
constraintSet.connect(downvoteButton.getId(), ConstraintSet.START, scoreTextView.getId(), ConstraintSet.END);
if (!mSeperateUpandDownvote) {
constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END);
constraintSet.connect(downvoteButton.getId(), ConstraintSet.START, scoreTextView.getId(), ConstraintSet.END);
} else {
constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, downvoteTextView.getId(), ConstraintSet.START);
constraintSet.connect(downvoteButton.getId(), ConstraintSet.START, scoreTextView.getId(), ConstraintSet.END);
constraintSet.connect(downvoteTextView.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END);
constraintSet.connect(downvoteTextView.getId(), ConstraintSet.START, downvoteButton.getId(), ConstraintSet.END);
}
constraintSet.connect(placeholder.getId(), ConstraintSet.END, upvoteButton.getId(), ConstraintSet.START);
constraintSet.connect(placeholder.getId(), ConstraintSet.START, moreButton.getId(), ConstraintSet.END);
constraintSet.connect(moreButton.getId(), ConstraintSet.START, expandButton.getId(), ConstraintSet.END);

View File

@ -1644,11 +1644,18 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
constraintSet.clear(mUpvoteButton.getId(), ConstraintSet.START);
constraintSet.clear(mScoreTextView.getId(), ConstraintSet.START);
constraintSet.clear(mDownvoteButton.getId(), ConstraintSet.START);
constraintSet.clear(mDownvoteTextView.getId(), ConstraintSet.START);
constraintSet.clear(mSaveButton.getId(), ConstraintSet.END);
constraintSet.clear(mShareButton.getId(), ConstraintSet.END);
constraintSet.connect(mUpvoteButton.getId(), ConstraintSet.END, mScoreTextView.getId(), ConstraintSet.START);
constraintSet.connect(mScoreTextView.getId(), ConstraintSet.END, mDownvoteButton.getId(), ConstraintSet.START);
constraintSet.connect(mDownvoteButton.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END);
if (!mSeperateUpvoteAndDownvote) {
constraintSet.connect(mDownvoteButton.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END);
} else {
constraintSet.connect(mDownvoteButton.getId(), ConstraintSet.END, mDownvoteTextView.getId(), ConstraintSet.START);
constraintSet.connect(mDownvoteTextView.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END);
}
constraintSet.connect(commentsCountTextView.getId(), ConstraintSet.START, mSaveButton.getId(), ConstraintSet.END);
constraintSet.connect(commentsCountTextView.getId(), ConstraintSet.END, mUpvoteButton.getId(), ConstraintSet.START);
constraintSet.connect(mSaveButton.getId(), ConstraintSet.START, mShareButton.getId(), ConstraintSet.END);

View File

@ -2436,11 +2436,17 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
constraintSet.clear(upvoteButton.getId(), ConstraintSet.START);
constraintSet.clear(scoreTextView.getId(), ConstraintSet.START);
constraintSet.clear(downvoteButton.getId(), ConstraintSet.START);
constraintSet.clear(downvoteTextView.getId(), ConstraintSet.START);
constraintSet.clear(saveButton.getId(), ConstraintSet.END);
constraintSet.clear(shareButton.getId(), ConstraintSet.END);
constraintSet.connect(upvoteButton.getId(), ConstraintSet.END, scoreTextView.getId(), ConstraintSet.START);
constraintSet.connect(scoreTextView.getId(), ConstraintSet.END, downvoteButton.getId(), ConstraintSet.START);
constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END);
if (!mSeparateUpandDownVotes) {
constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END);
} else {
constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, downvoteTextView.getId(), ConstraintSet.START);
constraintSet.connect(downvoteTextView.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END);
}
constraintSet.connect(commentsCountTextView.getId(), ConstraintSet.START, saveButton.getId(), ConstraintSet.END);
constraintSet.connect(commentsCountTextView.getId(), ConstraintSet.END, upvoteButton.getId(), ConstraintSet.START);
constraintSet.connect(saveButton.getId(), ConstraintSet.START, shareButton.getId(), ConstraintSet.END);
@ -3855,11 +3861,17 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
constraintSet.clear(upvoteButton.getId(), ConstraintSet.START);
constraintSet.clear(scoreTextView.getId(), ConstraintSet.START);
constraintSet.clear(downvoteButton.getId(), ConstraintSet.START);
constraintSet.clear(downvoteTextView.getId(), ConstraintSet.START);
constraintSet.clear(saveButton.getId(), ConstraintSet.END);
constraintSet.clear(shareButton.getId(), ConstraintSet.END);
constraintSet.connect(upvoteButton.getId(), ConstraintSet.END, scoreTextView.getId(), ConstraintSet.START);
constraintSet.connect(scoreTextView.getId(), ConstraintSet.END, downvoteButton.getId(), ConstraintSet.START);
constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END);
if (!mSeparateUpandDownVotes) {
constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END);
} else {
constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, downvoteTextView.getId(), ConstraintSet.START);
constraintSet.connect(downvoteTextView.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END);
}
constraintSet.connect(commentsCountTextView.getId(), ConstraintSet.START, saveButton.getId(), ConstraintSet.END);
constraintSet.connect(commentsCountTextView.getId(), ConstraintSet.END, upvoteButton.getId(), ConstraintSet.START);
constraintSet.connect(saveButton.getId(), ConstraintSet.START, shareButton.getId(), ConstraintSet.END);