nikartx / Image-Support

Add badge with counter to ImageView Android.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Show/Hide count zero

JibuVarghese opened this issue · comments

Is it possible to show/hide count badge with zero?

Hi, yes it's possible. Just use attr app:ibv_visibleBadge="true"
For example:

<ru.nikartm.support.ImageBadgeView
    android:id="@+id/ibv_icon2"
    android:layout_width="80dp"
    android:layout_height="80dp"
    android:layout_marginTop="30dp"
    android:layout_gravity="center"
    android:padding="5dp"
    app:ibv_badgeValue="0"
    app:ibv_visibleBadge="true"
    app:ibv_badgeTextSize="12sp"
    app:ibv_fixedBadgeRadius="15dp"
    app:ibv_badgeTextStyle="bold"
    app:ibv_badgeTextColor="#ffffff"
    app:ibv_badgeColor="#00ACC1"
    app:ibv_badgeLimitValue="false"
    android:src="@drawable/ic_shopping_cart" />

or programmatically:

imageBadgeView.visibleBadge(true);

@nikartm Thank you very much. Great lib.

@JibuVarghese Thanks. Happy coding :)