Compare commits

...

2 Commits

Author SHA1 Message Date
f6317f566e Same change for hidden tags. 2019-01-02 21:30:26 +01:00
9f51e4e6a5 Closes #264 2019-01-02 21:21:32 +01:00

View File

@ -531,12 +531,11 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
gd.shape = GradientDrawable.RECTANGLE gd.shape = GradientDrawable.RECTANGLE
gd.setSize(30, 30) gd.setSize(30, 30)
gd.cornerRadius = 30F gd.cornerRadius = 30F
drawer.addItem( var drawerItem =
PrimaryDrawerItem() PrimaryDrawerItem()
.withName(it.tag) .withName(it.tag)
.withIdentifier(it.tag.longHash()) .withIdentifier(it.tag.longHash())
.withIcon(gd) .withIcon(gd)
.withBadge("${it.unread}")
.withBadgeStyle( .withBadgeStyle(
BadgeStyle().withTextColor(Color.WHITE) BadgeStyle().withTextColor(Color.WHITE)
.withColor(appColors.colorAccent) .withColor(appColors.colorAccent)
@ -547,6 +546,11 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
getElementsAccordingToTab() getElementsAccordingToTab()
false false
} }
if (it.unread > 0) {
drawerItem = drawerItem.withBadge("${it.unread}")
}
drawer.addItem(
drawerItem
) )
(it.tag.longHash() to it.unread) (it.tag.longHash() to it.unread)
@ -578,12 +582,11 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
gd.shape = GradientDrawable.RECTANGLE gd.shape = GradientDrawable.RECTANGLE
gd.setSize(30, 30) gd.setSize(30, 30)
gd.cornerRadius = 30F gd.cornerRadius = 30F
drawer.addItem( var drawerItem =
PrimaryDrawerItem() PrimaryDrawerItem()
.withName(it.tag) .withName(it.tag)
.withIdentifier(it.tag.longHash()) .withIdentifier(it.tag.longHash())
.withIcon(gd) .withIcon(gd)
.withBadge("${it.unread}")
.withBadgeStyle( .withBadgeStyle(
BadgeStyle().withTextColor(Color.WHITE) BadgeStyle().withTextColor(Color.WHITE)
.withColor(appColors.colorAccent) .withColor(appColors.colorAccent)
@ -594,6 +597,11 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
getElementsAccordingToTab() getElementsAccordingToTab()
false false
} }
if (it.unread > 0) {
drawerItem = drawerItem.withBadge("${it.unread}")
}
drawer.addItem(
drawerItem
) )
(it.tag.longHash() to it.unread) (it.tag.longHash() to it.unread)