Skip to content

Instantly share code, notes, and snippets.

@ar-android
Created December 13, 2017 00:57
Show Gist options
  • Save ar-android/c79a82e47339e96d2bc6573e254a76e0 to your computer and use it in GitHub Desktop.
Save ar-android/c79a82e47339e96d2bc6573e254a76e0 to your computer and use it in GitHub Desktop.
val forecastday = response.forecast.forecastday
val data = weather {
currentDegrees = response.current.temp_c.toString()
currentLocation = response.location.name
forecast {
dayName = forecastday[0].date.toDay()
degrees = forecastday[0].day.avgtemp_c.toString()
}
forecast {
dayName = forecastday[1].date.toDay()
degrees = forecastday[1].day.avgtemp_c.toString()
}
forecast {
dayName = forecastday[2].date.toDay()
degrees = forecastday[2].day.avgtemp_c.toString()
}
forecast {
dayName = forecastday[3].date.toDay()
degrees = forecastday[3].day.avgtemp_c.toString()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment