Skip to content

Instantly share code, notes, and snippets.

Created July 10, 2021 01:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
// add badge to alarm
val badgeDrawable = activityMainBinding.navigationRail?.getOrCreateBadge(
badgeDrawable?.run {
Toast.makeText(applicationContext, "Create badge", Toast.LENGTH_SHORT).show()
number = 999
badgeTextColor =
ContextCompat.getColor(applicationContext, android.R.color.holo_red_light)
maxCharacterCount = 2
badgeGravity = BadgeDrawable.TOP_START
isVisible = true
// remove badge
// activityMainBinding.navigationRail?.removeBadge(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment