Badge overlaps text
See original GitHub issueA badge overlaps a text. How can I prevent it? I don’t see any attributes for setting padding /margin.
Code:
val badge = tab_layout.getTabAt(0)?.orCreateBadge?.apply { backgroundColor = requireContext().getColor(R.color.badge_color) } badge?.isVisible = true badge?.number = 4
XML ` <com.google.android.material.tabs.TabLayout android:layout_width=“match_parent” app:tabSelectedTextColor=“@color/colorPrimary” style=“@style/Widget.MaterialComponents.TabLayout.Colored” android:background=“@color/colorPrimaryDark” android:id=“@+id/tab_layout” app:tabIndicatorColor=“@color/colorPrimary” app:tabTextColor=“#FF757575” android:layout_height=“wrap_content”>
<com.google.android.material.tabs.TabItem android:layout_width="wrap_content"
android:text="@string/recent_edits"
android:layout_height="wrap_content"/>
<com.google.android.material.tabs.TabItem android:layout_width="wrap_content"
android:text="@string/recent_events"
android:layout_height="wrap_content"/>
</com.google.android.material.tabs.TabLayout>`
Android API: >23
Material Library version: ‘com.google.android.material:material:1.1.0-alpha08’
Device: Samsung S9 and others
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top GitHub Comments
Changes have been submitted internally and should be synced out in the next release.
Prototyping is actively on going.