aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-05-07 15:55:49 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-05-07 15:55:49 +0000
commitc8d1a9e37ada68835838440ce7c25b0ee96798b5 (patch)
treec0c1894dc746149846f42eb1b8f7079b546434c2 /app/src/main/java
parent297db53aa3038e4486a8fc199425a77476c9cb06 (diff)
downloadinfinity-for-reddit-c8d1a9e37ada68835838440ce7c25b0ee96798b5.tar
infinity-for-reddit-c8d1a9e37ada68835838440ce7c25b0ee96798b5.tar.gz
infinity-for-reddit-c8d1a9e37ada68835838440ce7c25b0ee96798b5.tar.bz2
infinity-for-reddit-c8d1a9e37ada68835838440ce7c25b0ee96798b5.tar.lz
infinity-for-reddit-c8d1a9e37ada68835838440ce7c25b0ee96798b5.tar.xz
infinity-for-reddit-c8d1a9e37ada68835838440ce7c25b0ee96798b5.tar.zst
infinity-for-reddit-c8d1a9e37ada68835838440ce7c25b0ee96798b5.zip
Dark theme support.
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/CommentMultiLevelRecyclerViewAdapter.java4
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java6
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRecyclerViewAdapter.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRecyclerViewAdapter.java7
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java10
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java4
6 files changed, 17 insertions, 16 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentMultiLevelRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentMultiLevelRecyclerViewAdapter.java
index a8928495..e9f29f3c 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentMultiLevelRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentMultiLevelRecyclerViewAdapter.java
@@ -156,7 +156,7 @@ class CommentMultiLevelRecyclerViewAdapter extends MultiLevelAdapter {
commentItem.setVoteType(1);
newVoteType = RedditUtils.DIR_UPVOTE;
((CommentViewHolder) holder).upvoteButton
- .setColorFilter(ContextCompat.getColor(mContext, R.color.colorPrimary), android.graphics.PorterDuff.Mode.SRC_IN);
+ .setColorFilter(ContextCompat.getColor(mContext, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN);
} else {
//Upvoted before
commentItem.setVoteType(0);
@@ -172,7 +172,7 @@ class CommentMultiLevelRecyclerViewAdapter extends MultiLevelAdapter {
if(newVoteType.equals(RedditUtils.DIR_UPVOTE)) {
commentItem.setVoteType(1);
((CommentViewHolder) holder).upvoteButton
- .setColorFilter(ContextCompat.getColor(mContext, R.color.colorPrimary), android.graphics.PorterDuff.Mode.SRC_IN);
+ .setColorFilter(ContextCompat.getColor(mContext, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN);
} else {
commentItem.setVoteType(0);
((CommentViewHolder) holder).upvoteButton.clearColorFilter();
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java
index 0bc59909..717df7de 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java
@@ -270,7 +270,7 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
switch (voteType) {
case 1:
//Upvote
- ((DataViewHolder) holder).upvoteButton.setColorFilter(ContextCompat.getColor(mContext, R.color.colorPrimary), android.graphics.PorterDuff.Mode.SRC_IN);
+ ((DataViewHolder) holder).upvoteButton.setColorFilter(ContextCompat.getColor(mContext, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN);
break;
case -1:
//Downvote
@@ -389,7 +389,7 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
post.setVoteType(1);
newVoteType = RedditUtils.DIR_UPVOTE;
((DataViewHolder) holder).upvoteButton
- .setColorFilter(ContextCompat.getColor(mContext, R.color.colorPrimary), android.graphics.PorterDuff.Mode.SRC_IN);
+ .setColorFilter(ContextCompat.getColor(mContext, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN);
} else {
//Upvoted before
post.setVoteType(0);
@@ -405,7 +405,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.colorPrimary), android.graphics.PorterDuff.Mode.SRC_IN);
+ .setColorFilter(ContextCompat.getColor(mContext, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN);
} else {
post.setVoteType(0);
((DataViewHolder) holder).upvoteButton.clearColorFilter();
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRecyclerViewAdapter.java
index 1205dedf..521086da 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRecyclerViewAdapter.java
@@ -38,7 +38,7 @@ class SubscribedSubredditRecyclerViewAdapter extends RecyclerView.Adapter<Recycl
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
- return new SubredditViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_subscribed_subreddit, viewGroup, false));
+ return new SubredditViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_subscribed_thing, viewGroup, false));
}
@Override
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRecyclerViewAdapter.java
index 9ac6a205..84e70cbd 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRecyclerViewAdapter.java
@@ -7,6 +7,9 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestManager;
import com.bumptech.glide.request.RequestOptions;
@@ -14,8 +17,6 @@ import com.bumptech.glide.request.RequestOptions;
import java.util.List;
import SubscribedUserDatabase.SubscribedUserData;
-import androidx.annotation.NonNull;
-import androidx.recyclerview.widget.RecyclerView;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import pl.droidsonroids.gif.GifImageView;
@@ -38,7 +39,7 @@ public class SubscribedUserRecyclerViewAdapter extends RecyclerView.Adapter<Recy
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
- return new UserViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_subscribed_subreddit, viewGroup, false));
+ return new UserViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_subscribed_thing, viewGroup, false));
}
@Override
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java
index 55e064df..8b91b53b 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java
@@ -20,7 +20,6 @@ import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.browser.customtabs.CustomTabsIntent;
-import androidx.cardview.widget.CardView;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.content.ContextCompat;
import androidx.core.widget.NestedScrollView;
@@ -35,6 +34,7 @@ import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.Target;
+import com.google.android.material.card.MaterialCardView;
import com.google.android.material.chip.Chip;
import com.google.android.material.snackbar.Snackbar;
import com.lsjwzh.widget.materialloadingprogressbar.CircleProgressBar;
@@ -105,7 +105,7 @@ public class ViewPostDetailActivity extends AppCompatActivity {
@BindView(R.id.share_button_view_post_detail) ImageView mShareButton;
@BindView(R.id.comment_progress_bar_view_post_detail) CircleProgressBar mCommentProgressbar;
- @BindView(R.id.comment_card_view_view_post_detail) CardView mCommentCardView;
+ @BindView(R.id.comment_card_view_view_post_detail) MaterialCardView mCommentCardView;
@BindView(R.id.recycler_view_view_post_detail) MultiLevelRecyclerView mRecyclerView;
@BindView(R.id.no_comment_wrapper_linear_layout_view_post_detail) LinearLayout mNoCommentWrapperLinearLayout;
@@ -187,7 +187,7 @@ public class ViewPostDetailActivity extends AppCompatActivity {
switch (mPost.getVoteType()) {
case 1:
//Upvote
- mUpvoteButton.setColorFilter(ContextCompat.getColor(this, R.color.colorPrimary), PorterDuff.Mode.SRC_IN);
+ mUpvoteButton.setColorFilter(ContextCompat.getColor(this, R.color.backgroundColorPrimaryDark), PorterDuff.Mode.SRC_IN);
break;
case -1:
//Downvote
@@ -344,7 +344,7 @@ public class ViewPostDetailActivity extends AppCompatActivity {
//Not upvoted before
mPost.setVoteType(1);
newVoteType = RedditUtils.DIR_UPVOTE;
- mUpvoteButton.setColorFilter(ContextCompat.getColor(this, R.color.colorPrimary), android.graphics.PorterDuff.Mode.SRC_IN);
+ mUpvoteButton.setColorFilter(ContextCompat.getColor(this, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN);
} else {
//Upvoted before
mPost.setVoteType(0);
@@ -363,7 +363,7 @@ public class ViewPostDetailActivity extends AppCompatActivity {
public void onVoteThingSuccess() {
if(newVoteType.equals(RedditUtils.DIR_UPVOTE)) {
mPost.setVoteType(1);
- mUpvoteButton.setColorFilter(ContextCompat.getColor(ViewPostDetailActivity.this, R.color.colorPrimary), android.graphics.PorterDuff.Mode.SRC_IN);
+ mUpvoteButton.setColorFilter(ContextCompat.getColor(ViewPostDetailActivity.this, R.color.backgroundColorPrimaryDark), android.graphics.PorterDuff.Mode.SRC_IN);
} else {
mPost.setVoteType(0);
mUpvoteButton.clearColorFilter();
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java
index 70cdda82..3178a507 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java
@@ -182,7 +182,7 @@ public class ViewSubredditDetailActivity extends AppCompatActivity {
@Override
public void onSubredditSubscriptionSuccess() {
subscribeSubredditChip.setText(R.string.subscribe);
- subscribeSubredditChip.setChipBackgroundColor(getResources().getColorStateList(R.color.colorPrimaryDark));
+ subscribeSubredditChip.setChipBackgroundColor(getResources().getColorStateList(R.color.textColorPrimaryDark));
makeSnackbar(R.string.unsubscribed);
subscriptionReady = true;
}
@@ -209,7 +209,7 @@ public class ViewSubredditDetailActivity extends AppCompatActivity {
@Override
public void isNotSubscribed() {
subscribeSubredditChip.setText(R.string.subscribe);
- subscribeSubredditChip.setChipBackgroundColor(getResources().getColorStateList(R.color.colorPrimaryDark));
+ subscribeSubredditChip.setChipBackgroundColor(getResources().getColorStateList(R.color.textColorPrimaryDark));
subscriptionReady = true;
}
}).execute();