upgrade dependencies (#1389)

This commit is contained in:
Konrad Pozniak 2019-07-16 19:36:04 +02:00 committed by GitHub
parent 16bb011f6a
commit d932912616
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 16 deletions

View file

@ -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'
// 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:converter-gson:$retrofitVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
implementation 'com.squareup.okhttp3:okhttp:3.14.2'
implementation 'com.squareup.okhttp3:logging-interceptor:3.14.2'
implementation 'com.squareup.okhttp3:okhttp:4.0.1'
implementation 'com.squareup.okhttp3:logging-interceptor:4.0.1'
implementation 'org.conscrypt:conscrypt-android:2.1.0'
implementation 'com.github.connyduck:sparkbutton:2.0.0'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
@ -144,7 +144,7 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
testImplementation 'androidx.test.ext:junit:1.1.1'
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:rxkotlin:2.3.0'
implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.3.0'

View file

@ -77,7 +77,7 @@ class NetworkModule {
.apply {
addInterceptor(InstanceSwitchAuthInterceptor(accountManager))
if (BuildConfig.DEBUG) {
addInterceptor(HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BASIC))
addInterceptor(HttpLoggingInterceptor().apply { level = HttpLoggingInterceptor.Level.BASIC })
}
}
.build()

View file

@ -34,7 +34,9 @@ import io.reactivex.Single
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.rxkotlin.addTo
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.RequestBody
import org.json.JSONException
@ -144,30 +146,30 @@ class EditProfileViewModel @Inject constructor(
val displayName = if (oldProfileData?.displayName == newDisplayName) {
null
} else {
RequestBody.create(MultipartBody.FORM, newDisplayName)
newDisplayName.toRequestBody(MultipartBody.FORM)
}
val note = if (oldProfileData?.source?.note == newNote) {
null
} else {
RequestBody.create(MultipartBody.FORM, newNote)
newNote.toRequestBody(MultipartBody.FORM)
}
val locked = if (oldProfileData?.locked == newLocked) {
null
} else {
RequestBody.create(MultipartBody.FORM, newLocked.toString())
newLocked.toString().toRequestBody(MultipartBody.FORM)
}
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)
} else {
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)
} else {
null
@ -235,8 +237,8 @@ class EditProfileViewModel @Inject constructor(
return null
}
return Pair(
RequestBody.create(MultipartBody.FORM, newField.name),
RequestBody.create(MultipartBody.FORM, newField.value)
newField.name.toRequestBody(MultipartBody.FORM),
newField.value.toRequestBody(MultipartBody.FORM)
)
}

View file

@ -1,14 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.31'
ext.kotlin_version = '1.3.41'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta04'
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta05'
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}