Badge layout¶
BadgeLayout
provides BadgeView
and AppCompatImageView
by default, where the logo will be displayed in the upper right corner and the icon will be displayed horizontally in the center.
Label¶
BadgeLayout
is only allowed to contain a view of type TextView
to display labels. The following is sample code:
<com.ave.vastgui.tools.view.badgeview.BadgeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:badge_mode="number">
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Number Bubble" />
</com.ave.vastgui.tools.view.badgeview.BadgeLayout>
Dot badge¶
Calling showDot
or hideDot
to control dot badge.
// Show badge
mBinding.dotbadge.showDot()
// Hide badge
mBinding.dotbadge.hideDot()