From 7071af5fa5dbd17214ed90b1fb025a83b21c570a Mon Sep 17 00:00:00 2001 From: Amine Date: Tue, 6 Jun 2017 20:02:05 +0200 Subject: [PATCH] Added back unread count. --- .../java/apps/amine/bou/readerforselfoss/HomeActivity.kt | 6 ++++++ .../amine/bou/readerforselfoss/api/selfoss/SelfossModels.kt | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt index b6975e8..5a0cf7c 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt @@ -52,6 +52,7 @@ import com.mikepenz.aboutlibraries.LibsBuilder import com.mikepenz.iconics.IconicsDrawable import com.mikepenz.materialdrawer.Drawer import com.mikepenz.materialdrawer.DrawerBuilder +import com.mikepenz.materialdrawer.holder.BadgeStyle import com.mikepenz.materialdrawer.model.DividerDrawerItem import com.mikepenz.materialdrawer.model.SecondaryDrawerItem import com.mikepenz.materialdrawer.model.PrimaryDrawerItem @@ -208,6 +209,11 @@ class HomeActivity : AppCompatActivity() { .withName(tag.tag) .withIdentifier(longHash(tag.tag)) .withIcon(gd) + .withBadge("${tag.unread}") + .withBadgeStyle( + BadgeStyle().withTextColor(Color.WHITE) + .withColorRes(R.color.colorAccent) + ) .withOnDrawerItemClickListener { _, _, _ -> getElementsAccordingToTab(maybeTagFilter = tag) false diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossModels.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossModels.kt index 0038934..a67510f 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossModels.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossModels.kt @@ -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) { val isSuccess: Boolean