diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 78a05f2fc..1682795c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: target: default arch: x86_64 profile: pixel_2 - emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none ram-size: 4096M cores: 4 force-avd-creation: false @@ -101,7 +101,7 @@ jobs: emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none ram-size: 4096M cores: 4 - force-avd-creation: false + force-avd-creation: true sdcard-path-or-size: 2048M disable-animations: true heap-size: 512M diff --git a/app/src/main/java/org/kiwix/kiwixmobile/intro/CustomPageIndicator.kt b/app/src/main/java/org/kiwix/kiwixmobile/intro/CustomPageIndicator.kt index 51593b568..1debabdd0 100644 --- a/app/src/main/java/org/kiwix/kiwixmobile/intro/CustomPageIndicator.kt +++ b/app/src/main/java/org/kiwix/kiwixmobile/intro/CustomPageIndicator.kt @@ -32,7 +32,6 @@ import android.os.Parcelable import android.util.AttributeSet import android.view.View import android.view.animation.Interpolator -import androidx.core.view.ViewCompat import androidx.interpolator.view.animation.FastOutSlowInInterpolator import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager.OnPageChangeListener @@ -510,7 +509,7 @@ class CustomPageIndicator @JvmOverloads constructor( moveSelected.addUpdateListener { valueAnimator -> // todo avoid autoboxing selectedDotX = valueAnimator.animatedValue as Float retreatAnimation!!.startIfNecessary(selectedDotX) - ViewCompat.postInvalidateOnAnimation(this@CustomPageIndicator) + this@CustomPageIndicator.postInvalidateOnAnimation() } moveSelected.addListener(object : AnimatorListenerAdapter() { override fun onAnimationStart(animation: Animator) { @@ -536,20 +535,20 @@ class CustomPageIndicator @JvmOverloads constructor( private fun setJoiningFraction(leftDot: Int, fraction: Float) { if (leftDot < joiningFractions.size) { joiningFractions[leftDot] = fraction - ViewCompat.postInvalidateOnAnimation(this) + this.postInvalidateOnAnimation() } } private fun clearJoiningFractions() { Arrays.fill(joiningFractions, 0f) - ViewCompat.postInvalidateOnAnimation(this) + this.postInvalidateOnAnimation() } private fun setDotRevealFraction(dot: Int, fraction: Float) { if (dot < dotRevealFractions.size) { dotRevealFractions[dot] = fraction } - ViewCompat.postInvalidateOnAnimation(this) + this.postInvalidateOnAnimation() } private fun cancelJoiningAnimations() { @@ -608,7 +607,7 @@ class CustomPageIndicator @JvmOverloads constructor( } addUpdateListener { valueAnimator -> // todo avoid autoboxing retreatingJoinX1 = valueAnimator.animatedValue as Float - ViewCompat.postInvalidateOnAnimation(this@CustomPageIndicator) + this@CustomPageIndicator.postInvalidateOnAnimation() // start any reveal animations if we've passed them for (pendingReveal in revealAnimations) { pendingReveal!!.startIfNecessary(retreatingJoinX1) @@ -626,7 +625,7 @@ class CustomPageIndicator @JvmOverloads constructor( } addUpdateListener { valueAnimator -> // todo avoid autoboxing retreatingJoinX2 = valueAnimator.animatedValue as Float - ViewCompat.postInvalidateOnAnimation(this@CustomPageIndicator) + this@CustomPageIndicator.postInvalidateOnAnimation() // start any reveal animations if we've passed them for (pendingReveal in revealAnimations) { pendingReveal!!.startIfNecessary(retreatingJoinX2) @@ -643,13 +642,13 @@ class CustomPageIndicator @JvmOverloads constructor( } retreatingJoinX1 = initialX1 retreatingJoinX2 = initialX2 - ViewCompat.postInvalidateOnAnimation(this@CustomPageIndicator) + this@CustomPageIndicator.postInvalidateOnAnimation() } override fun onAnimationEnd(animation: Animator) { retreatingJoinX1 = INVALID_FRACTION retreatingJoinX2 = INVALID_FRACTION - ViewCompat.postInvalidateOnAnimation(this@CustomPageIndicator) + this@CustomPageIndicator.postInvalidateOnAnimation() } }) } @@ -676,7 +675,7 @@ class CustomPageIndicator @JvmOverloads constructor( addListener(object : AnimatorListenerAdapter() { override fun onAnimationEnd(animation: Animator) { setDotRevealFraction(this@PendingRevealAnimator.dot, 0f) - ViewCompat.postInvalidateOnAnimation(this@CustomPageIndicator) + this@CustomPageIndicator.postInvalidateOnAnimation() } }) } diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 2e9418055..8063e8d4b 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -14,7 +14,7 @@ object Versions { const val document_file_version: String = "1.0.1" - const val org_jetbrains_kotlinx_kotlinx_coroutines: String = "1.7.3" + const val org_jetbrains_kotlinx_kotlinx_coroutines: String = "1.8.1" const val androidx_test_espresso: String = "3.5.1" @@ -30,17 +30,15 @@ object Versions { const val com_google_dagger: String = "2.48.1" - const val com_jakewharton: String = "10.2.3" + const val androidx_test: String = "1.6.1" - const val androidx_test: String = "1.5.2" + const val androidx_test_core: String = "1.6.1" - const val androidx_test_core: String = "1.5.0" - - const val androidx_test_orchestrator: String = "1.4.1" + const val androidx_test_orchestrator: String = "1.5.0" const val io_objectbox: String = "3.5.0" - const val io_mockk: String = "1.13.7" + const val io_mockk: String = "1.13.12" const val android_arch_lifecycle_extensions: String = "1.1.1" @@ -62,9 +60,9 @@ object Versions { const val preference_ktx: String = "1.2.0" - const val junit_jupiter: String = "5.10.2" + const val junit_jupiter: String = "5.11.0" - const val assertj_core: String = "3.25.3" + const val assertj_core: String = "3.26.3" const val core_testing: String = "2.2.0" @@ -74,13 +72,13 @@ object Versions { const val threetenabp: String = "1.3.0" - const val uiautomator: String = "2.3.0-alpha03" + const val uiautomator: String = "2.3.0" - const val annotation: String = "1.2.0" + const val annotation: String = "1.6.0" const val simple_xml: String = "2.7.1" - const val appcompat: String = "1.6.1" + const val appcompat: String = "1.7.0" const val rxandroid: String = "2.1.1" diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreMainActivity.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreMainActivity.kt index c8281905f..dddb86084 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreMainActivity.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/CoreMainActivity.kt @@ -291,7 +291,7 @@ abstract class CoreMainActivity : BaseActivity(), WebViewProvider { return } if (activeFragments().filterIsInstance().isEmpty()) { - return super.getOnBackPressedDispatcher().onBackPressed() + return super.onBackPressedDispatcher.onBackPressed() } activeFragments().filterIsInstance().forEach { if (it.onBackPressed(this) == FragmentActivityExtensions.Super.ShouldCall) { @@ -302,7 +302,7 @@ abstract class CoreMainActivity : BaseActivity(), WebViewProvider { drawerToggle = null finish() } else { - super.getOnBackPressedDispatcher().onBackPressed() + super.onBackPressedDispatcher.onBackPressed() } } } diff --git a/core/src/test/java/org/kiwix/kiwixmobile/core/search/viewmodel/SearchStateTest.kt b/core/src/test/java/org/kiwix/kiwixmobile/core/search/viewmodel/SearchStateTest.kt index 6c2a50b88..a3af0415d 100644 --- a/core/src/test/java/org/kiwix/kiwixmobile/core/search/viewmodel/SearchStateTest.kt +++ b/core/src/test/java/org/kiwix/kiwixmobile/core/search/viewmodel/SearchStateTest.kt @@ -124,10 +124,10 @@ internal class SearchStateTest { list = searchState.getVisibleResults(0) } + job.cancelAndJoin() val job1 = launch(Dispatchers.IO) { list1 = searchState.getVisibleResults(0) } - job.cancelAndJoin() // test the coroutine job is cancelled properly assertThat(job.isCancelled).isTrue