Skip to content

Commit 5fc367a

Browse files
committed
update(deps)
1 parent 0b15f22 commit 5fc367a

File tree

8 files changed

+55
-30
lines changed

8 files changed

+55
-30
lines changed

.idea/codeStyles/Project.xml

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ apply plugin: 'com.android.application'
22
apply plugin: 'kotlin-android'
33

44
android {
5-
compileSdkVersion 29
6-
buildToolsVersion '29.0.3'
5+
compileSdkVersion 30
6+
buildToolsVersion '30.0.1'
77

88
defaultConfig {
99
applicationId "com.hoc.flowmvi"
1010
minSdkVersion 21
11-
targetSdkVersion 29
11+
targetSdkVersion 30
1212
versionCode 1
1313
versionName "1.0"
1414

@@ -41,35 +41,35 @@ dependencies {
4141
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
4242

4343
implementation 'androidx.appcompat:appcompat:1.3.0-alpha01'
44-
implementation 'androidx.core:core-ktx:1.4.0-alpha01'
45-
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
46-
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha03'
47-
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-rc01'
48-
implementation 'com.google.android.material:material:1.3.0-alpha01'
44+
implementation 'androidx.core:core-ktx:1.5.0-alpha01'
45+
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-rc1'
46+
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha05'
47+
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01'
48+
implementation 'com.google.android.material:material:1.3.0-alpha02'
4949

5050
// viewModelScope
51-
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0-alpha03'
51+
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0-alpha06'
5252

5353
// lifecycleScope
54-
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha03'
54+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha06'
5555

5656
// retrofit2
57-
implementation 'com.squareup.retrofit2:retrofit:2.8.1'
58-
implementation 'com.squareup.retrofit2:converter-moshi:2.8.1'
59-
implementation 'com.squareup.okhttp3:logging-interceptor:4.4.1'
57+
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
58+
implementation 'com.squareup.retrofit2:converter-moshi:2.9.0'
59+
implementation 'com.squareup.okhttp3:logging-interceptor:4.8.0'
6060

6161
// moshi
6262
implementation 'com.squareup.moshi:moshi-kotlin:1.9.2'
6363

6464
// coroutines
65-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.6'
66-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.6'
65+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8'
66+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.8'
6767

6868
// koin
69-
implementation 'org.koin:koin-androidx-viewmodel:2.1.5'
69+
implementation 'org.koin:koin-androidx-viewmodel:2.1.6'
7070

7171
// coil
72-
implementation 'io.coil-kt:coil:0.10.1'
72+
implementation 'io.coil-kt:coil:0.11.0'
7373

7474
testImplementation 'junit:junit:4.13'
7575
androidTestImplementation 'androidx.test.ext:junit:1.1.1'

app/src/main/java/com/hoc/flowmvi/App.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import kotlinx.coroutines.FlowPreview
99
import org.koin.android.ext.koin.androidContext
1010
import org.koin.android.ext.koin.androidLogger
1111
import org.koin.core.context.startKoin
12+
import org.koin.core.logger.Level
1213

1314
@Suppress("unused")
1415
@FlowPreview
@@ -20,7 +21,8 @@ class App : Application() {
2021
startKoin {
2122
androidContext(this@App)
2223

23-
androidLogger()
24+
// https://github.com/InsertKoinIO/koin/issues/847
25+
androidLogger(level = Level.ERROR)
2426

2527
modules(
2628
dataModule,

app/src/main/java/com/hoc/flowmvi/ui/main/MainVM.kt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ class MainVM(
7979
.onStart { emit(PartialChange.GetUser.Loading) }
8080
.catch { emit(PartialChange.GetUser.Error(it)) }
8181

82-
val refreshChanges = flow { emit(refreshGetUsers()) }
82+
val refreshChanges = refreshGetUsers::invoke
83+
.asFlow()
8384
.map { PartialChange.Refresh.Success as PartialChange.Refresh }
8485
.onStart { emit(PartialChange.Refresh.Loading) }
8586
.catch { emit(PartialChange.Refresh.Failure(it)) }
@@ -101,18 +102,16 @@ class MainVM(
101102
.map { it.user }
102103
.flatMapMerge { userItem ->
103104
flow {
104-
try {
105-
removeUser(userItem.toDomain())
106-
emit(PartialChange.RemoveUser.Success(userItem))
107-
} catch (e: Exception) {
108-
emit(PartialChange.RemoveUser.Failure(userItem, e))
109-
}
105+
userItem
106+
.toDomain()
107+
.let { removeUser(it) }
108+
.let { emit(it) }
110109
}
110+
.map { PartialChange.RemoveUser.Success(userItem) as PartialChange.RemoveUser }
111+
.catch { emit(PartialChange.RemoveUser.Failure(userItem, it)) }
111112
}
112113
)
113114
}
114115

115116
private fun <T : ViewIntent> Flow<T>.logIntent() = onEach { Log.d("MainVM", "## Intent: $it") }
116117
}
117-
118-

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.4-M1'
4+
ext.kotlin_version = '1.4.0-rc'
55
repositories {
66
google()
77
jcenter()
88
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
99
}
1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:4.0.0'
11+
classpath 'com.android.tools.build:gradle:4.0.1'
1212
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1313

1414
// NOTE: Do not place your application dependencies here; they belong

0 commit comments

Comments
 (0)