Upgraded many dependencies of our project.

* Upgraded test cases and project dependencies.
* Refactor test cases and project code according to the new changes in dependencies.
This commit is contained in:
MohitMaliFtechiz 2024-03-04 21:18:04 +05:30
parent 98671f17d4
commit f2e44e02c4
8 changed files with 25 additions and 24 deletions

View File

@ -46,7 +46,7 @@ class LocalFileTransferTest {
@JvmField
var retryRule = RetryRule()
private var context: Context? = null
private lateinit var context: Context
private lateinit var activityScenario: ActivityScenario<KiwixMainActivity>
private val permissions = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {

View File

@ -67,7 +67,7 @@ class KiwixSplashActivityTest {
@JvmField
var permissionRules: GrantPermissionRule =
GrantPermissionRule.grant(*permissions)
private var context: Context? = null
private lateinit var context: Context
@Before
fun setUp() {

View File

@ -23,7 +23,7 @@ dependencies {
}
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.20.0")
implementation("com.googlecode.json-simple:json-simple:1.1")
implementation("com.squareup.okhttp3:okhttp:4.9.0")
implementation("com.squareup.okhttp3:okhttp:4.10.0")
implementation(gradleApi())
implementation(localGroovy())

View File

@ -20,7 +20,7 @@ object Versions {
const val com_squareup_retrofit2: String = "2.9.0"
const val com_squareup_okhttp3: String = "4.9.0"
const val com_squareup_okhttp3: String = "4.10.0"
const val org_jetbrains_kotlin: String = "1.7.0"
@ -32,7 +32,7 @@ object Versions {
const val com_jakewharton: String = "10.2.3"
const val androidx_test: String = "1.5.1"
const val androidx_test: String = "1.5.2"
const val androidx_test_core: String = "1.5.0"
@ -40,7 +40,7 @@ object Versions {
const val io_objectbox: String = "3.5.0"
const val io_mockk: String = "1.13.5"
const val io_mockk: String = "1.13.7"
const val android_arch_lifecycle_extensions: String = "1.1.1"
@ -52,25 +52,25 @@ object Versions {
const val javax_annotation_api: String = "1.3.2"
const val leakcanary_android: String = "2.9.1"
const val leakcanary_android: String = "2.13"
const val constraintlayout: String = "2.0.4"
const val constraintlayout: String = "2.1.4"
const val swipe_refresh_layout: String = "1.1.0"
const val collection_ktx: String = "1.1.0"
const val preference_ktx: String = "1.1.1"
const val preference_ktx: String = "1.2.0"
const val junit_jupiter: String = "5.9.1"
const val junit_jupiter: String = "5.10.2"
const val assertj_core: String = "3.18.1"
const val assertj_core: String = "3.25.3"
const val core_testing: String = "2.1.0"
const val core_testing: String = "2.2.0"
const val fragment_ktx: String = "1.2.5"
const val testing_ktx: String = "1.2.0"
const val testing_ktx: String = "1.3.0"
const val threetenabp: String = "1.3.0"
@ -80,15 +80,15 @@ object Versions {
const val simple_xml: String = "2.7.1"
const val appcompat: String = "1.2.0"
const val appcompat: String = "1.6.1"
const val rxandroid: String = "2.1.1"
const val core_ktx: String = "1.3.2"
const val core_ktx: String = "1.9.0"
const val libkiwix: String = "2.0.0"
const val material: String = "1.2.1"
const val material: String = "1.8.0"
const val multidex: String = "2.0.1"
@ -96,11 +96,11 @@ object Versions {
const val fetch: String = "3.1.6"
const val rxjava: String = "2.2.20"
const val rxjava: String = "2.2.21"
const val webkit: String = "1.7.0"
const val junit: String = "1.1.4"
const val junit: String = "1.1.5"
const val material_show_case_view: String = "1.3.7"
}

View File

@ -120,13 +120,13 @@ abstract class CorePrefsFragment :
override fun onResume() {
super.onResume()
preferenceScreen.sharedPreferences
.registerOnSharedPreferenceChangeListener(this)
?.registerOnSharedPreferenceChangeListener(this)
}
override fun onPause() {
super.onPause()
preferenceScreen.sharedPreferences
.unregisterOnSharedPreferenceChangeListener(this)
?.unregisterOnSharedPreferenceChangeListener(this)
}
override fun onDestroyView() {

View File

@ -126,7 +126,7 @@
android:background="?colorOnSurface"
android:contentDescription="@string/menu_exit_full_screen"
android:src="@drawable/fullscreen_exit"
android:tint="?colorSurface"
app:tint="?colorSurface"
android:visibility="gone"
android:minWidth="@dimen/material_minimum_height_and_width"
android:minHeight="@dimen/material_minimum_height_and_width"

View File

@ -290,7 +290,7 @@ class TestObserver<T>(
}
fun assertValue(value: (T) -> Boolean): TestObserver<T> {
assertThat(values.last()).satisfies { value(it) }
assertThat(values.last()).satisfies({ value(it) })
return this
}
}

View File

@ -19,6 +19,7 @@
package org.kiwix.kiwixmobile.custom.settings
import android.os.Bundle
import androidx.preference.Preference
import org.kiwix.kiwixmobile.core.settings.CorePrefsFragment
import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil.Companion.PREF_LANG
import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil.Companion.PREF_WIFI_ONLY
@ -33,7 +34,7 @@ class CustomPrefsFragment : CorePrefsFragment() {
if (BuildConfig.ENFORCED_LANG.isEmpty()) {
setUpLanguageChooser(PREF_LANG)
} else {
preferenceScreen.removePreference(findPreference("pref_language"))
findPreference<Preference>("pref_language")?.let(preferenceScreen::removePreference)
}
preferenceScreen.removePreferenceRecursively(PREF_WIFI_ONLY)
}
@ -50,6 +51,6 @@ class CustomPrefsFragment : CorePrefsFragment() {
}
override fun setStorage() {
preferenceScreen.removePreference(findPreference("pref_storage"))
findPreference<Preference>("pref_storage")?.let(preferenceScreen::removePreference)
}
}