File tree Expand file tree Collapse file tree
app/src/main/java/com/asad/weatherapp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ import com.asad.weatherapp.domain.model.forecast.WeatherCondition
66import com.asad.weatherapp.domain.model.forecast.WeatherForecastModel
77import com.asad.weatherapp.domain.model.forecast.WeatherForecastTimeSlotModel
88import com.asad.weatherapp.domain.model.forecast.WeatherType
9+ import com.asad.weatherapp.utils.CLOUDS
10+ import com.asad.weatherapp.utils.RAIN
911import com.asad.weatherapp.utils.getDayName
1012import javax.inject.Inject
1113
@@ -44,8 +46,8 @@ class WeatherForecastMapper @Inject constructor() :
4446
4547 private fun mapToWeatherType (type : String ): WeatherType =
4648 when {
47- type.equals(" Rain " , ignoreCase = true ) -> WeatherType .RAINY
48- type.equals(" Clouds " , ignoreCase = true ) -> WeatherType .CLOUDY
49+ type.equals(RAIN , ignoreCase = true ) -> WeatherType .RAINY
50+ type.equals(CLOUDS , ignoreCase = true ) -> WeatherType .CLOUDY
4951 else -> WeatherType .SUNNY
5052 }
5153
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import com.asad.weatherapp.domain.repository.LocationCoordinatesRepository
55import javax.inject.Inject
66
77class LocationCoordinatesUseCase @Inject constructor(
8- val locationCoordinatesRepository : LocationCoordinatesRepository
8+ private val locationCoordinatesRepository : LocationCoordinatesRepository
99) {
1010 suspend operator fun invoke (): Result <LocationCoordinates > = locationCoordinatesRepository.getCurrentLocation()
1111}
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ fun PermissionHandler(
129129}
130130
131131@Composable
132- fun PermissionDeniedUI (
132+ private fun PermissionDeniedUI (
133133 onTapAgain : () -> Unit = {},
134134) {
135135 Box (
Original file line number Diff line number Diff line change @@ -3,4 +3,6 @@ package com.asad.weatherapp.utils
33
44const val LATITUDE = " lat"
55const val LONGITUDE = " lon"
6- const val APP_ID = " appid"
6+ const val APP_ID = " appid"
7+ const val RAIN = " Rain"
8+ const val CLOUDS = " Clouds"
Original file line number Diff line number Diff line change 11package com.asad.weatherapp.utils
22
3+ import androidx.annotation.StringRes
4+
35interface ResourceProvider {
4- fun getString (resId : Int , vararg args : Any ): String
6+ fun getString (@StringRes resId : Int , vararg args : Any ): String
57}
You can’t perform that action at this time.
0 commit comments