Skip to content

Commit 50aa394

Browse files
authored
Merge pull request #13825 from woocommerce/issue/13783-update-order-count-badge-limit
Update the maximum character count for the order badge
2 parents 9b9850c + c3a238d commit 50aa394

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

RELEASE-NOTES.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*** For entries which are touching the Android Wear app's, start entry with `[WEAR]` too.
44
22.1
55
-----
6-
6+
- [*] The order count badge is now fully visible for counts higher than 99 [https://github.com/woocommerce/woocommerce-android/pull/13825]
77

88
22.0
99
-----

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/main/MainBottomNavigationView.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class MainBottomNavigationView @JvmOverloads constructor(
7676
ordersBadge = getOrCreateBadge(R.id.orders)
7777
ordersBadge.isVisible = false
7878
ordersBadge.backgroundColor = ContextCompat.getColor(context, R.color.color_primary)
79-
ordersBadge.maxCharacterCount = 3 // this includes the plus sign
79+
ordersBadge.maxCharacterCount = MAX_CHARACTERS_IN_BADGE // this includes the plus sign
8080

8181
moreMenuBadge = getOrCreateBadge(R.id.moreMenu)
8282
moreMenuBadge.isVisible = false
@@ -133,10 +133,6 @@ class MainBottomNavigationView @JvmOverloads constructor(
133133
}
134134
}
135135

136-
fun clearOrderBadgeCount() {
137-
ordersBadge.clearNumber()
138-
}
139-
140136
override fun onNavigationItemSelected(item: MenuItem): Boolean {
141137
navController?.let { navController ->
142138
val navSuccess = NavigationUI.onNavDestinationSelected(item, navController)
@@ -160,4 +156,8 @@ class MainBottomNavigationView @JvmOverloads constructor(
160156

161157
private fun NavDestination.matchDestination(@IdRes destId: Int): Boolean =
162158
hierarchy.any { it.id == destId }
159+
160+
companion object {
161+
private const val MAX_CHARACTERS_IN_BADGE = 4
162+
}
163163
}

0 commit comments

Comments
 (0)