Added option for counts / pinned nav menu

This commit is contained in:
M66B
2022-03-07 07:53:37 +01:00
parent a6c0073c8d
commit df874106ad
7 changed files with 37 additions and 7 deletions

View File

@@ -46,7 +46,9 @@ public class AdapterNavMenu extends RecyclerView.Adapter<AdapterNavMenu.ViewHold
private Context context;
private LifecycleOwner owner;
private LayoutInflater inflater;
private boolean nav_count;
private boolean nav_count_pinned;
private int colorUnread;
private int colorControlNormal;
@@ -103,7 +105,7 @@ public class AdapterNavMenu extends RecyclerView.Adapter<AdapterNavMenu.ViewHold
? View.GONE : View.VISIBLE);
tvCount.setText(Helper.formatNumber(count, 99, NF));
tvCount.setVisibility(count == null || count == 0 || expanded || !nav_count
tvCount.setVisibility(count == null || count == 0 || expanded || !nav_count_pinned
? View.GONE : View.VISIBLE);
if (count == null)
@@ -153,6 +155,7 @@ public class AdapterNavMenu extends RecyclerView.Adapter<AdapterNavMenu.ViewHold
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
this.nav_count = prefs.getBoolean("nav_count", false);
this.nav_count_pinned = prefs.getBoolean("nav_count_pinned", false);
boolean highlight_unread = prefs.getBoolean("highlight_unread", true);
int colorHighlight = prefs.getInt("highlight_color", Helper.resolveColor(context, R.attr.colorUnreadHighlight));
this.colorUnread = (highlight_unread ? colorHighlight : Helper.resolveColor(context, R.attr.colorUnread));