-
Notifications
You must be signed in to change notification settings - Fork 851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How display icon by ID and Code? #204
Comments
|
Are you sure that there is only this way? So then we need a json array with all data to compare status codes or anything that it make possible to add icons via code. |
This isn't the only way, but it is one way. You return the class for the weather icon with the input weather code, and you apply the class to some element to display it. Ideally you already have all weather codes in a json array from whatever weather API you using. Here is what I use for Yahoo Weather:
And how I set the icon:
|
Looks like a hackable way of doing so. |
and
Will do the trick. EG Open Weather:
|
Do you have a java or kotlin example? |
getDayNight function missed
|
I not find any more information to display icon from Open Weather API code like 09d or id like 300.
{"coord":{"lon":-0.13,"lat":51.51},"weather":[{"id":300,"main":"Drizzle","description":"light intensity drizzle","icon":"09d"}],"base":"stations","main":{"temp":280.32,"pressure":1012,"humidity":81,"temp_min":279.15,"temp_max":281.15},"visibility":10000,"wind":{"speed":4.1,"deg":80},"clouds":{"all":90},"dt":1485789600,"sys":{"type":1,"id":5091,"message":0.0103,"country":"GB","sunrise":1485762037,"sunset":1485794875},"id":2643743,"name":"London","cod":200}
The text was updated successfully, but these errors were encountered: