aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml
diff options
context:
space:
mode:
authorDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2022-08-14 07:47:57 +0000
committerDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2022-08-14 07:47:57 +0000
commit275063684779a02efe7ec8ef971bb219b1f4fd33 (patch)
treebb2ed692f7dc49231d50881be78d7742df63098c /app/src/main/java/ml
parent7a0a40f696cd05892a42fe5eb2985ee5fdd6f09c (diff)
downloadinfinity-for-reddit-275063684779a02efe7ec8ef971bb219b1f4fd33.tar
infinity-for-reddit-275063684779a02efe7ec8ef971bb219b1f4fd33.tar.gz
infinity-for-reddit-275063684779a02efe7ec8ef971bb219b1f4fd33.tar.bz2
infinity-for-reddit-275063684779a02efe7ec8ef971bb219b1f4fd33.tar.lz
infinity-for-reddit-275063684779a02efe7ec8ef971bb219b1f4fd33.tar.xz
infinity-for-reddit-275063684779a02efe7ec8ef971bb219b1f4fd33.tar.zst
infinity-for-reddit-275063684779a02efe7ec8ef971bb219b1f4fd33.zip
Apply custom theme to the header of the navigation drawer.
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/HeaderSectionRecyclerViewAdapter.java11
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/NavigationDrawerRecyclerViewMergedAdapter.java4
2 files changed, 12 insertions, 3 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/HeaderSectionRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/HeaderSectionRecyclerViewAdapter.java
index efc4ecc0..55989855 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/HeaderSectionRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/HeaderSectionRecyclerViewAdapter.java
@@ -29,11 +29,13 @@ import butterknife.ButterKnife;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.activities.BaseActivity;
+import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper;
import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils;
import pl.droidsonroids.gif.GifImageView;
public class HeaderSectionRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private BaseActivity baseActivity;
+ private CustomThemeWrapper customThemeWrapper;
private Resources resources;
private RequestManager glide;
private String accountName;
@@ -46,12 +48,14 @@ public class HeaderSectionRecyclerViewAdapter extends RecyclerView.Adapter<Recyc
private boolean isInMainPage = true;
private PageToggle pageToggle;
- public HeaderSectionRecyclerViewAdapter(BaseActivity baseActivity, RequestManager glide, String accountName,
+ public HeaderSectionRecyclerViewAdapter(BaseActivity baseActivity, CustomThemeWrapper customThemeWrapper,
+ RequestManager glide, String accountName,
SharedPreferences sharedPreferences,
SharedPreferences navigationDrawerSharedPreferences,
SharedPreferences securitySharedPreferences,
PageToggle pageToggle) {
this.baseActivity = baseActivity;
+ this.customThemeWrapper = customThemeWrapper;
resources = baseActivity.getResources();
this.glide = glide;
this.accountName = accountName;
@@ -206,6 +210,11 @@ public class HeaderSectionRecyclerViewAdapter extends RecyclerView.Adapter<Recyc
accountNameTextView.setTypeface(baseActivity.typeface);
karmaTextView.setTypeface(baseActivity.typeface);
}
+
+ itemView.setBackgroundColor(customThemeWrapper.getColorPrimary());
+ accountNameTextView.setTextColor(customThemeWrapper.getToolbarPrimaryTextAndIconColor());
+ karmaTextView.setTextColor(customThemeWrapper.getToolbarSecondaryTextColor());
+ dropIconImageView.setColorFilter(customThemeWrapper.getToolbarPrimaryTextAndIconColor(), android.graphics.PorterDuff.Mode.SRC_IN);
}
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/NavigationDrawerRecyclerViewMergedAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/NavigationDrawerRecyclerViewMergedAdapter.java
index f3159f93..923af7eb 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/NavigationDrawerRecyclerViewMergedAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/NavigationDrawerRecyclerViewMergedAdapter.java
@@ -34,8 +34,8 @@ public class NavigationDrawerRecyclerViewMergedAdapter {
ItemClickListener itemClickListener) {
RequestManager glide = Glide.with(baseActivity);
- headerSectionRecyclerViewAdapter = new HeaderSectionRecyclerViewAdapter(baseActivity, glide, accountName,
- sharedPreferences, navigationDrawerSharedPreferences, securitySharedPreferences,
+ headerSectionRecyclerViewAdapter = new HeaderSectionRecyclerViewAdapter(baseActivity, customThemeWrapper,
+ glide, accountName, sharedPreferences, navigationDrawerSharedPreferences, securitySharedPreferences,
new HeaderSectionRecyclerViewAdapter.PageToggle() {
@Override
public void openAccountSection() {