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

wrap_content not working for IconTextView on v2.0.7 #110

Closed jhavatar closed 9 years ago

jhavatar commented 9 years ago

wrap_content not working for IconTextView on v2.0.7. Works fine in v2.0.5.

JoanZapata commented 9 years ago

It seems to be working for me, can you show me some code showing that it's not working?

jhavatar commented 9 years ago

Sure.

The chevron icon does not appear when I display the following xml layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#FF00FF00"
                android:padding="8dp">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_alignParentLeft="true"
        android:text="Set address"
        android:textColor="#FF000000"
        android:textSize="16sp"/>

    <com.joanzapata.iconify.widget.IconTextView
        android:text="{md-chevron-right}"
        android:textSize="32dp"
        android:textColor="#FF666666"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_alignParentRight="true"/>

</RelativeLayout>

example1

The chevron icon does appear, but is not vertically centered as one would expect, when I change the IcontextView's layout_width and layout_height from wrap_content to 32dp and set gravity to center:

<com.joanzapata.iconify.widget.IconTextView
        android:text="{md-chevron-right}"
        android:textSize="32dp"
        android:textColor="#FF666666"
        android:layout_width="32dp"
        android:layout_height="32dp"
        android:gravity="center"
        android:layout_centerVertical="true"
        android:layout_alignParentRight="true"/>

example2

JoanZapata commented 9 years ago

Thanks for the code, I'll fix it ASAP.

JoanZapata commented 9 years ago

Fixed on 2.0.10, release soon.