upgrade dependencies (#1389)
This commit is contained in:
parent
16bb011f6a
commit
d932912616
4 changed files with 18 additions and 16 deletions
|
@ -86,7 +86,7 @@ project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ext.daggerVersion = '2.23.1'
|
ext.daggerVersion = '2.23.2'
|
||||||
ext.retrofitVersion = '2.6.0'
|
ext.retrofitVersion = '2.6.0'
|
||||||
|
|
||||||
// if libraries are changed here, they should also be changed in LicenseActivity
|
// if libraries are changed here, they should also be changed in LicenseActivity
|
||||||
|
@ -106,8 +106,8 @@ dependencies {
|
||||||
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
|
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
|
||||||
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
|
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
|
||||||
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
|
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
|
||||||
implementation 'com.squareup.okhttp3:okhttp:3.14.2'
|
implementation 'com.squareup.okhttp3:okhttp:4.0.1'
|
||||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.14.2'
|
implementation 'com.squareup.okhttp3:logging-interceptor:4.0.1'
|
||||||
implementation 'org.conscrypt:conscrypt-android:2.1.0'
|
implementation 'org.conscrypt:conscrypt-android:2.1.0'
|
||||||
implementation 'com.github.connyduck:sparkbutton:2.0.0'
|
implementation 'com.github.connyduck:sparkbutton:2.0.0'
|
||||||
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
|
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
|
||||||
|
@ -144,7 +144,7 @@ dependencies {
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||||
testImplementation 'androidx.test.ext:junit:1.1.1'
|
testImplementation 'androidx.test.ext:junit:1.1.1'
|
||||||
debugImplementation 'im.dino:dbinspector:3.4.1@aar'
|
debugImplementation 'im.dino:dbinspector:3.4.1@aar'
|
||||||
implementation 'io.reactivex.rxjava2:rxjava:2.2.9'
|
implementation 'io.reactivex.rxjava2:rxjava:2.2.10'
|
||||||
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
||||||
implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'
|
implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'
|
||||||
implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.3.0'
|
implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.3.0'
|
||||||
|
|
|
@ -77,7 +77,7 @@ class NetworkModule {
|
||||||
.apply {
|
.apply {
|
||||||
addInterceptor(InstanceSwitchAuthInterceptor(accountManager))
|
addInterceptor(InstanceSwitchAuthInterceptor(accountManager))
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
addInterceptor(HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BASIC))
|
addInterceptor(HttpLoggingInterceptor().apply { level = HttpLoggingInterceptor.Level.BASIC })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.build()
|
.build()
|
||||||
|
|
|
@ -34,7 +34,9 @@ import io.reactivex.Single
|
||||||
import io.reactivex.disposables.CompositeDisposable
|
import io.reactivex.disposables.CompositeDisposable
|
||||||
import io.reactivex.rxkotlin.addTo
|
import io.reactivex.rxkotlin.addTo
|
||||||
import io.reactivex.schedulers.Schedulers
|
import io.reactivex.schedulers.Schedulers
|
||||||
import okhttp3.MediaType
|
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||||
|
import okhttp3.RequestBody.Companion.asRequestBody
|
||||||
|
import okhttp3.RequestBody.Companion.toRequestBody
|
||||||
import okhttp3.MultipartBody
|
import okhttp3.MultipartBody
|
||||||
import okhttp3.RequestBody
|
import okhttp3.RequestBody
|
||||||
import org.json.JSONException
|
import org.json.JSONException
|
||||||
|
@ -144,30 +146,30 @@ class EditProfileViewModel @Inject constructor(
|
||||||
val displayName = if (oldProfileData?.displayName == newDisplayName) {
|
val displayName = if (oldProfileData?.displayName == newDisplayName) {
|
||||||
null
|
null
|
||||||
} else {
|
} else {
|
||||||
RequestBody.create(MultipartBody.FORM, newDisplayName)
|
newDisplayName.toRequestBody(MultipartBody.FORM)
|
||||||
}
|
}
|
||||||
|
|
||||||
val note = if (oldProfileData?.source?.note == newNote) {
|
val note = if (oldProfileData?.source?.note == newNote) {
|
||||||
null
|
null
|
||||||
} else {
|
} else {
|
||||||
RequestBody.create(MultipartBody.FORM, newNote)
|
newNote.toRequestBody(MultipartBody.FORM)
|
||||||
}
|
}
|
||||||
|
|
||||||
val locked = if (oldProfileData?.locked == newLocked) {
|
val locked = if (oldProfileData?.locked == newLocked) {
|
||||||
null
|
null
|
||||||
} else {
|
} else {
|
||||||
RequestBody.create(MultipartBody.FORM, newLocked.toString())
|
newLocked.toString().toRequestBody(MultipartBody.FORM)
|
||||||
}
|
}
|
||||||
|
|
||||||
val avatar = if (avatarData.value is Success && avatarData.value?.data != null) {
|
val avatar = if (avatarData.value is Success && avatarData.value?.data != null) {
|
||||||
val avatarBody = RequestBody.create(MediaType.parse("image/png"), getCacheFileForName(context, AVATAR_FILE_NAME))
|
val avatarBody = getCacheFileForName(context, AVATAR_FILE_NAME).asRequestBody("image/png".toMediaTypeOrNull())
|
||||||
MultipartBody.Part.createFormData("avatar", randomAlphanumericString(12), avatarBody)
|
MultipartBody.Part.createFormData("avatar", randomAlphanumericString(12), avatarBody)
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
val header = if (headerData.value is Success && headerData.value?.data != null) {
|
val header = if (headerData.value is Success && headerData.value?.data != null) {
|
||||||
val headerBody = RequestBody.create(MediaType.parse("image/png"), getCacheFileForName(context, HEADER_FILE_NAME))
|
val headerBody = getCacheFileForName(context, HEADER_FILE_NAME).asRequestBody("image/png".toMediaTypeOrNull())
|
||||||
MultipartBody.Part.createFormData("header", randomAlphanumericString(12), headerBody)
|
MultipartBody.Part.createFormData("header", randomAlphanumericString(12), headerBody)
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
|
@ -235,8 +237,8 @@ class EditProfileViewModel @Inject constructor(
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
return Pair(
|
return Pair(
|
||||||
RequestBody.create(MultipartBody.FORM, newField.name),
|
newField.name.toRequestBody(MultipartBody.FORM),
|
||||||
RequestBody.create(MultipartBody.FORM, newField.value)
|
newField.value.toRequestBody(MultipartBody.FORM)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.3.31'
|
ext.kotlin_version = '1.3.41'
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
google()
|
google()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta04'
|
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta05'
|
||||||
classpath 'com.android.tools.build:gradle:3.4.1'
|
classpath 'com.android.tools.build:gradle:3.4.2'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue