diff --git a/app/src/main/java/com/appttude/h_mal/atlas_weather/data/WeatherSource.kt b/app/src/main/java/com/appttude/h_mal/atlas_weather/data/WeatherSource.kt index 2e3c108..b00d6ec 100644 --- a/app/src/main/java/com/appttude/h_mal/atlas_weather/data/WeatherSource.kt +++ b/app/src/main/java/com/appttude/h_mal/atlas_weather/data/WeatherSource.kt @@ -5,7 +5,6 @@ import com.appttude.h_mal.atlas_weather.data.repository.Repository import com.appttude.h_mal.atlas_weather.data.room.entity.CURRENT_LOCATION import com.appttude.h_mal.atlas_weather.data.room.entity.EntityItem import com.appttude.h_mal.atlas_weather.model.types.LocationType -import com.appttude.h_mal.atlas_weather.model.types.UnitType import com.appttude.h_mal.atlas_weather.model.weather.FullWeather import com.appttude.h_mal.atlas_weather.utils.getSymbol import java.io.IOException @@ -34,8 +33,10 @@ class WeatherSource( } @Throws(IOException::class) - suspend fun forceFetchWeather(latLon: Pair, - locationType: LocationType = LocationType.Town): FullWeather { + suspend fun forceFetchWeather( + latLon: Pair, + locationType: LocationType = LocationType.Town + ): FullWeather { // get data from database val weatherEntity = repository.loadSingleCurrentWeatherFromRoom(CURRENT_LOCATION) // check unit type - if same do nothing diff --git a/app/src/main/java/com/appttude/h_mal/atlas_weather/data/network/networkUtils/RetrofitComponents.kt b/app/src/main/java/com/appttude/h_mal/atlas_weather/data/network/networkUtils/RetrofitComponents.kt index 6f53d94..84e96b7 100644 --- a/app/src/main/java/com/appttude/h_mal/atlas_weather/data/network/networkUtils/RetrofitComponents.kt +++ b/app/src/main/java/com/appttude/h_mal/atlas_weather/data/network/networkUtils/RetrofitComponents.kt @@ -51,7 +51,7 @@ fun createRetrofit( return Retrofit.Builder() .client(okHttpClient) .baseUrl(baseUrl) - .addConverterFactory(GsonConverterFactory.create()) + .addConverterFactory(createGsonConverterFactory()) .build() .create(service) } \ No newline at end of file diff --git a/app/src/main/java/com/appttude/h_mal/atlas_weather/model/weather/DailyWeather.kt b/app/src/main/java/com/appttude/h_mal/atlas_weather/model/weather/DailyWeather.kt index f4475f8..04dc07d 100644 --- a/app/src/main/java/com/appttude/h_mal/atlas_weather/model/weather/DailyWeather.kt +++ b/app/src/main/java/com/appttude/h_mal/atlas_weather/model/weather/DailyWeather.kt @@ -58,7 +58,7 @@ data class DailyWeather( days.sunsetEpoch, days.tempmin, days.tempmax, - days.temp?.toDouble(), + days.temp, days.feelslike, days.pressure?.toInt(), days.humidity?.toInt(), @@ -72,7 +72,7 @@ data class DailyWeather( days.conditions, days.datetimeEpoch, days.cloudcover?.toInt(), - days.precipprob?.toDouble(), + days.precipprob, days.uvindex?.toDouble(), days.precip?.toDouble() )