Update parsers

master
Koitharu 2 years ago
parent 9b658cf0b8
commit 0f43f02fad
Signed by: Koitharu
GPG Key ID: 676DEE768C17A9D7

@ -16,8 +16,8 @@ android {
applicationId 'org.koitharu.kotatsu' applicationId 'org.koitharu.kotatsu'
minSdk = 21 minSdk = 21
targetSdk = 34 targetSdk = 34
versionCode = 641 versionCode = 642
versionName = '7.0' versionName = '7.0.1'
generatedDensities = [] generatedDensities = []
testInstrumentationRunner 'org.koitharu.kotatsu.HiltTestRunner' testInstrumentationRunner 'org.koitharu.kotatsu.HiltTestRunner'
ksp { ksp {
@ -82,7 +82,7 @@ afterEvaluate {
} }
dependencies { dependencies {
//noinspection GradleDependency //noinspection GradleDependency
implementation('com.github.KotatsuApp:kotatsu-parsers:3e32a6280a') { implementation('com.github.KotatsuApp:kotatsu-parsers:915d4093b9') {
exclude group: 'org.json', module: 'json' exclude group: 'org.json', module: 'json'
} }

@ -13,9 +13,8 @@ import org.koitharu.kotatsu.parsers.model.Manga
import org.koitharu.kotatsu.parsers.model.MangaChapter import org.koitharu.kotatsu.parsers.model.MangaChapter
import org.koitharu.kotatsu.parsers.model.MangaSource import org.koitharu.kotatsu.parsers.model.MangaSource
import org.koitharu.kotatsu.parsers.model.MangaState import org.koitharu.kotatsu.parsers.model.MangaState
import org.koitharu.kotatsu.parsers.util.formatSimple
import org.koitharu.kotatsu.parsers.util.mapToSet import org.koitharu.kotatsu.parsers.util.mapToSet
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols
import com.google.android.material.R as materialR import com.google.android.material.R as materialR
@JvmName("mangaIds") @JvmName("mangaIds")
@ -119,17 +118,10 @@ val Manga.appUrl: Uri
.appendQueryParameter("url", url) .appendQueryParameter("url", url)
.build() .build()
private val chaptersNumberFormat = DecimalFormat("#.#").also { f -> fun MangaChapter.formatNumber(): String? = if (number > 0f) {
f.decimalFormatSymbols = DecimalFormatSymbols.getInstance().also { number.formatSimple()
it.decimalSeparator = '.' } else {
} null
}
fun MangaChapter.formatNumber(): String? {
if (number <= 0f) {
return null
}
return chaptersNumberFormat.format(number.toDouble())
} }
fun Manga.chaptersCount(): Int { fun Manga.chaptersCount(): Int {

@ -13,7 +13,7 @@ fun downloadChapterAD() = adapterDelegateViewBinding<DownloadChapter, DownloadCh
val iconDone = ContextCompat.getDrawable(context, R.drawable.ic_check) val iconDone = ContextCompat.getDrawable(context, R.drawable.ic_check)
bind { bind {
binding.textViewNumber.text = item.number.toString() binding.textViewNumber.text = item.number
binding.textViewTitle.text = item.name binding.textViewTitle.text = item.name
binding.textViewTitle.drawableEnd = if (item.isDownloaded) iconDone else null binding.textViewTitle.drawableEnd = if (item.isDownloaded) iconDone else null
} }

Loading…
Cancel
Save