From 68c9870b19858a9bfef75c33ef7d51d7d315853a Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Sun, 7 Aug 2022 19:13:59 +0200 Subject: [PATCH] update AndroidX dependencies (#2641) * update AndroidX dependencies * fix ComposeActivityTest --- app/build.gradle | 16 ++++++++-------- .../receiver/SendStatusBroadcastReceiver.kt | 2 +- .../keylesspalace/tusky/ComposeActivityTest.kt | 3 ++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 730d428a..f06052bc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -93,8 +93,8 @@ android { } ext.coroutinesVersion = "1.6.1" -ext.lifecycleVersion = "2.4.1" -ext.roomVersion = '2.4.2' +ext.lifecycleVersion = "2.5.1" +ext.roomVersion = '2.4.3' ext.retrofitVersion = '2.9.0' ext.okhttpVersion = '4.9.3' ext.glideVersion = '4.13.1' @@ -108,9 +108,9 @@ dependencies { implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-rx3:$coroutinesVersion" - implementation "androidx.core:core-ktx:1.7.0" - implementation "androidx.appcompat:appcompat:1.4.1" - implementation "androidx.fragment:fragment-ktx:1.4.1" + implementation "androidx.core:core-ktx:1.8.0" + implementation "androidx.appcompat:appcompat:1.4.2" + implementation "androidx.fragment:fragment-ktx:1.5.1" implementation "androidx.browser:browser:1.4.0" implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0" implementation "androidx.recyclerview:recyclerview:1.2.1" @@ -125,16 +125,16 @@ dependencies { implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion" implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion" implementation "androidx.lifecycle:lifecycle-reactivestreams-ktx:$lifecycleVersion" - implementation "androidx.constraintlayout:constraintlayout:2.1.3" + implementation "androidx.constraintlayout:constraintlayout:2.1.4" implementation "androidx.paging:paging-runtime-ktx:3.1.1" implementation "androidx.viewpager2:viewpager2:1.0.0" implementation "androidx.work:work-runtime:2.7.1" implementation "androidx.room:room-ktx:$roomVersion" implementation "androidx.room:room-paging:$roomVersion" kapt "androidx.room:room-compiler:$roomVersion" - implementation 'androidx.core:core-splashscreen:1.0.0-beta02' + implementation 'androidx.core:core-splashscreen:1.0.0' - implementation "com.google.android.material:material:1.6.0" + implementation "com.google.android.material:material:1.6.1" implementation "com.google.code.gson:gson:2.9.0" diff --git a/app/src/main/java/com/keylesspalace/tusky/receiver/SendStatusBroadcastReceiver.kt b/app/src/main/java/com/keylesspalace/tusky/receiver/SendStatusBroadcastReceiver.kt index 53cccf09..75ccf799 100644 --- a/app/src/main/java/com/keylesspalace/tusky/receiver/SendStatusBroadcastReceiver.kt +++ b/app/src/main/java/com/keylesspalace/tusky/receiver/SendStatusBroadcastReceiver.kt @@ -126,6 +126,6 @@ class SendStatusBroadcastReceiver : BroadcastReceiver() { private fun getReplyMessage(intent: Intent): CharSequence { val remoteInput = RemoteInput.getResultsFromIntent(intent) - return remoteInput.getCharSequence(NotificationHelper.KEY_REPLY, "") + return remoteInput?.getCharSequence(NotificationHelper.KEY_REPLY, "") ?: "" } } diff --git a/app/src/test/java/com/keylesspalace/tusky/ComposeActivityTest.kt b/app/src/test/java/com/keylesspalace/tusky/ComposeActivityTest.kt index f041f57b..8dd92162 100644 --- a/app/src/test/java/com/keylesspalace/tusky/ComposeActivityTest.kt +++ b/app/src/test/java/com/keylesspalace/tusky/ComposeActivityTest.kt @@ -42,6 +42,7 @@ import org.junit.Test import org.junit.runner.RunWith import org.mockito.kotlin.any import org.mockito.kotlin.doReturn +import org.mockito.kotlin.eq import org.mockito.kotlin.mock import org.robolectric.Robolectric import org.robolectric.Shadows.shadowOf @@ -131,7 +132,7 @@ class ComposeActivityTest { } val viewModelFactoryMock: ViewModelFactory = mock { - on { create(ComposeViewModel::class.java) } doReturn viewModel + on { create(eq(ComposeViewModel::class.java), any()) } doReturn viewModel } activity.accountManager = accountManagerMock