diff --git a/app/build.gradle b/app/build.gradle index afcae1aab..d05b9dfe2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,8 +16,8 @@ android { applicationId 'org.koitharu.kotatsu' minSdk = 21 targetSdk = 34 - versionCode = 596 - versionName = '6.3.0-a1' + versionCode = 597 + versionName = '6.3.0' generatedDensities = [] testInstrumentationRunner "org.koitharu.kotatsu.HiltTestRunner" ksp { @@ -33,7 +33,6 @@ android { applicationIdSuffix = '.debug' } release { - multiDexEnabled false minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' @@ -82,7 +81,7 @@ afterEvaluate { } dependencies { //noinspection GradleDependency - implementation('com.github.KotatsuApp:kotatsu-parsers:2cd2d7dbc4') { + implementation('com.github.KotatsuApp:kotatsu-parsers:43fd7b8d47') { exclude group: 'org.json', module: 'json' } @@ -91,7 +90,7 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.core:core-ktx:1.12.0' - implementation 'androidx.activity:activity-ktx:1.8.0' + implementation 'androidx.activity:activity-ktx:1.8.1' implementation 'androidx.fragment:fragment-ktx:1.6.2' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2' implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2' diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderActivity.kt b/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderActivity.kt index bd6b4a039..bee4837b6 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderActivity.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderActivity.kt @@ -307,15 +307,13 @@ class ReaderActivity : private fun onPageSaved(uri: Uri?) { if (uri != null) { Snackbar.make(viewBinding.container, R.string.page_saved, Snackbar.LENGTH_LONG) - .setAnchorView(viewBinding.appbarBottom) .setAction(R.string.share) { ShareHelper(this).shareImage(uri) - }.show() + } } else { Snackbar.make(viewBinding.container, R.string.error_occurred, Snackbar.LENGTH_SHORT) - .setAnchorView(viewBinding.appbarBottom) - .show() - } + }.setAnchorView(viewBinding.appbarBottom) + .show() } private fun setWindowSecure(isSecure: Boolean) { diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderViewModel.kt b/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderViewModel.kt index 109b2d125..f0cea3488 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderViewModel.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/ReaderViewModel.kt @@ -27,6 +27,7 @@ import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.flow.update import kotlinx.coroutines.plus +import org.koitharu.kotatsu.BuildConfig import org.koitharu.kotatsu.R import org.koitharu.kotatsu.bookmarks.domain.Bookmark import org.koitharu.kotatsu.bookmarks.domain.BookmarksRepository @@ -255,10 +256,13 @@ class ReaderViewModel @Inject constructor( @MainThread fun onCurrentPageChanged(position: Int) { val prevJob = stateChangeJob + val pages = content.value.pages // capture immediately stateChangeJob = launchJob(Dispatchers.Default) { prevJob?.cancelAndJoin() loadingJob?.join() - val pages = content.value.pages + if (BuildConfig.DEBUG && pages.size != content.value.pages.size) { + throw IllegalStateException("Concurrent pages modification") + } pages.getOrNull(position)?.let { page -> currentState.update { cs -> cs?.copy(chapterId = page.chapterId, page = page.index) diff --git a/build.gradle b/build.gradle index 0b500dad3..021ba8feb 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.3' + classpath 'com.android.tools.build:gradle:8.1.4' classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20' classpath 'com.google.dagger:hilt-android-gradle-plugin:2.48.1' classpath 'com.google.devtools.ksp:symbol-processing-gradle-plugin:1.9.20-1.0.14'