JoanZapata / android-iconify

Android integration of multiple icon providers such as FontAwesome, Entypo, Typicons,...
http://joanzapata.com/android-iconify
Other
3.93k stars 526 forks source link

View has wrong width #118

Closed electrolobzik closed 9 years ago

electrolobzik commented 9 years ago

I have upgraded to v.2.0.8 and got issue on my view:

<com.joanzapata.iconify.widget.IconTextView
                android:id="@+id/trashImg"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:gravity="center"
                android:layout_alignParentRight="true"
                android:layout_alignParentEnd="true"
                android:layout_centerVertical="true"
                android:layout_margin="@dimen/default_padding"
                android:text="{md-delete}"
                android:textColor="@color/white"
                android:textSize="@dimen/big_material_icon_text_size"
                />

In 2.0.2: In 2.0.2

In 2.0.8: In 2.0.8

electrolobzik commented 9 years ago

I have also similar issue with my custom View nested from TextView. I use

setText("{md-check}");
Iconify.addIcons(this);

to get the icon in it.

This is the view in layout:

<net.privacyeverywhere.ui.view.CircleLetterView
android:id="@+id/mailRoundButtonTxt"
android:layout_width="@dimen/mail_item_circle_width"
android:layout_height="@dimen/mail_item_circle_width"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/small_padding"
android:layout_marginEnd="@dimen/small_padding"
/>

In 2.0.2: 2.0.2

In 2.0.8: 2.0.8

JoanZapata commented 9 years ago

Thank you so much for all the details, I think I know what it is. Between version 2.0.2 and 2.0.8 I changed the way the icon are rendered. In 2.0.8 I compute their size and draw them myself on the canvas (to be able to rotate them when the user is using spin). I'll probably need to tweak those values a little bit. I'll try to get some time to get it right before the end of the week.

JoanZapata commented 9 years ago

The fix will be published on 2.0.10 soon