Open lutics opened 4 years ago
Hi @lutics configuring the badge size is currently not supported because our designers want to ensure that the badge is legible when a number is displayed. Do you have plans to display a number or will this be icon only?
As I left my company, I had no connection with this issue. So close the issue
I don't know if I came on time but I found a simple patch to make it bigger, the idea is attach it and then clear its number I tested with 1.3.0:alpha02 here is a kotlin example:
private fun addBadgeNotificationToView(
v: View,
parent: FrameLayout,
verticalOffset: Int = 0,
horizontalOffset: Int = 0): BadgeDrawable {
val badge = BadgeDrawable.create(this);
v.viewTreeObserver.addOnGlobalLayoutListener(object: ViewTreeObserver.OnGlobalLayoutListener {
@Override
override fun onGlobalLayout() {
badge.verticalOffset = verticalOffset;
badge.horizontalOffset = horizontalOffset;
badge.number = 0
BadgeUtils.attachBadgeDrawable(
badge,
v,
parent
);
badge.clearNumber()
v.viewTreeObserver.removeOnGlobalLayoutListener(this);
}
})
return badge
}
Hi!
I ended up here because I'm looking for a way to make the badge bigger but apparently it's not supported or haven't found how can this be achieved.
For accessibility reasons when the user selects to display the font big/large from device settings the number inside the badge is not displayed very nicely. It would be great to be able to scale the badge accordingly or set some kind of minimum padding. For example checkout the gmail badge when font is scaled:
(tested in Samsung J7)
@JorgeMucientes are you observing badge text being cut off when Font Size is set to Largest?
I am not able to reproduce the gmail badge bug in your screenshot.
Hi! The worst case scenario it's the one I showed in the previous screenshot. Note that not all devices support such a large font size as Samsung devices (Samsung J7 is the device used in the screenshots). I've also tested Pixel devices using android stock, and the font can't be set as large as in Samsung devices. It really depends on the OEM custom software. In general, what I've seen for Samsung is that some numbers display a slight cut off like the number 7 you see in the previous screenshot. But in most cases what happens is there is 0 padding between the number and the badge border but there is no visible cut off. Check some more examples:
Thank you for reporting this issue, could you please send feedback to Gmail (there should be an option in the app) as well?
Yes no problem! reported to the gmail team as well linking to this github issue.
Let me know if you need any further info!
Hey @wcshi! Friendly ping. Can we close this issue now?
Hi Guys! @JorgeMucientes Do you have any updates? I'm facing a similar Issue, the number of badge is cutting off when I increase the font size.
Hello
How can I set height(or size) for BadgeDrawable in TabLayout ?
expected
but I've got