0

In my app i use material bottom navigation with default badge ... every thing works perfectly but the number on badge shows in arabic localization sometime ... i don't know why ... so my question is how to make badge number in english always

here is how it's looks in arabic: enter image description here

here is my code to show badge:

viewModel.cartCount.observe(this@MainActivity) {
                val badge = binding.bottomNavigationActivityMain.getOrCreateBadge(R.id.fragment_cart)
                badge.backgroundColor = ContextCompat.getColor(this@MainActivity, R.color.redTextColor)
                if(it > 0){
                    badge.isVisible = true
                    badge.number = it
                }
                else{
                    badge.isVisible = false
                }
            }

Sami Shorman
  • 125
  • 1
  • 7
  • Have a look at the answers under [this](https://stackoverflow.com/questions/36111170/prevent-change-numbers-localization-when-change-android-language-localization). – Saurav Rao Sep 20 '21 at 15:30

0 Answers0