Created
August 28, 2015 13:01
-
-
Save survivingwithandroid/2f33d2d71a8744825b2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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