Setting the Weather Icon6:29 with Ken Alger
The Dark Sky service returns a string value representing the current weather icon. We need to customize our data model to convert this string representation into an icon provided by our designer.
case "rain": iconId = R.drawable.rain; break; case "snow": iconId = R.drawable.snow; break; case "sleet": iconId = R.drawable.sleet; break; case "wind": iconId = R.drawable.wind; break; case "fog": iconId = R.drawable.fog; break; case "cloudy": iconId = R.drawable.cloudy; break; case "partly-cloudy-day": iconId = R.drawable.partly_cloudy; break; case "partly-cloudy-night": iconId = R.drawable.cloudy_night; break;
You need to sign up for Treehouse in order to download course files.Sign up