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

Icons size dont show correctly on my test #96

Closed pishguy closed 9 years ago

pishguy commented 9 years ago

Hi all. i'm trying to use this awesome library, but after using and testing that. my icons size are very small and i dont know why dont show in 5 size. for example this is my test:

<IconTextView
    android:id="@+id/imgv_search"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dp"
    android:background="@drawable/button_animate_click_action"
    android:clickable="true"
    android:padding="10dp"
    android:src="@drawable/icon_search"
    android:text="{fa-list-alt}"
    android:textColor="#ffffff"/>

i'm attarched image result of test. please help me to set correct size. Thanks :)

Image URL:https://cloud.githubusercontent.com/assets/6617583/9026522/116f4a00-3947-11e5-8956-b60ec4e69dc5.png

JoanZapata commented 9 years ago

Can you try to remove the padding, see if it's related?

pishguy commented 9 years ago

yes, after remove padding:

http://s6.uplod.ir/i/00653/d9ei9pyxgg43.png

pishguy commented 9 years ago

whats problem? this library is very awesome and i dont like to dont use it. please help me

JoanZapata commented 9 years ago

Trying increasing the textSize manually in the meanwhile, I don't know what's the problem. I don't think it's related to the lib, as the icon only takes the size a normal TextView would take. Make some tests with a normal TextView to be sure.

pishguy commented 9 years ago

i'm testing it. dont change.i'm testing it in new project but. i dont see any change.i'm upload project to test. please download it from this link: www.jaziire.ir/downloads/TestIconify.tar.gz

pishguy commented 9 years ago

can you test my simple project? it doesnt work correctly on that

JoanZapata commented 9 years ago

There's nothing wrong in the project, you only use IconTextView in your layout. Where is the action bar issue you showed me?

pishguy commented 9 years ago

​if you click on each item of list you can simply view icon in left of content. thats very small and i can not cahange size of that. ​

I'm attached screen shot

pishguy commented 9 years ago

if you can't test source i can attach apk file for you to resolve and find whats problem.

JoanZapata commented 9 years ago

What do you mean you can't change it? If I change the size of the text in one of them, the icon gets bigger:

  <IconTextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="50sp"
        android:text="{fa-list-alt}" />

    <IconTextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="{fa-list-alt}" />
    <IconTextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="{fa-list-alt}" />
    <IconTextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="{fa-list-alt}" />

test

What's wrong?

pishguy commented 9 years ago

​problem is this: i dont want to my application run on what resulation and i'm simply add 5 image into drawables and you say we dont neet to this action and this library can detect normal and real size on all device. ok? for example if we set icons with wrap_content In fact we have really image​? thats right?

pishguy commented 9 years ago

​wrap_content detect automaticaly by android to attach correct image from drawables

JoanZapata commented 9 years ago

I'm not sure I understand what you're saying.

These icons are not images, they are special characters in a special font. They automatically take the size of the text in which they are used, no matter what screen density it's used on.

pishguy commented 9 years ago

we can not detect screen density in xml layout. then we must be use exactly size on xml such as 48sp. ok?

JoanZapata commented 9 years ago

Using 48sp will show the same physical size on screens with different density, that probably what you want, and this is the recommended way. If you want to depend on screen density, use 48px, also this is not recommended. I'm closing this issue.