Cutta / TagView

Android TagView-HashTagView
Apache License 2.0
490 stars 93 forks source link

Setting android:background property to a color results in blank tags #31

Open loudenvier opened 7 years ago

loudenvier commented 7 years ago

If you set the background color of the TagView the tags are not drawn properly and it shows completely blank. The tags are there, because the TagView is using the correct space, but they are just not drawn correctly.

Here is the XML:

<com.cunoraz.tagview.TagView
    xmlns:tagview="http://schemas.android.com/apk/res-auto"
    android:id="@+id/tagsDanceStyles"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    style="@style/ProfileEditPaddings"
    tagview:lineMargin="5dp"
    tagview:tagMargin="5dp"
    tagview:textPaddingLeft="8dp"
    tagview:textPaddingTop="5dp"
    tagview:textPaddingRight="8dp"
    tagview:textPaddingBottom="5dp" />
<com.cunoraz.tagview.TagView
    xmlns:tagview="http://schemas.android.com/apk/res-auto"
    android:id="@+id/tagsDanceStylesEdit"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    style="@style/ProfileEditPaddings"
    android:background="@color/red_500"
    tagview:lineMargin="5dp"
    tagview:tagMargin="5dp"
    tagview:textPaddingLeft="8dp"
    tagview:textPaddingTop="5dp"
    tagview:textPaddingRight="8dp"
    tagview:textPaddingBottom="5dp" />

Here is how I fill both Tag Views:

for (DanceStyle style : DanceStyles.all()) {
    Tag tag = new Tag(style.name);
    //tag.tagTextColor = getResources().getColor(R.color.editHeaderText);
    tag.layoutColor = getResources().getColor(style.resColor);
    tag.radius = 20f;
    danceStyles.addTag(tag);
    danceStylesEdit.addTag(tag);
}

And this is the result:

tagview-blank

You can see that despite both Tag Views being filled exactly the same way, the one with the background property set draws no tags... Maybe the tags are "bellow" the background...

srujanb commented 7 years ago

Even I'm facing many such issues with this library. I appreciate the efforts but not really well built.