diff --git a/app/build.gradle b/app/build.gradle index 0b1e4e4..09add95 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -85,4 +85,5 @@ dependencies { // Room implementation "androidx.room:room-runtime:2.4.3" kapt "androidx.room:room-compiler:2.4.3" + implementation "androidx.room:room-ktx:2.4.3" } \ No newline at end of file diff --git a/app/src/main/java/com/hasan/weatherapp/data/database/Converters.kt b/app/src/main/java/com/hasan/weatherapp/data/database/Converters.kt new file mode 100644 index 0000000..1cea3b4 --- /dev/null +++ b/app/src/main/java/com/hasan/weatherapp/data/database/Converters.kt @@ -0,0 +1,65 @@ +package com.hasan.weatherapp.data.database + +import androidx.room.ProvidedTypeConverter +import androidx.room.TypeConverter +import com.hasan.weatherapp.data.util.JsonParser +import com.hasan.weatherapp.domain.weather.WeatherData +import com.hasan.weatherapp.domain.weather.WeatherType + +import com.squareup.moshi.Types +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +@ProvidedTypeConverter +class Converters( + private val jsonParser: JsonParser +) { +// @TypeConverter +// fun fromWeatherDataJson(json: String): Map>? { +// return jsonParser.fromJson( +// json, +// Types.newParameterizedType(MutableMap::class.java,Int::class.java, +// Types.newParameterizedType(ArrayList::class.java, WeatherEntity::class.javaObjectType)))?: emptyMap() +// } +// +// // TODO: maybe just fuckin remove the map since the list works so we loop and insert all of the map interies and each will be diffrant using time +// @TypeConverter +// fun fromWeatherDataJson(map: Map>): String { +// return jsonParser.toJson( +// map, +// Types.newParameterizedType(MutableMap::class.java,Int::class.java, +// Types.newParameterizedType(ArrayList::class.java, WeatherEntity::class.javaObjectType))) ?: "[]" +// } + + +// +// @TypeConverter +// fun toMWeatherDataJson(weatherData: List): String { +// return jsonParser.toJson( +// weatherData, +// Types.newParameterizedType(List::class.java, WeatherEntity::class.javaObjectType) +// ) ?: "[]" +// } + + @TypeConverter + fun fromWeatherTypeNumber(num: Int): WeatherType { + return WeatherType.fromWMO(num) + } + + @TypeConverter + fun toMWeatherDataNumber(weathertype: WeatherType): Int { + return weathertype.code + } + + @TypeConverter + fun fromLocalDateTimeString(str: String): LocalDateTime { + return LocalDateTime.parse(str, DateTimeFormatter.ISO_DATE_TIME) + } + + @TypeConverter + fun toLocalDateTimeString(localDateTime: LocalDateTime): String { + return localDateTime.toString() + } + + +} \ No newline at end of file diff --git a/app/src/main/java/com/hasan/weatherapp/data/database/WeatherDao.kt b/app/src/main/java/com/hasan/weatherapp/data/database/WeatherDao.kt new file mode 100644 index 0000000..1378e51 --- /dev/null +++ b/app/src/main/java/com/hasan/weatherapp/data/database/WeatherDao.kt @@ -0,0 +1,29 @@ +package com.hasan.weatherapp.data.database + +import androidx.room.Dao +import androidx.room.Insert +import androidx.room.MapInfo +import androidx.room.OnConflictStrategy +import androidx.room.Query + +import com.hasan.weatherapp.domain.weather.WeatherData +import kotlinx.coroutines.flow.Flow +import java.time.LocalDateTime + +@Dao +interface WeatherDao { + + @Insert(onConflict = OnConflictStrategy.REPLACE) + suspend fun insertWeatherInfos(infos: WeatherData) + +// @Query("DELETE FROM WeatherData WHERE time IN(:time)") +// suspend fun deletetWeatherInfos(time: LocalDateTime) + + @Query("DELETE FROM WeatherData") + suspend fun deletetWeatherInfo() + +// @Query("SELECT * FROM WeatherData WHERE time LIKE '%' || :time || '%'") +// suspend fun gettWeatherInfos(time: LocalDateTime): List + @Query("SELECT * FROM WeatherData ") + fun gettWeatherInfos(): Flow> +} \ No newline at end of file diff --git a/app/src/main/java/com/hasan/weatherapp/data/database/WeatherDatabase.kt b/app/src/main/java/com/hasan/weatherapp/data/database/WeatherDatabase.kt new file mode 100644 index 0000000..82c62af --- /dev/null +++ b/app/src/main/java/com/hasan/weatherapp/data/database/WeatherDatabase.kt @@ -0,0 +1,16 @@ +package com.hasan.weatherapp.data.database + +import androidx.room.Database +import androidx.room.RoomDatabase +import androidx.room.TypeConverters +import com.hasan.weatherapp.domain.weather.WeatherData + +@Database( + entities = [WeatherData::class], + version = 1 +) +@TypeConverters(Converters::class) +abstract class WeatherDatabase: RoomDatabase() { + + abstract val dao: WeatherDao +} \ No newline at end of file diff --git a/app/src/main/java/com/hasan/weatherapp/data/database/entity/WeatherEntity.kt b/app/src/main/java/com/hasan/weatherapp/data/database/entity/WeatherEntity.kt new file mode 100644 index 0000000..fd57385 --- /dev/null +++ b/app/src/main/java/com/hasan/weatherapp/data/database/entity/WeatherEntity.kt @@ -0,0 +1,31 @@ +package com.hasan.weatherapp.data.database.entity +// +// +//import androidx.room.Entity +//import androidx.room.PrimaryKey +//import com.hasan.weatherapp.domain.weather.WeatherData +//import com.hasan.weatherapp.domain.weather.WeatherType +//import java.time.LocalDateTime +// +//@Entity +//data class WeatherEntity( +// val time: LocalDateTime, +// val temperatureCelsius: Double, +// val pressure: Double, +// val windSpeed: Double, +// val humidity: Double, +// val weatherType: WeatherType, +// @PrimaryKey val id: Int? = null +//) { +// fun toWordInfo(): WeatherData { +// return WeatherData( +// time = time, +// temperatureCelsius = temperatureCelsius, +// pressure = pressure, +// windSpeed = windSpeed, +// humidity = humidity, +// weatherType = weatherType +// +// ) +// } +//} diff --git a/app/src/main/java/com/hasan/weatherapp/data/location/LocationTrackerImpl.kt b/app/src/main/java/com/hasan/weatherapp/data/location/LocationTrackerImpl.kt index 05db19d..5ac92ca 100644 --- a/app/src/main/java/com/hasan/weatherapp/data/location/LocationTrackerImpl.kt +++ b/app/src/main/java/com/hasan/weatherapp/data/location/LocationTrackerImpl.kt @@ -56,7 +56,7 @@ class LocationTrackerImpl @Inject constructor( // return@coroutineScope x // } - + return suspendCancellableCoroutine { continuation -> locationClient.getCurrentLocation(Priority.PRIORITY_HIGH_ACCURACY, object : CancellationToken() { @@ -68,8 +68,8 @@ class LocationTrackerImpl @Inject constructor( override fun isCancellationRequested(): Boolean { return false } - - }).addOnSuccessListener { location -> continuation.resume(location) } + } + ).addOnSuccessListener { location -> continuation.resume(location) } .addOnFailureListener { continuation.resume(null) } .addOnCanceledListener { continuation.cancel() } // locationClient.lastLocation.addOnSuccessListener { location -> @@ -82,7 +82,7 @@ class LocationTrackerImpl @Inject constructor( // .addOnCanceledListener { // continuation.cancel() // } - } + } } } \ No newline at end of file diff --git a/app/src/main/java/com/hasan/weatherapp/data/mapper/WeatherDataMapper.kt b/app/src/main/java/com/hasan/weatherapp/data/mapper/WeatherDataMapper.kt index df6214f..b5ca2f1 100644 --- a/app/src/main/java/com/hasan/weatherapp/data/mapper/WeatherDataMapper.kt +++ b/app/src/main/java/com/hasan/weatherapp/data/mapper/WeatherDataMapper.kt @@ -1,5 +1,6 @@ package com.hasan.weatherapp.data.mapper +import com.hasan.weatherapp.data.database.WeatherDao import com.hasan.weatherapp.data.remote.WeatherDataDto import com.hasan.weatherapp.data.remote.WeatherDto import com.hasan.weatherapp.domain.weather.WeatherData @@ -42,6 +43,54 @@ fun WeatherDto.toWeatherInfo(): WeatherInfo { } return WeatherInfo( weatherDataPerDay = weatherDataMap, - currentWeatherData = currentWeatherData + currentWeatherData = currentWeatherData, ) -} \ No newline at end of file +} + +//suspend fun WeatherDao.toWeatherInfo(): WeatherInfo { +// +// +//// return gettWeatherInfos().mapIndexed { index, weatherData -> +//// val temperature = gettWeatherInfos()[index].temperatureCelsius +//// val weatherCode = gettWeatherInfos()[index].weatherType +//// val windSpeed = gettWeatherInfos()[index].windSpeed +//// val pressure = gettWeatherInfos()[index].pressure +//// val humidity = gettWeatherInfos()[index].humidity +//// val time = gettWeatherInfos()[index].time +//// WeatherData( +//// time = LocalDateTime.parse(time, DateTimeFormatter.ISO_DATE_TIME), +//// temperatureCelsius = temperature, +//// pressure = pressure, +//// windSpeed = windSpeed, +//// humidity = humidity, +//// weatherType = WeatherType.fromWMO(weatherCode) +//// ) +//// }.groupBy { } +//// return time.mapIndexed { index, time -> +//// val temperature = temperatures[index] +//// val weatherCode = weatherCodes[index] +//// val windSpeed = windSpeeds[index] +//// val pressure = pressures[index] +//// val humidity = humidities[index] +//// WeatherData( +//// time = LocalDateTime.parse(time, DateTimeFormatter.ISO_DATE_TIME), +//// temperatureCelsius = temperature, +//// pressure = pressure, +//// windSpeed = windSpeed, +//// humidity = humidity, +//// weatherType = WeatherType.fromWMO(weatherCode) +//// ) +//// +//// }.groupBy { +//// it.time.dayOfMonth +//// } +//// +// +// val data = mapOf(Pair(LocalDateTime.now().dayOfMonth, gettWeatherInfos())) +// +// return WeatherInfo( +// currentWeatherDataListDB = data, +// currentWeatherData = null, +// weatherDataPerDay = null +// ) +//} \ No newline at end of file diff --git a/app/src/main/java/com/hasan/weatherapp/data/repository/RepositoryImpl.kt b/app/src/main/java/com/hasan/weatherapp/data/repository/RepositoryImpl.kt index 1846092..3dd98cf 100644 --- a/app/src/main/java/com/hasan/weatherapp/data/repository/RepositoryImpl.kt +++ b/app/src/main/java/com/hasan/weatherapp/data/repository/RepositoryImpl.kt @@ -1,25 +1,118 @@ package com.hasan.weatherapp.data.repository +import android.content.ContentValues.TAG +import android.util.Log +import com.hasan.weatherapp.data.database.WeatherDatabase import com.hasan.weatherapp.data.mapper.toWeatherInfo import com.hasan.weatherapp.data.remote.WeatherApi import com.hasan.weatherapp.domain.repository.WeatherRepository import com.hasan.weatherapp.domain.util.Resource +import com.hasan.weatherapp.domain.weather.WeatherData import com.hasan.weatherapp.domain.weather.WeatherInfo +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.coroutineScope +import kotlinx.coroutines.flow.collectIndexed +import kotlinx.coroutines.flow.first +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext +import java.time.LocalDate +import java.time.LocalDateTime import javax.inject.Inject class RepositoryImpl @Inject constructor( - val weatherApi: WeatherApi + val weatherApi: WeatherApi, + val weatherDatabase: WeatherDatabase ) : WeatherRepository { + val dao = weatherDatabase.dao + val now = LocalDateTime.now() + val dayOfMonth = LocalDate.now().dayOfMonth + + private suspend fun WeatherDataFromDb(): WeatherInfo = withContext(Dispatchers.IO){ + + val weatherdataMap = dao.gettWeatherInfos().first().groupBy { it.time.dayOfMonth} + + val currentWeatherData = weatherdataMap[dayOfMonth]?.find { + val hour = if(now.minute < 30) now.hour else now.hour + 1 + it.time.hour == hour + } + return@withContext WeatherInfo( + weatherDataPerDay = weatherdataMap, + currentWeatherData= currentWeatherData + ) + + } + + private suspend fun WeatherDataFromApi(lat: Double, long: Double): WeatherInfo = withContext(Dispatchers.IO){ + + return@withContext weatherApi.getWeatherData(lat = lat, long = long).toWeatherInfo() + } + override suspend fun getWeatherInfo(lat: Double, long: Double): Resource { return try { - Resource.Success( - data = weatherApi.getWeatherData(lat = lat, long = long).toWeatherInfo() - ) + if (WeatherDataFromDb().weatherDataPerDay?.isEmpty() == true){ + Log.d(TAG, "getWeatherInfo: hello") + val weatherDataApi = WeatherDataFromApi(lat = lat, long = long) + weatherDataApi.weatherDataPerDay?.forEach { + it.value.forEach { + //Log.d(TAG, "api: ${it}") + dao.insertWeatherInfos(it) + } + } + return Resource.Success( + data = weatherDataApi + ) + } else{ + return Resource.Success( + data = WeatherDataFromDb() + ) + } +// if (dao.gettWeatherInfos().isNotEmpty()){ +// val dataa = mapOf(Pair(LocalDateTime.now().dayOfMonth, dao.gettWeatherInfos())) +// +//// return Resource.Success( +//// data = WeatherInfo( +//// currentWeatherDataListDB = dataa, +//// currentWeatherData = null, +//// weatherDataPerDay = null +//// ) +//// ) +//// Log.d(TAG, "getWeatherInfo isNotEmpty") +// val dataDB = dao.gettWeatherInfos().size +// Log.d(TAG, "db: ${dataDB}") +// } + + //val dataApi = weatherApi.getWeatherData(lat = lat, long = long).toWeatherInfo() + //Log.d(TAG, "fromListToMap: ${fromListToMap().get(27)?.get(23)}") +// fromListToMap().forEach { +// Log.d(TAG, "fromListToMap: ${it}") +// } + + + + + +// dataApi.weatherDataPerDay?.forEach { +// it.value.forEach { +// //Log.d(TAG, "api: ${it}") +// dao.insertWeatherInfos(it) +// } +// } + +// coroutineScope { +// launch(Dispatchers.IO) { +// val x = dao.gettWeatherInfos().first().groupBy { it.time.dayOfMonth} +// Log.d(TAG, "getWeatherInfo: ${x.size}") +// x.forEach { Log.d(TAG, "getWeatherInfo: $it") } +// } +// } + + + }catch (e: Exception) { e.printStackTrace() - Resource.Error(e.message ?: "error occurred55555555555555555") + Resource.Error(e.message ?: "error occurred") } } diff --git a/app/src/main/java/com/hasan/weatherapp/data/util/JsonParser.kt b/app/src/main/java/com/hasan/weatherapp/data/util/JsonParser.kt new file mode 100644 index 0000000..e9d7bb6 --- /dev/null +++ b/app/src/main/java/com/hasan/weatherapp/data/util/JsonParser.kt @@ -0,0 +1,10 @@ +package com.hasan.weatherapp.data.util + +import java.lang.reflect.Type + +interface JsonParser { + + fun fromJson(json: String, type: Type): T? + + fun toJson(obj: T, type: Type): String? +} \ No newline at end of file diff --git a/app/src/main/java/com/hasan/weatherapp/data/util/MoshiParser.kt b/app/src/main/java/com/hasan/weatherapp/data/util/MoshiParser.kt new file mode 100644 index 0000000..15ef299 --- /dev/null +++ b/app/src/main/java/com/hasan/weatherapp/data/util/MoshiParser.kt @@ -0,0 +1,19 @@ +package com.hasan.weatherapp.data.util + + +import com.squareup.moshi.Moshi +import java.lang.reflect.Type + +class MoshiParser( + private val moshi: Moshi +): JsonParser { + + override fun fromJson(json: String, type: Type): T? { + return moshi.adapter(type).fromJson(json) + // return gson.fromJson(json, type) + } + + override fun toJson(obj: T, type: Type): String? { + return moshi.adapter(type).toJson(obj) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/hasan/weatherapp/di/AppModule.kt b/app/src/main/java/com/hasan/weatherapp/di/AppModule.kt index dcb0d68..15a96ed 100644 --- a/app/src/main/java/com/hasan/weatherapp/di/AppModule.kt +++ b/app/src/main/java/com/hasan/weatherapp/di/AppModule.kt @@ -1,9 +1,14 @@ package com.hasan.weatherapp.di import android.app.Application +import androidx.room.Room import com.google.android.gms.location.FusedLocationProviderClient import com.google.android.gms.location.LocationServices +import com.hasan.weatherapp.data.database.Converters +import com.hasan.weatherapp.data.database.WeatherDatabase import com.hasan.weatherapp.data.remote.WeatherApi +import com.hasan.weatherapp.data.util.MoshiParser +import com.squareup.moshi.Moshi import dagger.Module import dagger.Provides import dagger.hilt.InstallIn @@ -32,4 +37,16 @@ object AppModule { fun provideFusedLocationProviderClient(app: Application): FusedLocationProviderClient { return LocationServices.getFusedLocationProviderClient(app) } + + + + @Provides + @Singleton + fun provideWeatherDatabase(app: Application): WeatherDatabase { + return Room.databaseBuilder( + app, WeatherDatabase::class.java, "weather_db" + ).addTypeConverter(Converters(MoshiParser(Moshi.Builder().build()))) + .build() + } + } \ No newline at end of file diff --git a/app/src/main/java/com/hasan/weatherapp/domain/weather/WeatherData.kt b/app/src/main/java/com/hasan/weatherapp/domain/weather/WeatherData.kt index dd84915..9113d3d 100644 --- a/app/src/main/java/com/hasan/weatherapp/domain/weather/WeatherData.kt +++ b/app/src/main/java/com/hasan/weatherapp/domain/weather/WeatherData.kt @@ -1,12 +1,29 @@ package com.hasan.weatherapp.domain.weather +import androidx.room.Entity +import androidx.room.PrimaryKey + import java.time.LocalDateTime +@Entity data class WeatherData( val time: LocalDateTime, val temperatureCelsius: Double, val pressure: Double, val windSpeed: Double, val humidity: Double, - val weatherType: WeatherType -) + val weatherType: WeatherType, + @PrimaryKey(autoGenerate = true) + val id: Int? = null +) { +// fun toWeatherEntity(): WeatherEntity { +// return WeatherEntity( +// time = time, +// temperatureCelsius = temperatureCelsius, +// pressure = pressure, +// windSpeed = windSpeed, +// humidity = humidity, +// weatherType = weatherType +// ) +// } +} diff --git a/app/src/main/java/com/hasan/weatherapp/domain/weather/WeatherInfo.kt b/app/src/main/java/com/hasan/weatherapp/domain/weather/WeatherInfo.kt index 49b7e46..e62e82f 100644 --- a/app/src/main/java/com/hasan/weatherapp/domain/weather/WeatherInfo.kt +++ b/app/src/main/java/com/hasan/weatherapp/domain/weather/WeatherInfo.kt @@ -1,6 +1,7 @@ package com.hasan.weatherapp.domain.weather data class WeatherInfo( - val weatherDataPerDay: Map>, - val currentWeatherData: WeatherData? + val weatherDataPerDay: Map>?, + val currentWeatherData: WeatherData?, //now + ) diff --git a/app/src/main/java/com/hasan/weatherapp/domain/weather/WeatherType.kt b/app/src/main/java/com/hasan/weatherapp/domain/weather/WeatherType.kt index a6ab18d..59be873 100644 --- a/app/src/main/java/com/hasan/weatherapp/domain/weather/WeatherType.kt +++ b/app/src/main/java/com/hasan/weatherapp/domain/weather/WeatherType.kt @@ -4,114 +4,143 @@ import androidx.annotation.DrawableRes import com.hasan.weatherapp.R sealed class WeatherType( + val code: Int, val weatherDesc: String, @DrawableRes val iconRes: Int ) { object ClearSky : WeatherType( + code = 0, weatherDesc = "Clear sky", iconRes = R.drawable.ic_sunny ) object MainlyClear : WeatherType( + code = 1, weatherDesc = "Mainly clear", iconRes = R.drawable.ic_cloudy ) object PartlyCloudy : WeatherType( + code = 2, weatherDesc = "Partly cloudy", iconRes = R.drawable.ic_cloudy ) object Overcast : WeatherType( + code = 3, weatherDesc = "Overcast", iconRes = R.drawable.ic_cloudy ) object Foggy : WeatherType( + code = 45, weatherDesc = "Foggy", iconRes = R.drawable.ic_very_cloudy ) object DepositingRimeFog : WeatherType( + code = 48, weatherDesc = "Depositing rime fog", iconRes = R.drawable.ic_very_cloudy ) object LightDrizzle : WeatherType( + code = 51, weatherDesc = "Light drizzle", iconRes = R.drawable.ic_rainshower ) object ModerateDrizzle : WeatherType( + code = 53, weatherDesc = "Moderate drizzle", iconRes = R.drawable.ic_rainshower ) object DenseDrizzle : WeatherType( + code = 55, weatherDesc = "Dense drizzle", iconRes = R.drawable.ic_rainshower ) - object LightFreezingDrizzle : WeatherType( - weatherDesc = "Slight freezing drizzle", - iconRes = R.drawable.ic_snowyrainy - ) + object DenseFreezingDrizzle : WeatherType( + code = 57, weatherDesc = "Dense freezing drizzle", iconRes = R.drawable.ic_snowyrainy ) object SlightRain : WeatherType( + code = 61, weatherDesc = "Slight rain", iconRes = R.drawable.ic_rainy ) object ModerateRain : WeatherType( + code = 63, weatherDesc = "Rainy", iconRes = R.drawable.ic_rainy ) object HeavyRain : WeatherType( + code = 65, weatherDesc = "Heavy rain", iconRes = R.drawable.ic_rainy ) + object LightFreezingDrizzle : WeatherType( + code = 66, + weatherDesc = "Slight freezing drizzle", + iconRes = R.drawable.ic_snowyrainy + ) object HeavyFreezingRain: WeatherType( + code = 67, weatherDesc = "Heavy freezing rain", iconRes = R.drawable.ic_snowyrainy ) object SlightSnowFall: WeatherType( + code = 71, weatherDesc = "Slight snow fall", iconRes = R.drawable.ic_snowy ) object ModerateSnowFall: WeatherType( + code = 73, weatherDesc = "Moderate snow fall", iconRes = R.drawable.ic_heavysnow ) object HeavySnowFall: WeatherType( + code = 75, weatherDesc = "Heavy snow fall", iconRes = R.drawable.ic_heavysnow ) object SnowGrains: WeatherType( + code = 77, weatherDesc = "Snow grains", iconRes = R.drawable.ic_heavysnow ) object SlightRainShowers: WeatherType( + code = 80, weatherDesc = "Slight rain showers", iconRes = R.drawable.ic_rainshower ) object ModerateRainShowers: WeatherType( + code = 81, weatherDesc = "Moderate rain showers", iconRes = R.drawable.ic_rainshower ) object ViolentRainShowers: WeatherType( + code = 82, weatherDesc = "Violent rain showers", iconRes = R.drawable.ic_rainshower ) object SlightSnowShowers: WeatherType( + code = 85, weatherDesc = "Light snow showers", iconRes = R.drawable.ic_snowy ) object HeavySnowShowers: WeatherType( + code = 86, weatherDesc = "Heavy snow showers", iconRes = R.drawable.ic_snowy ) object ModerateThunderstorm: WeatherType( + code = 95, weatherDesc = "Moderate thunderstorm", iconRes = R.drawable.ic_thunder ) object SlightHailThunderstorm: WeatherType( + code = 96, weatherDesc = "Thunderstorm with slight hail", iconRes = R.drawable.ic_rainythunder ) object HeavyHailThunderstorm: WeatherType( + code = 99, weatherDesc = "Thunderstorm with heavy hail", iconRes = R.drawable.ic_rainythunder ) diff --git a/app/src/main/java/com/hasan/weatherapp/presentation/MainActivity.kt b/app/src/main/java/com/hasan/weatherapp/presentation/MainActivity.kt index e8b3987..877cc62 100644 --- a/app/src/main/java/com/hasan/weatherapp/presentation/MainActivity.kt +++ b/app/src/main/java/com/hasan/weatherapp/presentation/MainActivity.kt @@ -79,6 +79,7 @@ class MainActivity : ComponentActivity() { lifecycleScope.launch { viewModel.weatherState.collect { +// Log.d(TAG, "onCreate: ${it.weatherInfo?.currentWeatherDataListDB}") if(!it.Loading){ progressBar.visibility = View.INVISIBLE }