Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save survivingwithandroid/2f33d2d71a8744825b2a to your computer and use it in GitHub Desktop.
Save survivingwithandroid/2f33d2d71a8744825b2a to your computer and use it in GitHub Desktop.
private void getWeather() {
weatherclient.getCurrentCondition(new WeatherRequest(currentCity.getId()),
new WeatherClient.WeatherEventListener() {
@Override
public void onWeatherRetrieved(CurrentWeather currentWeather) {
// We have the current weather now
// Update subtitle toolbar
toolbar.setSubtitle(currentWeather.weather.currentCondition.getDescr());
tempView.setText(String.format("%.0f",currentWeather.weather.temperature.getTemp()));
pressView.setText(String.valueOf(currentWeather.weather.currentCondition.getPressure()));
windView.setText(String.valueOf(currentWeather.weather.wind.getSpeed()));
humView.setText(String.valueOf(currentWeather.weather.currentCondition.getHumidity()));
weatherIcon.setImageResource(WeatherIconMapper.getWeatherResource(currentWeather.weather.currentCondition.getIcon(), currentWeather.weather.currentCondition.getWeatherId()));
setToolbarColor(currentWeather.weather.temperature.getTemp());
}
....
}
- See more at: http://www.survivingwithandroid.com/2014/11/develop-android-weather-app-with-material-design.html#sthash.6P5PXbk3.dpuf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment