From b95804c33bd775fe1e5677b27912eeeac5d135f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hakk=C4=B1=20Kaan=20=C3=87al=C4=B1=C5=9Fkan?= Date: Thu, 18 Jun 2020 16:28:53 +0300 Subject: [PATCH] Fixes #11672, #11727: Empty default tab text and add padding to infinite character --- .../java/org/mozilla/fenix/components/toolbar/TabCounter.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/components/toolbar/TabCounter.kt b/app/src/main/java/org/mozilla/fenix/components/toolbar/TabCounter.kt index 564dbbdea6..ca6c4cf407 100644 --- a/app/src/main/java/org/mozilla/fenix/components/toolbar/TabCounter.kt +++ b/app/src/main/java/org/mozilla/fenix/components/toolbar/TabCounter.kt @@ -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