erikflowers / weather-icons

215 Weather Themed Icons and CSS
https://github.com/erikflowers/weather-icons
6.92k stars 850 forks source link

Android: wind direction? #176

Open kpagcha opened 7 years ago

kpagcha commented 7 years ago

I am trying to use the wind direction icons, but they all share the same content element (f0b1), so how can I include them in my strings.xml file?

erikflowers commented 7 years ago

It is meant to use CSS transforms to rotate them. No idea how you would rotate them in a native app. Just apply a transform to the degree you need it? like 90 degrees would go from pointing upwards, to pointing to the right. But I have no idea how it works, that's just a guess.

kpagcha commented 7 years ago

Alright I figured out how to do it, using rotate animations with a duration of 0 (default):

RotateAnimation rotate = new RotateAnimation(0f, deg, Animation.RELATIVE_TO_SELF, 0.5f,
    Animation.RELATIVE_TO_SELF, 0.5f);
rotate.setFillAfter(true);
windIcon.setAnimation(rotate);
windIcon.setIcon(getActivity().getString(R.string.wind_icon));
olkunmustafa commented 7 years ago

Hi @kpagcha

I couldn't show icons in my Android app even though I write unicode text in my strings.xml files it is shown as "f07d". how did you solve this problem ?

Sujal1 commented 7 years ago

@olkunmustafa In your strings.xml, rewrite it as &#xf07d