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