Weather widget: hide humidity if value is -1

This commit is contained in:
MM20 2022-01-29 17:23:11 +01:00
parent 7b6ff6e6eb
commit 97e714acf4
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -158,10 +158,12 @@ fun CurrentWeather(forecast: Forecast, imperialUnits: Boolean) {
Column(
modifier = Modifier.fillMaxWidth()
) {
WeatherDetailRow(
title = stringResource(id = R.string.weather_humidity),
value = "${forecast.humidity.roundToInt()} %"
)
if (forecast.humidity >= 0) {
WeatherDetailRow(
title = stringResource(id = R.string.weather_humidity),
value = "${forecast.humidity.roundToInt()} %"
)
}
WeatherDetailRow(
title = stringResource(id = R.string.weather_wind),
value = formatWindSpeed(imperialUnits, forecast)