Пример #1
0
  @Override
  public void onWeatherInfoUpdate(WeatherInfo weatherInfo) {
    TextView lblCurrentWindDirection =
        (TextView) getActivity().findViewById(R.id.lblCurrentWindDirection);
    TextView lblCurrentWindSpeed = (TextView) getActivity().findViewById(R.id.lblCurrentWindSpeed);
    CompassView compassView = (CompassView) getActivity().findViewById(R.id.compassView);

    if (weatherInfo != null) {
      lblCurrentWindDirection.setText(
          getLocalizedWindDirection(weatherInfo.getWindDirectionString()));
      lblCurrentWindSpeed.setText(String.format("%s km/h", weatherInfo.getWindSpeed()));
      compassView.updateWindDirection(weatherInfo.getWindDirection());
    } else {
      lblCurrentWindDirection.setText(getString(R.string.noData));
      lblCurrentWindSpeed.setText(getString(R.string.noData));
    }

    setReloadingState(false);
  }
Пример #2
0
  @Override
  public void onAzimutUpdate(float azimut) {
    if (_titleLabel != null) {
      _titleLabel.setText(String.valueOf(azimut));
    }

    if (_compassView != null) {
      _compassView.updateAzimut(azimut);
    }
  }