set badge text appearance [feature request]
Author: tlubzCreated Nov 8, 2016Updated Apr 4, 2023
I don't see any way to access the text appearance of the badges as of BottomBar 2. In v1, it was possible to get access to the badge directly:
bottomBar.makeBadgeForTabAt(tab, redColor, initialCount)
.setTextAppearance(context, R.style.custom_badge_appearance);In v2, BottomBarBadge is package-local, and the badge is no longer accessible by any public api method (that I was able to find). I was able to hack around to set the badges' text appearance by traversing the view hierarchy:
((TextView) ((ViewGroup) theTab.getParent()).getChildAt(1))
.setTextAppearance(context, R.style.custom_badge_appearance);but obviously this is not ideal, as it exposes my code to changes to the internal view hierarchy of the BottomBar.
It would be nice to have a styleable view attribute and accessor, e.g. app:bb_badgeTextAppearance and setBadgeTextAppearance(), similar to what you have for the tab title text appearance.
Source: roughike/BottomBar