-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from wednesday-solutions/open-weather-api
Gradle upgrade, Compose Dependencies and Switch Weather API
Showing
137 changed files
with
2,287 additions
and
1,323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,5 +32,4 @@ class AndroidTemplateApplication : Application() { | |
) | ||
} | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
buildscript { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
classpath(Dependencies.Android.gradlePlugin) | ||
classpath(Dependencies.Google.services) | ||
classpath(Dependencies.Kotlin.gradlePlugin) | ||
classpath(Dependencies.Kotlin.serializationPlugin) | ||
classpath(Dependencies.Android.navigationSafeArgsPlugin) | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
|
||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
} | ||
} | ||
|
||
// TODO: Remove once ExperimentalCoroutinesApi: runTest is stable | ||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach { | ||
kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
object Dependencies { | ||
|
||
object Compose { | ||
const val activity = "androidx.activity:activity-compose:${Versions.activityCompose}" | ||
const val material = "androidx.compose.material:material:${Versions.compose}" | ||
const val materialIconCore = | ||
"androidx.compose.material:material-icons-core:${Versions.compose}" | ||
const val materialIconExtended = | ||
"androidx.compose.material:material-icons-extended:${Versions.compose}" | ||
const val foundation = "androidx.compose.foundation:foundation:${Versions.compose}" | ||
const val runtime = "androidx.compose.runtime:runtime:${Versions.compose}" | ||
const val liveData = "androidx.compose.runtime:runtime-livedata:${Versions.compose}" | ||
const val animation = "androidx.compose.animation:animation:${Versions.compose}" | ||
const val uiTooling = "androidx.compose.ui:ui-tooling:${Versions.compose}" | ||
const val viewModel = | ||
"androidx.lifecycle:lifecycle-viewmodel-compose:${Versions.lifecycleViewModelCompose}" | ||
const val uiTest = "androidx.compose.ui:ui-test-junit4:${Versions.compose}" | ||
} | ||
|
||
object Room { | ||
const val runtime = "androidx.room:room-runtime:${Versions.room}" | ||
const val ktx = "androidx.room:room-ktx:${Versions.room}" | ||
const val compiler = "androidx.room:room-compiler:${Versions.room}" | ||
} | ||
|
||
object Kotlin { | ||
const val stdLib = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}" | ||
const val serialization = | ||
"org.jetbrains.kotlinx:kotlinx-serialization-json:${Versions.kotlinxSerialization}" | ||
const val gradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}" | ||
const val serializationPlugin = "org.jetbrains.kotlin:kotlin-serialization:${Versions.kotlin}" | ||
} | ||
|
||
object Coroutines { | ||
const val core = | ||
"org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.coroutines}" | ||
const val android = | ||
"org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.coroutines}" | ||
} | ||
|
||
object Koin { | ||
const val core = "io.insert-koin:koin-core:${Versions.koin}" | ||
const val android = "io.insert-koin:koin-android:${Versions.koin}" | ||
const val workManager = "io.insert-koin:koin-androidx-workmanager:${Versions.koin}" | ||
const val test = "io.insert-koin:koin-test:${Versions.koin}" | ||
const val navigation = "io.insert-koin:koin-androidx-navigation:${Versions.koin}" | ||
const val compose = "io.insert-koin:koin-androidx-compose:${Versions.koin}" | ||
} | ||
|
||
object Material { | ||
const val material = "com.google.android.material:material:${Versions.material}" | ||
} | ||
|
||
object Google { | ||
const val services = "com.google.gms:google-services:${Versions.googleServices}" | ||
} | ||
|
||
object Android { | ||
const val gradlePlugin = "com.android.tools.build:gradle:${Versions.androidGradlePlugin}" | ||
const val coreKtx = "androidx.core:core-ktx:${Versions.core}" | ||
const val fragment = "androidx.fragment:fragment:${Versions.fragment}" | ||
const val appCompat = "androidx.appcompat:appcompat:${Versions.appCompat}" | ||
const val constraintLayout = | ||
"androidx.constraintlayout:constraintlayout:${Versions.constraintLayout}" | ||
const val recyclerView = | ||
"androidx.recyclerview:recyclerview:${Versions.recyclerView}" | ||
const val lifecycleCompiler = | ||
"androidx.lifecycle:lifecycle-compiler:${Versions.lifecycle}" | ||
const val recyclerViewSelection = | ||
"androidx.recyclerview:recyclerview-selection:${Versions.recyclerViewSelection}" | ||
const val lifecycleLiveDataCore = | ||
"androidx.lifecycle:lifecycle-livedata-core:${Versions.lifecycle}" | ||
const val lifecycleLiveDataKtx = | ||
"androidx.lifecycle:lifecycle-livedata-ktx:${Versions.lifecycle}" | ||
const val lifecycleViewModelKtx = | ||
"androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.lifecycle}" | ||
const val lifecycleViewModel = | ||
"androidx.lifecycle:lifecycle-viewmodel:${Versions.lifecycle}" | ||
const val lifecycleRuntimeKtx = | ||
"androidx.lifecycle:lifecycle-runtime-ktx:${Versions.lifecycle}" | ||
const val navigationFragment = | ||
"androidx.navigation:navigation-fragment-ktx:${Versions.nav}" | ||
const val navigationUi = "androidx.navigation:navigation-ui-ktx:${Versions.nav}" | ||
const val navigationSafeArgsPlugin = "androidx.navigation:navigation-safe-args-gradle-plugin:${Versions.nav}" | ||
const val splashScreen = "androidx.core:core-splashscreen:${Versions.splash}" | ||
} | ||
|
||
object Retrofit { | ||
const val core = "com.squareup.retrofit2:retrofit:${Versions.retrofit}" | ||
const val serialization = | ||
"com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:${Versions.retrofitKotlinxSerializationConverter}" | ||
const val logging = | ||
"com.squareup.okhttp3:logging-interceptor:${Versions.retrofitLoggingInterceptor}" | ||
} | ||
|
||
object Logging { | ||
const val timber = "com.jakewharton.timber:timber:${Versions.timber}" | ||
const val chucker = "com.github.chuckerteam.chucker:library:${Versions.chucker}" | ||
} | ||
|
||
object Image { | ||
const val coil = "io.coil-kt:coil:${Versions.coil}" | ||
} | ||
|
||
object Test { | ||
const val androidxTestCore = "androidx.test:runner:1.3.0" | ||
const val androidxArchCore = "androidx.arch.core:core-testing:2.1.0" | ||
const val androidxTestRunner = "androidx.test:runner:1.3.0" | ||
const val androidxTestRules = "androidx.test:rules:1.3.0" | ||
const val androidxExt = "androidx.test.ext:junit:1.1.2" | ||
const val androidxCoreTesting = "androidx.arch.core:core-testing:2.1.0" | ||
const val androidxRoomTesting = "androidx.room:room-testing:2.2.5" | ||
const val junit = "junit:junit:4.13.2" | ||
const val coroutines = | ||
"org.jetbrains.kotlinx:kotlinx-coroutines-test:${Versions.coroutines}" | ||
const val flowTest = "app.cash.turbine:turbine:${Versions.turbine}" | ||
const val kotlinTest = "org.jetbrains.kotlin:kotlin-test:${Versions.kotlin}" | ||
const val mockito = "org.mockito.kotlin:mockito-kotlin:3.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
object Versions { | ||
const val androidGradlePlugin = "7.2.0" | ||
const val googleServices = "4.3.10" | ||
const val compose = "1.1.1" | ||
const val activityCompose = "1.4.0" | ||
const val lifecycleViewModelCompose = "2.4.1" | ||
const val kotlin = "1.6.10" | ||
const val kotlinxSerialization = "1.3.2" | ||
const val ktlint = "0.45.2" | ||
const val coroutines = "1.6.1" | ||
const val koin = "3.2.0-beta-1" | ||
const val fragment = "1.3.5" | ||
const val lifecycle = "2.4.1" | ||
const val core = "1.7.0" | ||
const val jUnit = "4.12" | ||
const val androidxTest = "1.4.0" | ||
const val retrofit = "2.9.0" | ||
const val nav = "2.4.2" | ||
const val room = "2.4.2" | ||
const val splash = "1.0.0-beta02" | ||
const val material = "1.6.0" | ||
const val appCompat = "1.4.1" | ||
const val constraintLayout = "2.0.4" | ||
const val recyclerView = "1.2.1" | ||
const val recyclerViewSelection = "1.2.0-alpha01" | ||
const val retrofitKotlinxSerializationConverter = "0.8.0" | ||
const val retrofitLoggingInterceptor = "4.9.3" | ||
const val timber = "5.0.1" | ||
const val chucker = "3.5.2" | ||
const val turbine = "0.8.0" | ||
const val coil = "2.1.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
domain-entity/src/main/java/com/wednesday/template/domain/weather/DayWeather.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 9 additions & 13 deletions
22
domain-impl/src/test/java/com/wednesday/template/domain/weather/models/WeatherTestModels.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
package com.wednesday.template.domain.weather.models | ||
|
||
import com.wednesday.template.domain.date.Date | ||
import com.wednesday.template.domain.weather.DayWeather | ||
import com.wednesday.template.domain.weather.Weather | ||
|
||
val weather = Weather( | ||
title = "title 1", | ||
woeid = 1, | ||
dayWeatherList = listOf( | ||
DayWeather( | ||
minTemp = 22, | ||
maxTemp = 32, | ||
temp = 30, | ||
date = Date(1, 1, 1970), | ||
isToday = false | ||
) | ||
) | ||
title = "Pune, IN", | ||
description = "description 1", | ||
lat = 10.10, | ||
lon = 30.55, | ||
minTemp = 22.03, | ||
maxTemp = 31.39, | ||
temp = 26.82, | ||
feelsLike = 28.0, | ||
iconUrl = "https://openweathermap.org/img/wn/01d@4x.png" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
domain/src/main/java/com/wednesday/template/domain/base/BaseSuspendUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
domain/src/main/java/com/wednesday/template/domain/base/BaseUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
...l/src/main/java/com/wednesday/template/interactor/weather/favourite/UIDayWeatherMapper.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# This is a skeleton file. All all the properties here to your local.properties file. | ||
OPEN_WEATHER_API_KEY="Your api key" | ||
DEBUG_OPEN_WEATHER_API_KEY="Your api key" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 27 additions & 20 deletions
47
...rc/main/java/com/wednesday/template/presentation/weather/home/list/UIWeatherViewHolder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,45 @@ | ||
package com.wednesday.template.presentation.weather.home.list | ||
|
||
import com.wednesday.template.presentation.base.UIListItemBase | ||
import coil.load | ||
import coil.transform.CircleCropTransformation | ||
import com.wednesday.template.presentation.base.extensions.setUIText | ||
import com.wednesday.template.presentation.base.intent.Intent | ||
import com.wednesday.template.presentation.base.list.viewholder.BaseNestedListViewHolder | ||
import com.wednesday.template.presentation.base.list.viewholder.BaseViewHolder | ||
import com.wednesday.template.presentation.weather.UIWeather | ||
import com.wednesday.template.resources.databinding.ItemWeatherBinding | ||
import kotlinx.coroutines.channels.Channel | ||
|
||
class UIWeatherViewHolder(private val binding: ItemWeatherBinding) : | ||
BaseNestedListViewHolder<UIWeather>(binding) { | ||
|
||
init { | ||
addRenderer(UIDayWeatherHeadingRenderer()) | ||
addRenderer(UIDayWeatherRenderer()) | ||
} | ||
|
||
override fun getNestedListItems(item: UIWeather): List<UIListItemBase> { | ||
return item.dayWeatherList | ||
} | ||
BaseViewHolder<UIWeather>(binding) { | ||
|
||
override fun onSetupIntents(intentChannel: Channel<Intent>) = Unit | ||
|
||
override fun onBindInternal() { | ||
super.onBindInternal() | ||
binding.run { | ||
override fun onBindInternal() = binding.run { | ||
compareAndSet({ title }) { | ||
cityName.setUIText(it) | ||
} | ||
|
||
compareAndSet({ title }) { | ||
cityName.setUIText(it) | ||
compareAndSet({ iconUrl }) { | ||
weatherIcon.load(it) { | ||
crossfade(true) | ||
transformations(CircleCropTransformation()) | ||
} | ||
} | ||
|
||
compareAndSet({ currentTemp }) { | ||
cityTemp.setUIText(it) | ||
} | ||
compareAndSet({ currentTemp }) { | ||
cityTemp.setUIText(it) | ||
} | ||
|
||
compareAndSet({ feelsLike }) { | ||
feelsLike.setUIText(it) | ||
} | ||
|
||
compareAndSet({ minMaxTemp }) { | ||
minMaxTemp.setUIText(it) | ||
} | ||
|
||
compareAndSet({ description }) { | ||
description.setUIText(it) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
repo-impl/src/main/java/com/wednesday/template/repo/weather/DomainDayWeatherMapper.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
repo-impl/src/main/java/com/wednesday/template/repo/weather/LocalDayWeatherMapper.kt
This file was deleted.
Oops, something went wrong.
76 changes: 66 additions & 10 deletions
76
repo-impl/src/main/java/com/wednesday/template/repo/weather/LocalWeatherMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
...-impl/src/test/java/com/wednesday/template/repo/weather/DomainDayWeatherMapperImplTest.kt
This file was deleted.
Oops, something went wrong.
25 changes: 6 additions & 19 deletions
25
repo-impl/src/test/java/com/wednesday/template/repo/weather/DomainWeatherMapperImplTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,29 @@ | ||
package com.wednesday.template.repo.weather | ||
|
||
import com.wednesday.template.repo.weather.models.dayWeatherMapperFromLocalDayWeather | ||
import com.wednesday.template.repo.weather.models.localCityWithWeather | ||
import com.wednesday.template.repo.weather.models.localDayWeather | ||
import com.wednesday.template.repo.weather.models.weatherMappedFromLocalCityWithWeather | ||
import com.wednesday.template.repo.weather.models.localWeather | ||
import com.wednesday.template.repo.weather.models.weather | ||
import org.junit.Before | ||
import org.junit.Test | ||
import org.mockito.kotlin.mock | ||
import org.mockito.kotlin.times | ||
import org.mockito.kotlin.verify | ||
import org.mockito.kotlin.whenever | ||
import kotlin.test.assertEquals | ||
|
||
class DomainWeatherMapperImplTest { | ||
|
||
private lateinit var domainDayWeatherMapper: DomainDayWeatherMapper | ||
private lateinit var domainWeatherMapper: DomainWeatherMapperImpl | ||
|
||
@Before | ||
fun setUp() { | ||
domainDayWeatherMapper = mock() | ||
domainWeatherMapper = DomainWeatherMapperImpl(domainDayWeatherMapper) | ||
domainWeatherMapper = DomainWeatherMapperImpl() | ||
} | ||
|
||
@Test | ||
fun `Given LocalCityWithWeather, When map is called, Then Weather is returned with correct data`() { | ||
// Given | ||
val localCityWithWeather = localCityWithWeather | ||
val localDayWeather = localDayWeather | ||
whenever(domainDayWeatherMapper.map(listOf(localDayWeather))).thenReturn( | ||
listOf(dayWeatherMapperFromLocalDayWeather) | ||
) | ||
val currentWeather = localWeather | ||
|
||
// When | ||
val result = domainWeatherMapper.map(localCityWithWeather) | ||
val result = domainWeatherMapper.map(currentWeather) | ||
|
||
// Then | ||
assertEquals(expected = weatherMappedFromLocalCityWithWeather, actual = result) | ||
verify(domainDayWeatherMapper, times(1)).map(listOf(localDayWeather)) | ||
assertEquals(expected = weather, actual = result) | ||
} | ||
} |
Oops, something went wrong.