Fix colors for notifications
This commit is contained in:
parent
f403d38c81
commit
9ad5177486
|
@ -20,6 +20,7 @@ import static app.fedilab.android.ui.drawer.StatusAdapter.statusManagement;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -31,6 +32,7 @@ import androidx.core.app.ActivityOptionsCompat;
|
||||||
import androidx.lifecycle.LifecycleOwner;
|
import androidx.lifecycle.LifecycleOwner;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.lifecycle.ViewModelStoreOwner;
|
import androidx.lifecycle.ViewModelStoreOwner;
|
||||||
|
import androidx.preference.PreferenceManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
@ -125,6 +127,22 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
||||||
new WeakReference<>(holderFollow.binding.displayName)),
|
new WeakReference<>(holderFollow.binding.displayName)),
|
||||||
TextView.BufferType.SPANNABLE);
|
TextView.BufferType.SPANNABLE);
|
||||||
holderFollow.binding.username.setText(String.format("@%s", notification.account.acct));
|
holderFollow.binding.username.setText(String.format("@%s", notification.account.acct));
|
||||||
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
int theme_icons_color = -1;
|
||||||
|
int theme_text_color = -1;
|
||||||
|
if (sharedpreferences.getBoolean("use_custom_theme", false)) {
|
||||||
|
//Getting custom colors
|
||||||
|
theme_icons_color = sharedpreferences.getInt("theme_icons_color", -1);
|
||||||
|
theme_text_color = sharedpreferences.getInt("theme_text_color", -1);
|
||||||
|
}
|
||||||
|
if (theme_icons_color != -1) {
|
||||||
|
Helper.changeDrawableColor(context, holderFollow.binding.cacheIndicator, theme_icons_color);
|
||||||
|
}
|
||||||
|
if (theme_text_color != -1) {
|
||||||
|
holderFollow.binding.displayName.setTextColor(theme_text_color);
|
||||||
|
holderFollow.binding.username.setTextColor(theme_text_color);
|
||||||
|
holderFollow.binding.title.setTextColor(theme_text_color);
|
||||||
|
}
|
||||||
if (getItemViewType(position) == TYPE_FOLLOW_REQUEST) {
|
if (getItemViewType(position) == TYPE_FOLLOW_REQUEST) {
|
||||||
holderFollow.binding.rejectButton.setVisibility(View.VISIBLE);
|
holderFollow.binding.rejectButton.setVisibility(View.VISIBLE);
|
||||||
holderFollow.binding.acceptButton.setVisibility(View.VISIBLE);
|
holderFollow.binding.acceptButton.setVisibility(View.VISIBLE);
|
||||||
|
|
|
@ -483,6 +483,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
}
|
}
|
||||||
if (theme_icons_color != -1) {
|
if (theme_icons_color != -1) {
|
||||||
Helper.changeDrawableColor(context, holder.binding.actionButtonReply, theme_icons_color);
|
Helper.changeDrawableColor(context, holder.binding.actionButtonReply, theme_icons_color);
|
||||||
|
Helper.changeDrawableColor(context, holder.binding.cacheIndicator, theme_icons_color);
|
||||||
Helper.changeDrawableColor(context, holder.binding.statusAddCustomEmoji, theme_icons_color);
|
Helper.changeDrawableColor(context, holder.binding.statusAddCustomEmoji, theme_icons_color);
|
||||||
Helper.changeDrawableColor(context, holder.binding.statusEmoji, theme_icons_color);
|
Helper.changeDrawableColor(context, holder.binding.statusEmoji, theme_icons_color);
|
||||||
Helper.changeDrawableColor(context, holder.binding.actionButtonMore, theme_icons_color);
|
Helper.changeDrawableColor(context, holder.binding.actionButtonMore, theme_icons_color);
|
||||||
|
@ -496,7 +497,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
||||||
holder.binding.actionButtonFavorite.setInActiveImageTintColor(theme_icons_color);
|
holder.binding.actionButtonFavorite.setInActiveImageTintColor(theme_icons_color);
|
||||||
holder.binding.actionButtonBookmark.setInActiveImageTintColor(theme_icons_color);
|
holder.binding.actionButtonBookmark.setInActiveImageTintColor(theme_icons_color);
|
||||||
holder.binding.actionButtonBoost.setInActiveImageTintColor(theme_icons_color);
|
holder.binding.actionButtonBoost.setInActiveImageTintColor(theme_icons_color);
|
||||||
Helper.changeDrawableColor(context, R.drawable.ic_baseline_cached_24, theme_icons_color);
|
|
||||||
holder.binding.replyCount.setTextColor(theme_icons_color);
|
holder.binding.replyCount.setTextColor(theme_icons_color);
|
||||||
} else {
|
} else {
|
||||||
holder.binding.actionButtonFavorite.setInActiveImageTintColor(ThemeHelper.getAttColor(context, R.attr.colorControlNormal));
|
holder.binding.actionButtonFavorite.setInActiveImageTintColor(ThemeHelper.getAttColor(context, R.attr.colorControlNormal));
|
||||||
|
|
Loading…
Reference in New Issue