Beige navigation menu

This commit is contained in:
M66B
2020-09-25 11:14:08 +02:00
parent bb702e7519
commit be5a5cddce
6 changed files with 51 additions and 14 deletions

View File

@@ -30,6 +30,7 @@ import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.lifecycle.LifecycleOwner;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
@@ -47,6 +48,7 @@ public class AdapterNavUnified extends RecyclerView.Adapter<AdapterNavUnified.Vi
private Context context;
private LifecycleOwner owner;
private LayoutInflater inflater;
private boolean beige;
private int colorUnread;
private int textColorSecondary;
@@ -125,10 +127,11 @@ public class AdapterNavUnified extends RecyclerView.Adapter<AdapterNavUnified.Vi
}
}
AdapterNavUnified(Context context, LifecycleOwner owner) {
AdapterNavUnified(Context context, LifecycleOwner owner, boolean beige) {
this.context = context;
this.owner = owner;
this.inflater = LayoutInflater.from(context);
this.beige = beige;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean highlight_unread = prefs.getBoolean("highlight_unread", true);
@@ -218,7 +221,11 @@ public class AdapterNavUnified extends RecyclerView.Adapter<AdapterNavUnified.Vi
@Override
@NonNull
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ViewHolder(inflater.inflate(R.layout.item_nav, parent, false));
View view = inflater.inflate(R.layout.item_nav, parent, false);
if (beige)
view.setBackgroundColor(
ContextCompat.getColor(context, R.color.lightColorBackground_cards_beige));
return new ViewHolder(view);
}
@Override