mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-19 09:25:34 +00:00
[fenix] Fixes https://github.com/mozilla-mobile/fenix/issues/11672, https://github.com/mozilla-mobile/fenix/issues/11727: Empty default tab text and add padding to infinite character
This commit is contained in:
parent
65ca7c9cd1
commit
b346ec3f65
@ -29,7 +29,6 @@ open class TabCounter @JvmOverloads constructor(
|
||||
val inflater = LayoutInflater.from(context)
|
||||
inflater.inflate(R.layout.mozac_ui_tabcounter_layout, this)
|
||||
|
||||
counter_text.text = DEFAULT_TABS_COUNTER_TEXT
|
||||
val shiftThreeDp = TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP, TWO_DIGIT_PADDING, context.resources.displayMetrics
|
||||
).toInt()
|
||||
@ -198,6 +197,7 @@ open class TabCounter @JvmOverloads constructor(
|
||||
|
||||
private fun formatForDisplay(count: Int): String {
|
||||
return if (count > MAX_VISIBLE_TABS) {
|
||||
counter_text.setPadding(0,0,0,6)
|
||||
SO_MANY_TABS_OPEN
|
||||
} else NumberFormat.getInstance().format(count.toLong())
|
||||
}
|
||||
@ -220,7 +220,6 @@ open class TabCounter @JvmOverloads constructor(
|
||||
internal const val MAX_VISIBLE_TABS = 99
|
||||
|
||||
internal const val SO_MANY_TABS_OPEN = "∞"
|
||||
internal const val DEFAULT_TABS_COUNTER_TEXT = ":)"
|
||||
|
||||
internal const val ONE_DIGIT_SIZE_RATIO = 0.5f
|
||||
internal const val TWO_DIGITS_SIZE_RATIO = 0.4f
|
||||
|
Loading…
Reference in New Issue
Block a user