From d932912616fdf96fbf3e8765559ded698bc1223a Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Tue, 16 Jul 2019 19:36:04 +0200 Subject: [PATCH] upgrade dependencies (#1389) --- app/build.gradle | 8 ++++---- .../keylesspalace/tusky/di/NetworkModule.kt | 2 +- .../tusky/viewmodel/EditProfileViewModel.kt | 18 ++++++++++-------- build.gradle | 6 +++--- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a4718227..922d9ed2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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' diff --git a/app/src/main/java/com/keylesspalace/tusky/di/NetworkModule.kt b/app/src/main/java/com/keylesspalace/tusky/di/NetworkModule.kt index bdbe7049..26309be5 100644 --- a/app/src/main/java/com/keylesspalace/tusky/di/NetworkModule.kt +++ b/app/src/main/java/com/keylesspalace/tusky/di/NetworkModule.kt @@ -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() diff --git a/app/src/main/java/com/keylesspalace/tusky/viewmodel/EditProfileViewModel.kt b/app/src/main/java/com/keylesspalace/tusky/viewmodel/EditProfileViewModel.kt index 40f2b242..d9c9274b 100644 --- a/app/src/main/java/com/keylesspalace/tusky/viewmodel/EditProfileViewModel.kt +++ b/app/src/main/java/com/keylesspalace/tusky/viewmodel/EditProfileViewModel.kt @@ -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) ) } diff --git a/build.gradle b/build.gradle index 4cacf52c..b3360fa0 100644 --- a/build.gradle +++ b/build.gradle @@ -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" } }