diff options
author | Alex Ning <chineseperson5@gmail.com> | 2019-09-03 07:19:17 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2019-09-03 07:19:17 +0000 |
commit | b61265e17ae85936271da09e71c3a7c9ee1443fc (patch) | |
tree | 8c48bce4ae2970448346996a4f04752a54fcc737 /app | |
parent | 79726b9a08d8b55f6965e2336857e1587bf1795c (diff) | |
download | infinity-for-reddit-b61265e17ae85936271da09e71c3a7c9ee1443fc.tar infinity-for-reddit-b61265e17ae85936271da09e71c3a7c9ee1443fc.tar.gz infinity-for-reddit-b61265e17ae85936271da09e71c3a7c9ee1443fc.tar.bz2 infinity-for-reddit-b61265e17ae85936271da09e71c3a7c9ee1443fc.tar.lz infinity-for-reddit-b61265e17ae85936271da09e71c3a7c9ee1443fc.tar.xz infinity-for-reddit-b61265e17ae85936271da09e71c3a7c9ee1443fc.tar.zst infinity-for-reddit-b61265e17ae85936271da09e71c3a7c9ee1443fc.zip |
Change upvoted color for upvote buttons.
Diffstat (limited to 'app')
5 files changed, 29 insertions, 27 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java index 753c7259..7afadce8 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java @@ -286,11 +286,11 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie switch (mPost.getVoteType()) { case 1: //Upvote - ((PostDetailViewHolder) holder).mUpvoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.backgroundColorPrimaryDark), PorterDuff.Mode.SRC_IN); + ((PostDetailViewHolder) holder).mUpvoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.upvoted), PorterDuff.Mode.SRC_IN); break; case -1: //Downvote - ((PostDetailViewHolder) holder).mDownvoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.minusButtonColor), PorterDuff.Mode.SRC_IN); + ((PostDetailViewHolder) holder).mDownvoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.downvoted), PorterDuff.Mode.SRC_IN); break; case 0: ((PostDetailViewHolder) holder).mUpvoteButton.clearColorFilter(); @@ -555,11 +555,11 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie switch (comment.getVoteType()) { case 1: ((CommentViewHolder) holder).upVoteButton - .setColorFilter(ContextCompat.getColor(mActivity, R.color.colorPrimary), android.graphics.PorterDuff.Mode.SRC_IN); + .setColorFilter(ContextCompat.getColor(mActivity, R.color.upvoted), android.graphics.PorterDuff.Mode.SRC_IN); break; case 2: ((CommentViewHolder) holder).downVoteButton - .setColorFilter(ContextCompat.getColor(mActivity, R.color.minusButtonColor), android.graphics.PorterDuff.Mode.SRC_IN); + .setColorFilter(ContextCompat.getColor(mActivity, R.color.downvoted), android.graphics.PorterDuff.Mode.SRC_IN); break; } @@ -630,7 +630,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie //Not upvoted before mVisibleComments.get(commentPosition).setVoteType(CommentData.VOTE_TYPE_UPVOTE); newVoteType = RedditUtils.DIR_UPVOTE; - ((CommentViewHolder) holder).upVoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN); + ((CommentViewHolder) holder).upVoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.upvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { //Upvoted before mVisibleComments.get(commentPosition).setVoteType(CommentData.VOTE_TYPE_NO_VOTE); @@ -645,7 +645,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie public void onVoteThingSuccess(int position) { if(newVoteType.equals(RedditUtils.DIR_UPVOTE)) { mVisibleComments.get(commentPosition).setVoteType(CommentData.VOTE_TYPE_UPVOTE); - ((CommentViewHolder) holder).upVoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN); + ((CommentViewHolder) holder).upVoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.upvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { mVisibleComments.get(commentPosition).setVoteType(CommentData.VOTE_TYPE_NO_VOTE); ((CommentViewHolder) holder).upVoteButton.clearColorFilter(); @@ -682,7 +682,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie //Not downvoted before mVisibleComments.get(commentPosition).setVoteType(CommentData.VOTE_TYPE_DOWNVOTE); newVoteType = RedditUtils.DIR_DOWNVOTE; - ((CommentViewHolder) holder).downVoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.colorAccent), android.graphics.PorterDuff.Mode.SRC_IN); + ((CommentViewHolder) holder).downVoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.downvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { //Downvoted before mVisibleComments.get(commentPosition).setVoteType(CommentData.VOTE_TYPE_NO_VOTE); @@ -697,7 +697,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie public void onVoteThingSuccess(int position1) { if(newVoteType.equals(RedditUtils.DIR_DOWNVOTE)) { mVisibleComments.get(commentPosition).setVoteType(CommentData.VOTE_TYPE_DOWNVOTE); - ((CommentViewHolder) holder).downVoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.colorAccent), android.graphics.PorterDuff.Mode.SRC_IN); + ((CommentViewHolder) holder).downVoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.downvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { mVisibleComments.get(commentPosition).setVoteType(CommentData.VOTE_TYPE_NO_VOTE); ((CommentViewHolder) holder).downVoteButton.clearColorFilter(); @@ -1092,7 +1092,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie //Not upvoted before mPost.setVoteType(1); newVoteType = RedditUtils.DIR_UPVOTE; - mUpvoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN); + mUpvoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.upvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { //Upvoted before mPost.setVoteType(0); @@ -1109,7 +1109,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie public void onVoteThingSuccess() { if(newVoteType.equals(RedditUtils.DIR_UPVOTE)) { mPost.setVoteType(1); - mUpvoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN); + mUpvoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.upvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { mPost.setVoteType(0); mUpvoteButton.clearColorFilter(); @@ -1156,7 +1156,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie //Not upvoted before mPost.setVoteType(-1); newVoteType = RedditUtils.DIR_DOWNVOTE; - mDownvoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.colorAccent), android.graphics.PorterDuff.Mode.SRC_IN); + mDownvoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.downvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { //Upvoted before mPost.setVoteType(0); @@ -1173,7 +1173,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie public void onVoteThingSuccess() { if(newVoteType.equals(RedditUtils.DIR_DOWNVOTE)) { mPost.setVoteType(-1); - mDownvoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.colorAccent), android.graphics.PorterDuff.Mode.SRC_IN); + mDownvoteButton.setColorFilter(ContextCompat.getColor(mActivity, R.color.downvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { mPost.setVoteType(0); mDownvoteButton.clearColorFilter(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentsListingRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentsListingRecyclerViewAdapter.java index c7979c63..7e121368 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentsListingRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentsListingRecyclerViewAdapter.java @@ -138,11 +138,11 @@ class CommentsListingRecyclerViewAdapter extends PagedListAdapter<CommentData, R switch (comment.getVoteType()) { case 1: ((DataViewHolder) holder).upvoteButton - .setColorFilter(ContextCompat.getColor(mContext, R.color.colorPrimary), android.graphics.PorterDuff.Mode.SRC_IN); + .setColorFilter(ContextCompat.getColor(mContext, R.color.upvoted), android.graphics.PorterDuff.Mode.SRC_IN); break; case 2: ((DataViewHolder) holder).downvoteButton - .setColorFilter(ContextCompat.getColor(mContext, R.color.minusButtonColor), android.graphics.PorterDuff.Mode.SRC_IN); + .setColorFilter(ContextCompat.getColor(mContext, R.color.downvoted), android.graphics.PorterDuff.Mode.SRC_IN); break; } @@ -258,7 +258,7 @@ class CommentsListingRecyclerViewAdapter extends PagedListAdapter<CommentData, R //Not upvoted before getItem(getAdapterPosition()).setVoteType(CommentData.VOTE_TYPE_UPVOTE); newVoteType = RedditUtils.DIR_UPVOTE; - upvoteButton.setColorFilter(ContextCompat.getColor(mContext, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN); + upvoteButton.setColorFilter(ContextCompat.getColor(mContext, R.color.upvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { //Upvoted before getItem(getAdapterPosition()).setVoteType(CommentData.VOTE_TYPE_NO_VOTE); @@ -273,7 +273,7 @@ class CommentsListingRecyclerViewAdapter extends PagedListAdapter<CommentData, R public void onVoteThingSuccess(int position) { if(newVoteType.equals(RedditUtils.DIR_UPVOTE)) { getItem(getAdapterPosition()).setVoteType(CommentData.VOTE_TYPE_UPVOTE); - upvoteButton.setColorFilter(ContextCompat.getColor(mContext, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN); + upvoteButton.setColorFilter(ContextCompat.getColor(mContext, R.color.upvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { getItem(getAdapterPosition()).setVoteType(CommentData.VOTE_TYPE_NO_VOTE); upvoteButton.clearColorFilter(); @@ -303,7 +303,7 @@ class CommentsListingRecyclerViewAdapter extends PagedListAdapter<CommentData, R //Not downvoted before getItem(getAdapterPosition()).setVoteType(CommentData.VOTE_TYPE_DOWNVOTE); newVoteType = RedditUtils.DIR_DOWNVOTE; - downvoteButton.setColorFilter(ContextCompat.getColor(mContext, R.color.colorAccent), android.graphics.PorterDuff.Mode.SRC_IN); + downvoteButton.setColorFilter(ContextCompat.getColor(mContext, R.color.downvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { //Downvoted before getItem(getAdapterPosition()).setVoteType(CommentData.VOTE_TYPE_NO_VOTE); @@ -318,7 +318,7 @@ class CommentsListingRecyclerViewAdapter extends PagedListAdapter<CommentData, R public void onVoteThingSuccess(int position1) { if(newVoteType.equals(RedditUtils.DIR_DOWNVOTE)) { getItem(getAdapterPosition()).setVoteType(CommentData.VOTE_TYPE_DOWNVOTE); - downvoteButton.setColorFilter(ContextCompat.getColor(mContext, R.color.colorAccent), android.graphics.PorterDuff.Mode.SRC_IN); + downvoteButton.setColorFilter(ContextCompat.getColor(mContext, R.color.downvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { getItem(getAdapterPosition()).setVoteType(CommentData.VOTE_TYPE_NO_VOTE); downvoteButton.clearColorFilter(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java index e13fd779..88d0ad7c 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java @@ -341,11 +341,11 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo switch (voteType) { case 1: //Upvote - ((DataViewHolder) holder).upvoteButton.setColorFilter(ContextCompat.getColor(mContext, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN); + ((DataViewHolder) holder).upvoteButton.setColorFilter(ContextCompat.getColor(mContext, R.color.upvoted), android.graphics.PorterDuff.Mode.SRC_IN); break; case -1: //Downvote - ((DataViewHolder) holder).downvoteButton.setColorFilter(ContextCompat.getColor(mContext, R.color.minusButtonColor), android.graphics.PorterDuff.Mode.SRC_IN); + ((DataViewHolder) holder).downvoteButton.setColorFilter(ContextCompat.getColor(mContext, R.color.downvoted), android.graphics.PorterDuff.Mode.SRC_IN); break; } @@ -507,7 +507,7 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo post.setVoteType(1); newVoteType = RedditUtils.DIR_UPVOTE; ((DataViewHolder) holder).upvoteButton - .setColorFilter(ContextCompat.getColor(mContext, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN); + .setColorFilter(ContextCompat.getColor(mContext, R.color.upvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { //Upvoted before post.setVoteType(0); @@ -523,7 +523,7 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo if(newVoteType.equals(RedditUtils.DIR_UPVOTE)) { post.setVoteType(1); ((DataViewHolder) holder).upvoteButton - .setColorFilter(ContextCompat.getColor(mContext, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN); + .setColorFilter(ContextCompat.getColor(mContext, R.color.upvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { post.setVoteType(0); ((DataViewHolder) holder).upvoteButton.clearColorFilter(); @@ -572,7 +572,7 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo post.setVoteType(-1); newVoteType = RedditUtils.DIR_DOWNVOTE; ((DataViewHolder) holder).downvoteButton - .setColorFilter(ContextCompat.getColor(mContext, R.color.colorAccent), android.graphics.PorterDuff.Mode.SRC_IN); + .setColorFilter(ContextCompat.getColor(mContext, R.color.downvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { //Downvoted before post.setVoteType(0); @@ -588,7 +588,7 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo if(newVoteType.equals(RedditUtils.DIR_DOWNVOTE)) { post.setVoteType(-1); ((DataViewHolder) holder).downvoteButton - .setColorFilter(ContextCompat.getColor(mContext, R.color.colorAccent), android.graphics.PorterDuff.Mode.SRC_IN); + .setColorFilter(ContextCompat.getColor(mContext, R.color.downvoted), android.graphics.PorterDuff.Mode.SRC_IN); } else { post.setVoteType(0); ((DataViewHolder) holder).downvoteButton.clearColorFilter(); diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 4282dff3..20a320f3 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -4,7 +4,7 @@ <color name="colorPrimaryDark">#121212</color> <color name="colorAccent">#FF4081</color> - <color name="minusButtonColor">#E91E63</color> + <color name="downvoted">#E91E63</color> <color name="transparentActionBarColor">#88000000</color> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 000500bf..ba621d20 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -4,8 +4,6 @@ <color name="colorPrimaryDark">#0D47A1</color> <color name="colorAccent">#FF4081</color> - <color name="minusButtonColor">#E91E63</color> - <color name="transparentActionBarColor">#88000000</color> <color name="gold">#FFC107</color> @@ -30,6 +28,10 @@ <color name="roundedBottomSheetPrimaryNavigationBarColor">@color/roundedBottomSheetPrimaryBackground</color> + <color name="upvoted">#007DDE</color> + + <color name="downvoted">#E91E63</color> + <color name="voteAndReplyUnavailableVoteButtonColor">#F0F0F0</color> <color name="tabLayoutWithExpandedCollapsingToolbarTextColor">@color/colorPrimary</color> |