question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Badge overlaps text

See original GitHub issue

A 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

device-2019-07-29-171236

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
wcshicommented, Aug 23, 2019

Changes have been submitted internally and should be synced out in the next release.

1reaction
wcshicommented, Aug 22, 2019

Prototyping is actively on going.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Badges overlapping menu - WordPress.org
Hi guys,. Great and easy plugin! But I seem to be having an issue with the badges overlapping my navigation menu. Screenshot: https://ibb.co/t2ghDwZ....
Read more >
How to prevent overlap of badges after increasing their size in ...
Im trying to create badges in bootstrap with a larger font size. But the problem is the badges overlap in a smaller screen...
Read more >
Autolayout Overlapping Badge | Figma Community
This is a creative way to have a badge laid over a text in an auto layout component. By the same token, I...
Read more >
Card Form: HIPAA badge overlaps the pagination button. - Jotform
Dear Sir/Madam: We continue to experience issues with overlapping text on the question button (HIPAA text overlaps the question sequence).
Read more >
Adding Watermarks, Credits, Badges, and Text Overlays to ...
Learn how to add watermarks, credits, and badges as overlays to images, automatically or programmatically, with Cloudinary.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found