Exemplo n.º 1
0
  protected void runWeatherUpdate() {
    LoadingListener<WeatherForecast> listener =
        new LoadingListener<WeatherForecast>() {
          @Override
          public void onLoaded(WeatherForecast result) {
            updateWeatherInfo(result);
          }

          @Override
          public void notifyStart() {
            OWAnimationUtils.startRotation(ivRefreshIndicator);
            String locationName = mConfiguration.getLocationName();
            locationName = (locationName == null) ? "" : locationName;
            tvLocationName.setText(locationName);

            updateLayout.setVisibility(View.VISIBLE);
          }

          @Override
          public void notifyStop() {
            ivRefreshIndicator.clearAnimation();
            updateLayout.setVisibility(View.GONE);
          }
        };

    dataManager.runUpdate(listener);
  }
Exemplo n.º 2
0
 @Override
 public void onResume() {
   super.onResume();
   dataManager.getWeatherForecast(listener);
 }