finds.dev← search

// the find

mikepenz/Android-ActionItemBadge

★ 1,255 · Java · Apache-2.0 · updated Jun 2020

This library offers a simple method to add a small badge icon to your ActionBar-MenuItem

A small Android library that adds notification-style badges to ActionBar menu items. It wraps the badge rendering into a custom action view and leans on Android-Iconics for the icon layer. Useful if you're stuck maintaining a legacy Android app that still uses the ActionBar pattern.

The API surface is genuinely minimal — one static call to update or hide a badge, no subclassing required. BadgeDrawableBuilder does the right thing by drawing the badge as a Drawable overlay rather than inflating extra views per badge. The library separates style concerns into BadgeStyle, so you can pass in custom colors without forking the code. Maven Central distribution means no JitPack dependency on someone's CI staying up.

Last commit was June 2020, and it hasn't been touched since — no Kotlin, no Compose, no support for the modern Toolbar/MenuItem API patterns most apps use now. The hard dependency on Android-Iconics means you're pulling in a full icon font framework just to show a red circle with a number, which is almost certainly overkill for new projects. It only works when the item is in the ActionBar (showAsAction=always); overflow menu items can't have badges, and there's no workaround. The invalidateOptionsMenu() dance required to update a badge count on interaction is the old way and triggers a full menu re-inflation.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →