Added back unread count.

This commit is contained in:
Amine 2017-06-06 20:02:05 +02:00
parent 95f267f701
commit 7071af5fa5
2 changed files with 7 additions and 1 deletions

View File

@ -52,6 +52,7 @@ import com.mikepenz.aboutlibraries.LibsBuilder
import com.mikepenz.iconics.IconicsDrawable import com.mikepenz.iconics.IconicsDrawable
import com.mikepenz.materialdrawer.Drawer import com.mikepenz.materialdrawer.Drawer
import com.mikepenz.materialdrawer.DrawerBuilder import com.mikepenz.materialdrawer.DrawerBuilder
import com.mikepenz.materialdrawer.holder.BadgeStyle
import com.mikepenz.materialdrawer.model.DividerDrawerItem import com.mikepenz.materialdrawer.model.DividerDrawerItem
import com.mikepenz.materialdrawer.model.SecondaryDrawerItem import com.mikepenz.materialdrawer.model.SecondaryDrawerItem
import com.mikepenz.materialdrawer.model.PrimaryDrawerItem import com.mikepenz.materialdrawer.model.PrimaryDrawerItem
@ -208,6 +209,11 @@ class HomeActivity : AppCompatActivity() {
.withName(tag.tag) .withName(tag.tag)
.withIdentifier(longHash(tag.tag)) .withIdentifier(longHash(tag.tag))
.withIcon(gd) .withIcon(gd)
.withBadge("${tag.unread}")
.withBadgeStyle(
BadgeStyle().withTextColor(Color.WHITE)
.withColorRes(R.color.colorAccent)
)
.withOnDrawerItemClickListener { _, _, _ -> .withOnDrawerItemClickListener { _, _, _ ->
getElementsAccordingToTab(maybeTagFilter = tag) getElementsAccordingToTab(maybeTagFilter = tag)
false false

View File

@ -17,7 +17,7 @@ private fun constructUrl(config: Config?, path: String, file: String): String {
} }
data class Tag(val tag: String, val color: String) data class Tag(val tag: String, val color: String, val unread: Int)
class SuccessResponse(val success: Boolean) { class SuccessResponse(val success: Boolean) {
val isSuccess: Boolean val isSuccess: Boolean