diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 74df5d1d1..861d273ed 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,6 +2,9 @@ + + + diff --git a/buildSrc/src/main/kotlin/ProjectConfig.kt b/buildSrc/src/main/kotlin/ProjectConfig.kt index 69982ec77..3454e19f2 100644 --- a/buildSrc/src/main/kotlin/ProjectConfig.kt +++ b/buildSrc/src/main/kotlin/ProjectConfig.kt @@ -3,7 +3,7 @@ object ProjectConfig { const val targetSdk = 29 const val compileSdk = 33 const val ndk = "21.3.6528147" - const val versionName = "0.1.32" - const val versionCode = 39 + const val versionName = "0.1.33" + const val versionCode = 40 const val applicationId = "ir.kazemcodes.infinityreader" } diff --git a/core/src/commonMain/kotlin/di/ISingleton.kt b/core/src/commonMain/kotlin/di/ISingleton.kt deleted file mode 100644 index 5bf2d2089..000000000 --- a/core/src/commonMain/kotlin/di/ISingleton.kt +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (C) 2018 The Tachiyomi Open Source Project - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -package ireader.presentation.core.di - -import kotlin.reflect.KClass - -@Suppress("NO_ACTUAL_FOR_EXPECT") -expect annotation class ISingleton() diff --git a/core/src/commonMain/kotlin/di/IViewModel.kt b/core/src/commonMain/kotlin/di/IViewModel.kt deleted file mode 100644 index 938bae51c..000000000 --- a/core/src/commonMain/kotlin/di/IViewModel.kt +++ /dev/null @@ -1,6 +0,0 @@ -package ireader.presentation.core.di - -import kotlin.reflect.KClass - -@Suppress("NO_ACTUAL_FOR_EXPECT") -expect annotation class IViewModel() \ No newline at end of file diff --git a/core/src/commonMain/kotlin/source/CatalogSource.kt b/core/src/commonMain/kotlin/source/CatalogSource.kt index 4e18bf2a1..10f3a1295 100644 --- a/core/src/commonMain/kotlin/source/CatalogSource.kt +++ b/core/src/commonMain/kotlin/source/CatalogSource.kt @@ -10,6 +10,12 @@ import ireader.core.source.model.MangasPageInfo @Keep interface CatalogSource : ireader.core.source.Source { + companion object { + const val TYPE_NOVEL = 0 + const val TYPE_MANGA = 1 + const val TYPE_MOVIE = 2 + } + override val lang: String suspend fun getMangaList(sort: Listing?, page: Int): MangasPageInfo diff --git a/core/src/commonMain/kotlin/source/HttpSource.kt b/core/src/commonMain/kotlin/source/HttpSource.kt index 1e6d32363..c64b8d2cd 100644 --- a/core/src/commonMain/kotlin/source/HttpSource.kt +++ b/core/src/commonMain/kotlin/source/HttpSource.kt @@ -4,6 +4,7 @@ import androidx.annotation.Keep import io.ktor.client.HttpClient import io.ktor.client.request.HttpRequestBuilder import io.ktor.client.request.url +import ireader.core.source.CatalogSource.Companion.TYPE_NOVEL import ireader.core.source.model.Command import ireader.core.source.model.CommandList import ireader.core.source.model.ImageUrl @@ -36,6 +37,8 @@ abstract class HttpSource(private val dependencies: ireader.core.source.Dependen open val client: HttpClient get() = dependencies.httpClients.default + open val type: Int = TYPE_NOVEL + /** * Visible name of the source. */ diff --git a/core/src/commonMain/kotlin/source/model/Page.kt b/core/src/commonMain/kotlin/source/model/Page.kt index 15d3c0e05..b9a11f31f 100644 --- a/core/src/commonMain/kotlin/source/model/Page.kt +++ b/core/src/commonMain/kotlin/source/model/Page.kt @@ -42,22 +42,17 @@ data class ImageBase64(val data: String) : PageComplete() @Serializable data class Text(val text: String) : PageComplete() -@Serializable -data class MovieUrl(val url: String) : PageComplete() -//@Serializable -//data class MovieUrl( -// val url: String, -// val name: String? = null, -// val quality: Int = Quality.UNSPECIFIC -//) : PageComplete() @Serializable -data class Subtitle(val url: String) : PageComplete() +data class MovieUrl( + val url: String, +) : PageComplete() + -//@Serializable -//data class Subtitle(val url: String, val language: String? = null, val name: String? = null) : -// PageComplete() +@Serializable +data class Subtitle(val url: String, val language: String? = null, val name: String? = null) : + PageComplete() // creating a customized encoding and decoding because kotlin serialization may cause some problem in future. // Unlike tachiyomi, right now ireader is using saving files in app db diff --git a/core/src/jvmMain/kotlin/di/ISingleton.kt b/core/src/jvmMain/kotlin/di/ISingleton.kt deleted file mode 100644 index 6e4813ade..000000000 --- a/core/src/jvmMain/kotlin/di/ISingleton.kt +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright (C) 2018 The Tachiyomi Open Source Project - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -package ireader.core.di - -actual typealias ISingleton = org.koin.core.annotation.Single diff --git a/core/src/jvmMain/kotlin/di/IViewModel.kt b/core/src/jvmMain/kotlin/di/IViewModel.kt deleted file mode 100644 index 4b5660da6..000000000 --- a/core/src/jvmMain/kotlin/di/IViewModel.kt +++ /dev/null @@ -1,3 +0,0 @@ -package ireader.core.di - -actual typealias IViewModel = org.koin.android.annotation.KoinViewModel \ No newline at end of file diff --git a/data/src/main/java/ireader/data/book/BookRepositoryImpl.kt b/data/src/main/java/ireader/data/book/BookRepositoryImpl.kt index 0744abb07..7a8db7012 100644 --- a/data/src/main/java/ireader/data/book/BookRepositoryImpl.kt +++ b/data/src/main/java/ireader/data/book/BookRepositoryImpl.kt @@ -1,7 +1,7 @@ package ireader.data.book import ireader.common.models.entities.Book -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.common.models.entities.LibraryBook import ireader.common.models.library.LibrarySort import ireader.data.local.DatabaseHandler diff --git a/data/src/main/java/ireader/data/book/bookMapper.kt b/data/src/main/java/ireader/data/book/bookMapper.kt index 292feb652..b740f51a6 100644 --- a/data/src/main/java/ireader/data/book/bookMapper.kt +++ b/data/src/main/java/ireader/data/book/bookMapper.kt @@ -1,7 +1,7 @@ package ireader.data.book import ireader.common.models.entities.Book -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.common.models.entities.LibraryBook import ireader.core.source.model.MangaInfo diff --git a/data/src/main/java/ireader/data/catalog/impl/CatalogGithubApi.kt b/data/src/main/java/ireader/data/catalog/impl/CatalogGithubApi.kt index 2fab98950..4bbf7ba16 100644 --- a/data/src/main/java/ireader/data/catalog/impl/CatalogGithubApi.kt +++ b/data/src/main/java/ireader/data/catalog/impl/CatalogGithubApi.kt @@ -19,6 +19,9 @@ class CatalogGithubApi( private val httpClient: HttpClients, private val getDefaultRepo: GetDefaultRepo ) : CatalogRemoteApi { + private val json = Json { + ignoreUnknownKeys = true + } override suspend fun fetchCatalogs(): List { val repo = getDefaultRepo() @@ -27,7 +30,7 @@ class CatalogGithubApi( .get(repo.key) .bodyAsText() - val catalogs = Json.Default.decodeFromString>(response) + val catalogs = json.decodeFromString>(response) if (catalogs.isEmpty()) { throw CatalogNotFoundException() } diff --git a/data/src/main/java/ireader/data/chapter/ChapterRepositoryImpl.kt b/data/src/main/java/ireader/data/chapter/ChapterRepositoryImpl.kt index 07b82e839..9d5e41d51 100644 --- a/data/src/main/java/ireader/data/chapter/ChapterRepositoryImpl.kt +++ b/data/src/main/java/ireader/data/chapter/ChapterRepositoryImpl.kt @@ -1,6 +1,6 @@ package ireader.data.chapter -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.data.local.DatabaseHandler import ireader.data.util.toDB import ireader.domain.data.repository.ChapterRepository diff --git a/data/src/main/java/ireader/data/chapter/chapterMapper.kt b/data/src/main/java/ireader/data/chapter/chapterMapper.kt index 08789a02f..b2d15c19f 100644 --- a/data/src/main/java/ireader/data/chapter/chapterMapper.kt +++ b/data/src/main/java/ireader/data/chapter/chapterMapper.kt @@ -1,6 +1,6 @@ package ireader.data.chapter -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.core.source.model.Page val chapterMapper = {_id: Long, book_id: Long, url: String, name: String, scanlator: String?, read: Boolean, bookmark: Boolean, last_page_read: Long, chapter_number: Float, source_order: Long, date_fetch: Long, date_upload: Long, content: List ,type: Long-> diff --git a/domain/src/main/AndroidManifest.xml b/domain/src/main/AndroidManifest.xml index 5388d7cb3..e12a03248 100644 --- a/domain/src/main/AndroidManifest.xml +++ b/domain/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - - + \ No newline at end of file diff --git a/domain/src/main/java/ireader/domain/data/repository/BookRepository.kt b/domain/src/main/java/ireader/domain/data/repository/BookRepository.kt index 8334a4412..ce0adb067 100644 --- a/domain/src/main/java/ireader/domain/data/repository/BookRepository.kt +++ b/domain/src/main/java/ireader/domain/data/repository/BookRepository.kt @@ -1,7 +1,7 @@ package ireader.domain.data.repository import ireader.common.models.entities.Book -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.common.models.entities.LibraryBook import ireader.common.models.library.LibrarySort import kotlinx.coroutines.flow.Flow diff --git a/domain/src/main/java/ireader/domain/data/repository/ChapterRepository.kt b/domain/src/main/java/ireader/domain/data/repository/ChapterRepository.kt index f03504cf2..99aed8b20 100644 --- a/domain/src/main/java/ireader/domain/data/repository/ChapterRepository.kt +++ b/domain/src/main/java/ireader/domain/data/repository/ChapterRepository.kt @@ -1,6 +1,6 @@ package ireader.domain.data.repository -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import kotlinx.coroutines.flow.Flow interface ChapterRepository { @@ -30,7 +30,7 @@ interface ChapterRepository { suspend fun insertChapter(chapter: Chapter): Long suspend fun insertChapters( - chapters: List, + chapters: List, ): List suspend fun deleteChaptersByBookId( @@ -40,7 +40,7 @@ interface ChapterRepository { suspend fun deleteChapters(chapters: List) suspend fun deleteChapter( - chapter: Chapter, + chapter: Chapter, ) suspend fun deleteAllChapters() diff --git a/domain/src/main/java/ireader/domain/models/BackUpBook.kt b/domain/src/main/java/ireader/domain/models/BackUpBook.kt index bc260e21b..f22b5c2f8 100644 --- a/domain/src/main/java/ireader/domain/models/BackUpBook.kt +++ b/domain/src/main/java/ireader/domain/models/BackUpBook.kt @@ -2,13 +2,13 @@ package ireader.domain.models import androidx.annotation.Keep import ireader.common.models.entities.Book -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import kotlinx.serialization.Serializable @Keep @Serializable data class BackUpBook( - val book: Book, - val chapters: List, + val book: Book, + val chapters: List, ) diff --git a/domain/src/main/java/ireader/domain/models/entities/Chapter.kt b/domain/src/main/java/ireader/domain/models/entities/Chapter.kt index e679dee21..3a551e0fd 100644 --- a/domain/src/main/java/ireader/domain/models/entities/Chapter.kt +++ b/domain/src/main/java/ireader/domain/models/entities/Chapter.kt @@ -1,6 +1,6 @@ -package ireader.common.models.entities +package ireader.domain.models.entities @@ -8,6 +8,9 @@ import ireader.core.source.model.ChapterInfo import ireader.core.source.model.Page import kotlinx.serialization.Serializable +/** + * @param number it's number of current chapter + */ @Serializable data class Chapter( val id: Long = 0, diff --git a/domain/src/main/java/ireader/domain/models/entities/SavedDownload.kt b/domain/src/main/java/ireader/domain/models/entities/SavedDownload.kt index 0a98ba826..5930df86d 100644 --- a/domain/src/main/java/ireader/domain/models/entities/SavedDownload.kt +++ b/domain/src/main/java/ireader/domain/models/entities/SavedDownload.kt @@ -2,6 +2,8 @@ package ireader.common.models.entities +import ireader.domain.models.entities.Chapter + data class Download( val chapterId: Long, val bookId: Long, diff --git a/domain/src/main/java/ireader/domain/services/downloaderService/DefaultNotificationHelper.kt b/domain/src/main/java/ireader/domain/services/downloaderService/DefaultNotificationHelper.kt index cb6d8964b..1712b3096 100644 --- a/domain/src/main/java/ireader/domain/services/downloaderService/DefaultNotificationHelper.kt +++ b/domain/src/main/java/ireader/domain/services/downloaderService/DefaultNotificationHelper.kt @@ -13,7 +13,7 @@ import androidx.core.app.NotificationManagerCompat import androidx.core.net.toUri import androidx.work.WorkManager import ireader.common.models.entities.Book -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.domain.R import ireader.domain.notification.Notifications import ireader.domain.notification.flags @@ -99,8 +99,8 @@ class DefaultNotificationHelper( } fun baseNotificationDownloader( - chapter: Chapter? = null, - workManagerId: UUID, + chapter: Chapter? = null, + workManagerId: UUID, ): NotificationCompat.Builder { val cancelDownloadIntent = WorkManager.getInstance(context) .createCancelPendingIntent(workManagerId) @@ -262,13 +262,13 @@ class DefaultNotificationHelper( ) suspend fun basicPlayingTextReaderNotification( - chapter: Chapter, - book: Book, - playing: Boolean, - progress: Int, - mediaSessionCompat: MediaSessionCompat, - isLoading: Boolean = false, - isError: Boolean = false, + chapter: Chapter, + book: Book, + playing: Boolean, + progress: Int, + mediaSessionCompat: MediaSessionCompat, + isLoading: Boolean = false, + isError: Boolean = false, ): NotificationCompat.Builder { val contentText = when { @@ -362,9 +362,9 @@ class DefaultNotificationHelper( } private fun openReaderScreenIntent( - chapter: Chapter, - book: Book, - currentReadingParagraph: Int = 0, + chapter: Chapter, + book: Book, + currentReadingParagraph: Int = 0, ): PendingIntent = PendingIntent.getActivity( context.applicationContext, 5, diff --git a/domain/src/main/java/ireader/domain/services/downloaderService/DownloaderService.kt b/domain/src/main/java/ireader/domain/services/downloaderService/DownloaderService.kt index 6e3d7837d..aea40ad90 100644 --- a/domain/src/main/java/ireader/domain/services/downloaderService/DownloaderService.kt +++ b/domain/src/main/java/ireader/domain/services/downloaderService/DownloaderService.kt @@ -7,8 +7,7 @@ import androidx.work.CoroutineWorker import androidx.work.WorkerParameters import ireader.domain.data.repository.BookRepository import ireader.domain.data.repository.ChapterRepository -import ireader.domain.utils.extensions.launchIO -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.common.models.entities.SavedDownload import ireader.common.models.entities.buildSavedDownload import ireader.i18n.asString diff --git a/domain/src/main/java/ireader/domain/services/library_update_service/LibraryUpdatesService.kt b/domain/src/main/java/ireader/domain/services/library_update_service/LibraryUpdatesService.kt index 245151777..ffc14a8d3 100644 --- a/domain/src/main/java/ireader/domain/services/library_update_service/LibraryUpdatesService.kt +++ b/domain/src/main/java/ireader/domain/services/library_update_service/LibraryUpdatesService.kt @@ -6,7 +6,7 @@ import androidx.core.app.NotificationManagerCompat import androidx.work.CoroutineWorker import androidx.work.WorkManager import androidx.work.WorkerParameters -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.core.log.Log import ireader.domain.catalogs.interactor.GetLocalCatalog import ireader.domain.R diff --git a/domain/src/main/java/ireader/domain/services/tts_service/TTSState.kt b/domain/src/main/java/ireader/domain/services/tts_service/TTSState.kt index 7fb957a70..d3369e559 100644 --- a/domain/src/main/java/ireader/domain/services/tts_service/TTSState.kt +++ b/domain/src/main/java/ireader/domain/services/tts_service/TTSState.kt @@ -10,7 +10,7 @@ import androidx.compose.runtime.setValue import kotlinx.datetime.Instant import ireader.common.models.entities.Book import ireader.domain.models.entities.CatalogLocal -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.core.source.Source import ireader.core.source.model.Text import ireader.domain.preferences.models.prefs.IReaderVoice diff --git a/domain/src/main/java/ireader/domain/services/tts_service/media_player/TTSService.kt b/domain/src/main/java/ireader/domain/services/tts_service/media_player/TTSService.kt index 46411fcc4..33dc4bd44 100644 --- a/domain/src/main/java/ireader/domain/services/tts_service/media_player/TTSService.kt +++ b/domain/src/main/java/ireader/domain/services/tts_service/media_player/TTSService.kt @@ -32,7 +32,7 @@ import kotlinx.coroutines.launch import kotlinx.datetime.Clock import ireader.common.models.entities.Book import ireader.domain.models.entities.CatalogLocal -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.core.log.Log import ireader.domain.catalogs.CatalogStore import ireader.domain.data.repository.BookRepository @@ -420,10 +420,10 @@ class TTSService : MediaBrowserServiceCompat(), AudioManager.OnAudioFocusChangeL * in notifications */ private fun setBundle( - book: Book? = state.ttsBook, - chapter: Chapter? = state.ttsChapter, - isLoading: Boolean = false, - error: Boolean = false + book: Book? = state.ttsBook, + chapter: Chapter? = state.ttsChapter, + isLoading: Boolean = false, + error: Boolean = false ) { val data = metadata .apply { diff --git a/domain/src/main/java/ireader/domain/usecases/backup/RestoreBackup.kt b/domain/src/main/java/ireader/domain/usecases/backup/RestoreBackup.kt index ebbc89e83..e9dec508c 100644 --- a/domain/src/main/java/ireader/domain/usecases/backup/RestoreBackup.kt +++ b/domain/src/main/java/ireader/domain/usecases/backup/RestoreBackup.kt @@ -4,7 +4,7 @@ import android.content.Context import android.net.Uri import ireader.common.models.entities.Book import ireader.common.models.entities.BookCategory -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.core.db.Transactions import ireader.domain.data.repository.BookCategoryRepository import ireader.domain.data.repository.BookRepository diff --git a/domain/src/main/java/ireader/domain/usecases/backup/backup/ChapterProto.kt b/domain/src/main/java/ireader/domain/usecases/backup/backup/ChapterProto.kt index 131daa654..dc070368b 100644 --- a/domain/src/main/java/ireader/domain/usecases/backup/backup/ChapterProto.kt +++ b/domain/src/main/java/ireader/domain/usecases/backup/backup/ChapterProto.kt @@ -2,7 +2,7 @@ package ireader.domain.usecases.backup.backup -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.core.source.model.decode import ireader.core.source.model.encode import kotlinx.serialization.Serializable diff --git a/domain/src/main/java/ireader/domain/usecases/epub/ImportEpub.kt b/domain/src/main/java/ireader/domain/usecases/epub/ImportEpub.kt index 6398f3d8c..1d98dd6a5 100644 --- a/domain/src/main/java/ireader/domain/usecases/epub/ImportEpub.kt +++ b/domain/src/main/java/ireader/domain/usecases/epub/ImportEpub.kt @@ -7,7 +7,7 @@ // import org.ireader.common_data.repository.BookRepository // import org.ireader.common_data.repository.ChapterRepository // import ireader.common.models.entities.Book -// import ireader.common.models.entities.Chapter +// import ireader.domain.models.entities.Chapter // import ireader.core.source.LocalSource // import ir.kazemcodes.epub.model.EpubBook // import java.io.File diff --git a/domain/src/main/java/ireader/domain/usecases/epub/importer/ImportEpub.kt b/domain/src/main/java/ireader/domain/usecases/epub/importer/ImportEpub.kt index 577b62baf..78f9fe0b3 100644 --- a/domain/src/main/java/ireader/domain/usecases/epub/importer/ImportEpub.kt +++ b/domain/src/main/java/ireader/domain/usecases/epub/importer/ImportEpub.kt @@ -3,7 +3,7 @@ package ireader.domain.usecases.epub.importer import android.content.Context import android.net.Uri import ireader.common.models.entities.Book -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.core.source.LocalSource import ireader.core.source.model.MangaInfo import ireader.domain.data.repository.BookRepository diff --git a/domain/src/main/java/ireader/domain/usecases/local/book_usecases/BookMarkChapterUseCase.kt b/domain/src/main/java/ireader/domain/usecases/local/book_usecases/BookMarkChapterUseCase.kt index 992772fa0..4af873658 100644 --- a/domain/src/main/java/ireader/domain/usecases/local/book_usecases/BookMarkChapterUseCase.kt +++ b/domain/src/main/java/ireader/domain/usecases/local/book_usecases/BookMarkChapterUseCase.kt @@ -1,6 +1,6 @@ package ireader.domain.usecases.local.book_usecases -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.domain.usecases.local.LocalInsertUseCases import org.koin.core.annotation.Factory @@ -9,7 +9,7 @@ class BookMarkChapterUseCase( private val insertUseCases: LocalInsertUseCases ) { - suspend fun bookMarkChapter(chapter:Chapter?):Chapter? { + suspend fun bookMarkChapter(chapter: Chapter?): Chapter? { chapter?.let { item -> insertUseCases.insertChapter(chapter.copy(bookmark = !item.bookmark)) return chapter.copy(bookmark = !item.bookmark) diff --git a/domain/src/main/java/ireader/domain/usecases/local/chapter_usecases/FindBooksByKey.kt b/domain/src/main/java/ireader/domain/usecases/local/chapter_usecases/FindBooksByKey.kt index d22b94e9e..88419c32c 100644 --- a/domain/src/main/java/ireader/domain/usecases/local/chapter_usecases/FindBooksByKey.kt +++ b/domain/src/main/java/ireader/domain/usecases/local/chapter_usecases/FindBooksByKey.kt @@ -1,6 +1,6 @@ package ireader.domain.usecases.local.chapter_usecases -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.domain.models.entities.History import ireader.domain.preferences.prefs.UiPreferences import ireader.domain.usecases.history.HistoryUseCase diff --git a/domain/src/main/java/ireader/domain/usecases/local/chapter_usecases/SubscribeChapterById.kt b/domain/src/main/java/ireader/domain/usecases/local/chapter_usecases/SubscribeChapterById.kt index 85811b753..c7e804e6b 100644 --- a/domain/src/main/java/ireader/domain/usecases/local/chapter_usecases/SubscribeChapterById.kt +++ b/domain/src/main/java/ireader/domain/usecases/local/chapter_usecases/SubscribeChapterById.kt @@ -1,6 +1,6 @@ package ireader.domain.usecases.local.chapter_usecases -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.domain.data.repository.ChapterRepository import ireader.i18n.LAST_CHAPTER import kotlinx.coroutines.flow.emptyFlow diff --git a/domain/src/main/java/ireader/domain/usecases/local/chapter_usecases/SubscribeChaptersByBookId.kt b/domain/src/main/java/ireader/domain/usecases/local/chapter_usecases/SubscribeChaptersByBookId.kt index e1caec793..c1e9cf39b 100644 --- a/domain/src/main/java/ireader/domain/usecases/local/chapter_usecases/SubscribeChaptersByBookId.kt +++ b/domain/src/main/java/ireader/domain/usecases/local/chapter_usecases/SubscribeChaptersByBookId.kt @@ -2,7 +2,7 @@ package ireader.domain.usecases.local.chapter_usecases import ireader.domain.data.repository.ChapterRepository import kotlinx.coroutines.flow.Flow -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import kotlinx.coroutines.flow.map diff --git a/domain/src/main/java/ireader/domain/usecases/local/delete_usecases/chapter/DeleteChapterByChapter.kt b/domain/src/main/java/ireader/domain/usecases/local/delete_usecases/chapter/DeleteChapterByChapter.kt index 5bcb2aae9..1eba275fe 100644 --- a/domain/src/main/java/ireader/domain/usecases/local/delete_usecases/chapter/DeleteChapterByChapter.kt +++ b/domain/src/main/java/ireader/domain/usecases/local/delete_usecases/chapter/DeleteChapterByChapter.kt @@ -1,7 +1,7 @@ package ireader.domain.usecases.local.delete_usecases.chapter import ireader.domain.data.repository.ChapterRepository -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter /** diff --git a/domain/src/main/java/ireader/domain/usecases/local/delete_usecases/chapter/DeleteChapters.kt b/domain/src/main/java/ireader/domain/usecases/local/delete_usecases/chapter/DeleteChapters.kt index c7a8b6e3b..07cf8af21 100644 --- a/domain/src/main/java/ireader/domain/usecases/local/delete_usecases/chapter/DeleteChapters.kt +++ b/domain/src/main/java/ireader/domain/usecases/local/delete_usecases/chapter/DeleteChapters.kt @@ -1,7 +1,7 @@ package ireader.domain.usecases.local.delete_usecases.chapter import ireader.domain.data.repository.ChapterRepository -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter class DeleteChapters(private val chapterRepository: ChapterRepository) { diff --git a/domain/src/main/java/ireader/domain/usecases/local/insert_usecases/InsertBooks.kt b/domain/src/main/java/ireader/domain/usecases/local/insert_usecases/InsertBooks.kt index a30058d4a..57b35e795 100644 --- a/domain/src/main/java/ireader/domain/usecases/local/insert_usecases/InsertBooks.kt +++ b/domain/src/main/java/ireader/domain/usecases/local/insert_usecases/InsertBooks.kt @@ -2,7 +2,7 @@ package ireader.domain.usecases.local.insert_usecases import ireader.domain.data.repository.BookRepository import ireader.common.models.entities.Book -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.domain.utils.extensions.withIOContext import org.koin.core.annotation.Factory diff --git a/domain/src/main/java/ireader/domain/usecases/local/insert_usecases/InsertChapter.kt b/domain/src/main/java/ireader/domain/usecases/local/insert_usecases/InsertChapter.kt index 4dca5ec53..717ef9ebb 100644 --- a/domain/src/main/java/ireader/domain/usecases/local/insert_usecases/InsertChapter.kt +++ b/domain/src/main/java/ireader/domain/usecases/local/insert_usecases/InsertChapter.kt @@ -1,6 +1,6 @@ package ireader.domain.usecases.local.insert_usecases -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.domain.data.repository.ChapterRepository import ireader.domain.utils.extensions.withIOContext import org.koin.core.annotation.Factory diff --git a/domain/src/main/java/ireader/domain/usecases/local/insert_usecases/InsertChapters.kt b/domain/src/main/java/ireader/domain/usecases/local/insert_usecases/InsertChapters.kt index f4743c5dd..c2aed3eb3 100644 --- a/domain/src/main/java/ireader/domain/usecases/local/insert_usecases/InsertChapters.kt +++ b/domain/src/main/java/ireader/domain/usecases/local/insert_usecases/InsertChapters.kt @@ -1,7 +1,7 @@ package ireader.domain.usecases.local.insert_usecases import ireader.domain.data.repository.ChapterRepository -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.domain.utils.extensions.withIOContext import org.koin.core.annotation.Factory diff --git a/domain/src/main/java/ireader/domain/usecases/remote/GetRemoteChapters.kt b/domain/src/main/java/ireader/domain/usecases/remote/GetRemoteChapters.kt index 25b1ec9ab..32ee0326c 100644 --- a/domain/src/main/java/ireader/domain/usecases/remote/GetRemoteChapters.kt +++ b/domain/src/main/java/ireader/domain/usecases/remote/GetRemoteChapters.kt @@ -2,8 +2,8 @@ package ireader.domain.usecases.remote import ireader.common.models.entities.Book import ireader.common.models.entities.Book.Companion.toBookInfo -import ireader.common.models.entities.Chapter -import ireader.common.models.entities.toChapter +import ireader.domain.models.entities.Chapter +import ireader.domain.models.entities.toChapter import ireader.core.log.Log import ireader.core.source.model.CommandList import ireader.domain.models.entities.CatalogLocal diff --git a/domain/src/main/java/ireader/domain/usecases/remote/GetRemoteReadingContent.kt b/domain/src/main/java/ireader/domain/usecases/remote/GetRemoteReadingContent.kt index b1b995f21..d67226d1b 100644 --- a/domain/src/main/java/ireader/domain/usecases/remote/GetRemoteReadingContent.kt +++ b/domain/src/main/java/ireader/domain/usecases/remote/GetRemoteReadingContent.kt @@ -1,8 +1,8 @@ package ireader.domain.usecases.remote import ireader.domain.models.entities.CatalogLocal -import ireader.common.models.entities.Chapter -import ireader.common.models.entities.toChapterInfo +import ireader.domain.models.entities.Chapter +import ireader.domain.models.entities.toChapterInfo import ireader.core.source.model.CommandList import ireader.domain.R import ireader.domain.utils.exceptionHandler @@ -15,11 +15,11 @@ import org.koin.core.annotation.Factory @Factory class GetRemoteReadingContent() { suspend operator fun invoke( - chapter: Chapter, - catalog: CatalogLocal?, - onError: suspend (message: UiText?) -> Unit, - onSuccess: suspend (chapter: Chapter) -> Unit, - commands: CommandList = emptyList() + chapter: Chapter, + catalog: CatalogLocal?, + onError: suspend (message: UiText?) -> Unit, + onSuccess: suspend (chapter: Chapter) -> Unit, + commands: CommandList = emptyList() ) { val source = catalog?.source ?: throw SourceNotFoundException() withIOContext { diff --git a/gradle/kotlinx.versions.toml b/gradle/kotlinx.versions.toml index 97ade4824..297ee3f7c 100644 --- a/gradle/kotlinx.versions.toml +++ b/gradle/kotlinx.versions.toml @@ -24,7 +24,7 @@ datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "d ksp-api = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" } ksp-gradle = { module = "com.google.devtools.ksp:symbol-processing-gradle-plugin", version.ref = "ksp" } [plugins] -dokka = { id = "org.jetbrains.dokka", version = "1.7.10" } +dokka = { id = "org.jetbrains.dokka", version.ref = "kotlin" } kotlinSerilization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e763dc884..598a3303a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,7 +14,7 @@ koinCompose = "3.2.2" ideaExt = "1.1.6" sqldelight = "1.5.4" detekt = "1.21.0" -exoplayer="1.0.0-beta02" +exoplayer="1.0.0-beta03" [libraries] diff --git a/presentation/src/main/java/ireader/presentation/ui/book/BookDetailScreen.kt b/presentation/src/main/java/ireader/presentation/ui/book/BookDetailScreen.kt index 89aab786f..d0d59b660 100644 --- a/presentation/src/main/java/ireader/presentation/ui/book/BookDetailScreen.kt +++ b/presentation/src/main/java/ireader/presentation/ui/book/BookDetailScreen.kt @@ -32,7 +32,7 @@ import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.lifecycle.viewModelScope import ireader.common.models.entities.Book -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.core.source.Source import ireader.domain.preferences.prefs.ChapterDisplayMode import ireader.presentation.R @@ -55,27 +55,27 @@ import kotlinx.coroutines.launch ) @Composable fun BookDetailScreen( - modifier: Modifier = Modifier, - vm: BookDetailViewModel, - modalBottomSheetState: ModalBottomSheetState, - onSummaryExpand: () -> Unit, - onSwipeRefresh: () -> Unit, - book: Book, - onTitle: (String) -> Unit, - snackBarHostState: SnackbarHostState, - source: Source?, - isSummaryExpanded: Boolean, - appbarPadding: Dp, - onItemClick: (Chapter) -> Unit, - onLongItemClick: (Chapter) -> Unit, - onRead: () -> Unit, - onSortClick: () -> Unit, - chapters: State>, - scrollState: LazyListState, - onMap: () -> Unit, - onFavorite: () -> Unit, - onWebView: () -> Unit, - controller: Controller + modifier: Modifier = Modifier, + vm: BookDetailViewModel, + modalBottomSheetState: ModalBottomSheetState, + onSummaryExpand: () -> Unit, + onSwipeRefresh: () -> Unit, + book: Book, + onTitle: (String) -> Unit, + snackBarHostState: SnackbarHostState, + source: Source?, + isSummaryExpanded: Boolean, + appbarPadding: Dp, + onItemClick: (Chapter) -> Unit, + onLongItemClick: (Chapter) -> Unit, + onRead: () -> Unit, + onSortClick: () -> Unit, + chapters: State>, + scrollState: LazyListState, + onMap: () -> Unit, + onFavorite: () -> Unit, + onWebView: () -> Unit, + controller: Controller ) { val context = LocalContext.current val refreshing = remember { diff --git a/presentation/src/main/java/ireader/presentation/ui/book/components/ChapterBar.kt b/presentation/src/main/java/ireader/presentation/ui/book/components/ChapterBar.kt index a748467fd..eeebe8d6f 100644 --- a/presentation/src/main/java/ireader/presentation/ui/book/components/ChapterBar.kt +++ b/presentation/src/main/java/ireader/presentation/ui/book/components/ChapterBar.kt @@ -16,17 +16,17 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.presentation.R import ireader.presentation.ui.book.viewmodel.BookDetailViewModel import ireader.presentation.ui.component.reusable_composable.AppIconButton @Composable fun ChapterBar( - vm: BookDetailViewModel, - chapters:List, - onMap: () -> Unit, - onSortClick: () -> Unit + vm: BookDetailViewModel, + chapters:List, + onMap: () -> Unit, + onSortClick: () -> Unit ) { Row( modifier = Modifier diff --git a/presentation/src/main/java/ireader/presentation/ui/book/components/ChapterContentHeader.kt b/presentation/src/main/java/ireader/presentation/ui/book/components/ChapterContentHeader.kt index a808081bf..f48f2947d 100644 --- a/presentation/src/main/java/ireader/presentation/ui/book/components/ChapterContentHeader.kt +++ b/presentation/src/main/java/ireader/presentation/ui/book/components/ChapterContentHeader.kt @@ -12,7 +12,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.presentation.ui.component.loading.DotsFlashing import ireader.presentation.ui.component.text_related.CardTile diff --git a/presentation/src/main/java/ireader/presentation/ui/book/viewmodel/BookDetailViewModel.kt b/presentation/src/main/java/ireader/presentation/ui/book/viewmodel/BookDetailViewModel.kt index c142008b8..ce86c6334 100644 --- a/presentation/src/main/java/ireader/presentation/ui/book/viewmodel/BookDetailViewModel.kt +++ b/presentation/src/main/java/ireader/presentation/ui/book/viewmodel/BookDetailViewModel.kt @@ -12,7 +12,7 @@ import androidx.compose.runtime.setValue import androidx.lifecycle.viewModelScope import ireader.common.models.entities.Book import ireader.domain.models.entities.CatalogLocal -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.core.log.Log import ireader.core.source.model.CommandList import ireader.domain.catalogs.interactor.GetLocalCatalog diff --git a/presentation/src/main/java/ireader/presentation/ui/book/viewmodel/ChapterState.kt b/presentation/src/main/java/ireader/presentation/ui/book/viewmodel/ChapterState.kt index b323afe16..4b3198e40 100644 --- a/presentation/src/main/java/ireader/presentation/ui/book/viewmodel/ChapterState.kt +++ b/presentation/src/main/java/ireader/presentation/ui/book/viewmodel/ChapterState.kt @@ -6,7 +6,7 @@ import androidx.compose.runtime.mutableStateListOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue import androidx.compose.runtime.snapshots.SnapshotStateList -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import org.koin.core.annotation.Factory @Factory diff --git a/presentation/src/main/java/ireader/presentation/ui/component/components/ChapterItemListComposable.kt b/presentation/src/main/java/ireader/presentation/ui/component/components/ChapterItemListComposable.kt index b554c5dfa..88554b7a2 100644 --- a/presentation/src/main/java/ireader/presentation/ui/component/components/ChapterItemListComposable.kt +++ b/presentation/src/main/java/ireader/presentation/ui/component/components/ChapterItemListComposable.kt @@ -20,7 +20,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.text.buildAnnotatedString import androidx.compose.ui.unit.dp -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.presentation.ui.core.modifier.selectedBackground import ireader.domain.models.prefs.PreferenceValues import ireader.domain.utils.extensions.asRelativeTimeString @@ -30,14 +30,14 @@ import ireader.domain.utils.extensions.toLocalDate @OptIn(ExperimentalFoundationApi::class) @Composable fun ChapterRow( - modifier: Modifier = Modifier, - chapter: Chapter, - onItemClick: () -> Unit, - onLongClick: () -> Unit = {}, - isLastRead: Boolean = false, - isSelected: Boolean = false, - isLoading: Boolean = false, - showNumber: Boolean = true, + modifier: Modifier = Modifier, + chapter: Chapter, + onItemClick: () -> Unit, + onLongClick: () -> Unit = {}, + isLastRead: Boolean = false, + isSelected: Boolean = false, + isLoading: Boolean = false, + showNumber: Boolean = true, ) { Row( modifier = Modifier diff --git a/presentation/src/main/java/ireader/presentation/ui/home/tts/TTSScreen.kt b/presentation/src/main/java/ireader/presentation/ui/home/tts/TTSScreen.kt index 22f6400d7..a6fdd3c0b 100644 --- a/presentation/src/main/java/ireader/presentation/ui/home/tts/TTSScreen.kt +++ b/presentation/src/main/java/ireader/presentation/ui/home/tts/TTSScreen.kt @@ -39,7 +39,7 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.google.accompanist.pager.ExperimentalPagerApi -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.core.source.Source import ireader.presentation.ui.core.modifier.clickableNoIndication import ireader.domain.models.prefs.mapAlignment @@ -54,16 +54,16 @@ import ireader.presentation.ui.component.reusable_composable.SuperSmallTextCompo @OptIn(ExperimentalMaterialApi::class, ExperimentalPagerApi::class, ExperimentalMaterial3Api::class) @Composable fun TTSScreen( - modifier: Modifier = Modifier, - vm: TTSViewModel, - source: Source?, - drawerState: DrawerState, - onChapter: (Chapter) -> Unit, - onPopStack: () -> Unit, - onPlay: () -> Unit, - bottomSheetState: ModalBottomSheetState, - lazyState: LazyListState, - paddingValues: PaddingValues + modifier: Modifier = Modifier, + vm: TTSViewModel, + source: Source?, + drawerState: DrawerState, + onChapter: (Chapter) -> Unit, + onPopStack: () -> Unit, + onPlay: () -> Unit, + bottomSheetState: ModalBottomSheetState, + lazyState: LazyListState, + paddingValues: PaddingValues ) { val gradient = Brush.verticalGradient( colors = listOf( diff --git a/presentation/src/main/java/ireader/presentation/ui/home/tts/TTSViewModel.kt b/presentation/src/main/java/ireader/presentation/ui/home/tts/TTSViewModel.kt index 6ae4699a4..857fea049 100644 --- a/presentation/src/main/java/ireader/presentation/ui/home/tts/TTSViewModel.kt +++ b/presentation/src/main/java/ireader/presentation/ui/home/tts/TTSViewModel.kt @@ -12,7 +12,7 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue import androidx.lifecycle.viewModelScope -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.presentation.ui.core.viewmodel.BaseViewModel import ireader.domain.catalogs.interactor.GetLocalCatalog import ireader.domain.preferences.prefs.ReaderPreferences @@ -288,7 +288,7 @@ class TTSViewModel( } private suspend fun getRemoteChapter( - chapter: Chapter, + chapter: Chapter, ) { val catalog = ttsState.ttsCatalog remoteUseCases.getRemoteReadingContent( diff --git a/presentation/src/main/java/ireader/presentation/ui/home/updates/viewmodel/UpdatesViewModel.kt b/presentation/src/main/java/ireader/presentation/ui/home/updates/viewmodel/UpdatesViewModel.kt index b58a66989..d567d3b7a 100644 --- a/presentation/src/main/java/ireader/presentation/ui/home/updates/viewmodel/UpdatesViewModel.kt +++ b/presentation/src/main/java/ireader/presentation/ui/home/updates/viewmodel/UpdatesViewModel.kt @@ -2,7 +2,7 @@ package ireader.presentation.ui.home.updates.viewmodel import androidx.compose.runtime.getValue import androidx.lifecycle.viewModelScope -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.common.models.entities.UpdatesWithRelations import ireader.domain.preferences.prefs.UiPreferences import ireader.presentation.ui.core.viewmodel.BaseViewModel diff --git a/presentation/src/main/java/ireader/presentation/ui/reader/ReaderScreen.kt b/presentation/src/main/java/ireader/presentation/ui/reader/ReaderScreen.kt index a911b88b8..1ea359af5 100644 --- a/presentation/src/main/java/ireader/presentation/ui/reader/ReaderScreen.kt +++ b/presentation/src/main/java/ireader/presentation/ui/reader/ReaderScreen.kt @@ -30,7 +30,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.domain.preferences.prefs.ReadingMode import ireader.presentation.ui.reader.components.MainBottomSettingComposable import ireader.presentation.ui.reader.custom.WebView @@ -45,22 +45,22 @@ import kotlinx.coroutines.launch ) @Composable fun ReadingScreen( - vm: ReaderScreenViewModel, - scrollState: ScrollState, - lazyListState: LazyListState, - swipeState: SwipeRefreshState, - onNext: (reset: Boolean) -> Unit, - onPrev: (reset: Boolean) -> Unit, - readerScreenPreferencesState: ReaderScreenViewModel, - toggleReaderMode: () -> Unit, - onBackgroundColorAndTextColorApply: (bgColor: String, txtColor: String) -> Unit, - snackBarHostState: SnackbarHostState, - drawerState: DrawerState, - onReaderBottomOnSetting: () -> Unit, - onSliderFinished: () -> Unit, - onSliderChange: (index: Float) -> Unit, - onReaderPlay: () -> Unit, - onChapterShown: (chapter: Chapter) -> Unit, + vm: ReaderScreenViewModel, + scrollState: ScrollState, + lazyListState: LazyListState, + swipeState: SwipeRefreshState, + onNext: (reset: Boolean) -> Unit, + onPrev: (reset: Boolean) -> Unit, + readerScreenPreferencesState: ReaderScreenViewModel, + toggleReaderMode: () -> Unit, + onBackgroundColorAndTextColorApply: (bgColor: String, txtColor: String) -> Unit, + snackBarHostState: SnackbarHostState, + drawerState: DrawerState, + onReaderBottomOnSetting: () -> Unit, + onSliderFinished: () -> Unit, + onSliderChange: (index: Float) -> Unit, + onReaderPlay: () -> Unit, + onChapterShown: (chapter: Chapter) -> Unit, ) { val modalBottomSheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden) diff --git a/presentation/src/main/java/ireader/presentation/ui/reader/ReaderScreenDrawer.kt b/presentation/src/main/java/ireader/presentation/ui/reader/ReaderScreenDrawer.kt index 734600925..8ac2c0246 100644 --- a/presentation/src/main/java/ireader/presentation/ui/reader/ReaderScreenDrawer.kt +++ b/presentation/src/main/java/ireader/presentation/ui/reader/ReaderScreenDrawer.kt @@ -21,7 +21,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.presentation.R import ireader.presentation.ui.component.components.ChapterRow import ireader.presentation.ui.component.list.scrollbars.VerticalFastScroller @@ -32,15 +32,15 @@ import ireader.presentation.ui.component.text_related.ErrorTextWithEmojis @OptIn(ExperimentalAnimationApi::class) @Composable fun ReaderScreenDrawer( - modifier: Modifier = Modifier, - relativeTime: Int = 0, - dateFormat: String = "", - chapter: Chapter?, - onChapter: (chapter: Chapter) -> Unit, - chapters: List, - onReverseIcon: () -> Unit, - drawerScrollState: LazyListState, - onMap: (LazyListState) -> Unit, + modifier: Modifier = Modifier, + relativeTime: Int = 0, + dateFormat: String = "", + chapter: Chapter?, + onChapter: (chapter: Chapter) -> Unit, + chapters: List, + onReverseIcon: () -> Unit, + drawerScrollState: LazyListState, + onMap: (LazyListState) -> Unit, ) { Column( modifier = modifier.fillMaxWidth(.9f), diff --git a/presentation/src/main/java/ireader/presentation/ui/reader/ReaderScreenTopBar.kt b/presentation/src/main/java/ireader/presentation/ui/reader/ReaderScreenTopBar.kt index f2051fbeb..fdaeb3038 100644 --- a/presentation/src/main/java/ireader/presentation/ui/reader/ReaderScreenTopBar.kt +++ b/presentation/src/main/java/ireader/presentation/ui/reader/ReaderScreenTopBar.kt @@ -22,7 +22,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.presentation.ui.component.components.Toolbar import ireader.presentation.ui.component.reusable_composable.AppIconButton import ireader.presentation.ui.component.reusable_composable.TopAppBarBackButton @@ -33,17 +33,17 @@ import ireader.presentation.ui.reader.viewmodel.ReaderScreenViewModel @OptIn(ExperimentalMaterialApi::class, ExperimentalMaterial3Api::class) @Composable fun ReaderScreenTopBar( - modifier: Modifier, - isReaderModeEnable: Boolean, - vm: ReaderScreenViewModel, - state: ReaderScreenState, - modalBottomSheetValue: ModalBottomSheetValue, - chapter: Chapter?, - onRefresh: () -> Unit, - onWebView: () -> Unit, - onBookMark: () -> Unit, - onPopBackStack: () -> Unit, - isLoaded: Boolean = false, + modifier: Modifier, + isReaderModeEnable: Boolean, + vm: ReaderScreenViewModel, + state: ReaderScreenState, + modalBottomSheetValue: ModalBottomSheetValue, + chapter: Chapter?, + onRefresh: () -> Unit, + onWebView: () -> Unit, + onBookMark: () -> Unit, + onPopBackStack: () -> Unit, + isLoaded: Boolean = false, ) { AnimatedVisibility( diff --git a/presentation/src/main/java/ireader/presentation/ui/reader/ReaderText.kt b/presentation/src/main/java/ireader/presentation/ui/reader/ReaderText.kt index dbf660aea..acad86a22 100644 --- a/presentation/src/main/java/ireader/presentation/ui/reader/ReaderText.kt +++ b/presentation/src/main/java/ireader/presentation/ui/reader/ReaderText.kt @@ -41,7 +41,7 @@ import androidx.compose.ui.unit.sp import coil.compose.AsyncImage import coil.request.CachePolicy import coil.request.ImageRequest -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.core.source.model.ImageUrl import ireader.core.source.model.Page import ireader.core.source.model.Text @@ -60,17 +60,17 @@ import kotlinx.coroutines.launch @OptIn(ExperimentalMaterialApi::class) @Composable fun ReaderText( - modifier: Modifier = Modifier, - vm: ReaderScreenViewModel, - uiState: ReaderScreenState, - onNext: () -> Unit, - onPrev: () -> Unit, - swipeState: SwipeRefreshState, - scrollState: ScrollState, - lazyListState: LazyListState, - modalState: ModalBottomSheetState, - toggleReaderMode: () -> Unit, - onChapterShown: (chapter: Chapter) -> Unit, + modifier: Modifier = Modifier, + vm: ReaderScreenViewModel, + uiState: ReaderScreenState, + onNext: () -> Unit, + onPrev: () -> Unit, + swipeState: SwipeRefreshState, + scrollState: ScrollState, + lazyListState: LazyListState, + modalState: ModalBottomSheetState, + toggleReaderMode: () -> Unit, + onChapterShown: (chapter: Chapter) -> Unit, ) { val interactionSource = remember { MutableInteractionSource() } @@ -304,15 +304,15 @@ private fun MainText( @Composable private fun ContinuesReaderPage( - modifier: Modifier = Modifier, - interactionSource: MutableInteractionSource, - scrollState: LazyListState, - vm: ReaderScreenViewModel, - maxHeight: Float, - onPrev: () -> Unit, - onNext: () -> Unit, - toggleReaderMode: () -> Unit, - onChapterShown: (chapter: Chapter) -> Unit, + modifier: Modifier = Modifier, + interactionSource: MutableInteractionSource, + scrollState: LazyListState, + vm: ReaderScreenViewModel, + maxHeight: Float, + onPrev: () -> Unit, + onNext: () -> Unit, + toggleReaderMode: () -> Unit, + onChapterShown: (chapter: Chapter) -> Unit, ) { var lastChapterId: Chapter? by remember { mutableStateOf(null) diff --git a/presentation/src/main/java/ireader/presentation/ui/reader/components/ChaptersSliderComposable.kt b/presentation/src/main/java/ireader/presentation/ui/reader/components/ChaptersSliderComposable.kt index a31a94fed..f77027293 100644 --- a/presentation/src/main/java/ireader/presentation/ui/reader/components/ChaptersSliderComposable.kt +++ b/presentation/src/main/java/ireader/presentation/ui/reader/components/ChaptersSliderComposable.kt @@ -16,19 +16,19 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextOverflow -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.presentation.ui.component.reusable_composable.AppIcon @Composable fun ChaptersSliderComposable( - modifier: Modifier = Modifier, - currentChapter: Chapter?, - currentChapterIndex: Int, - chapters: List, - onPrev: () -> Unit, - onNext: () -> Unit, - onSliderChange: (index: Float) -> Unit, - onSliderDragFinished: () -> Unit, + modifier: Modifier = Modifier, + currentChapter: Chapter?, + currentChapterIndex: Int, + chapters: List, + onPrev: () -> Unit, + onNext: () -> Unit, + onSliderChange: (index: Float) -> Unit, + onSliderDragFinished: () -> Unit, ) { Column(modifier = modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) { Text( diff --git a/presentation/src/main/java/ireader/presentation/ui/reader/components/MainBottonSettingComposable.kt b/presentation/src/main/java/ireader/presentation/ui/reader/components/MainBottonSettingComposable.kt index 5a3e9844a..12961cfee 100644 --- a/presentation/src/main/java/ireader/presentation/ui/reader/components/MainBottonSettingComposable.kt +++ b/presentation/src/main/java/ireader/presentation/ui/reader/components/MainBottonSettingComposable.kt @@ -15,7 +15,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.presentation.ui.component.reusable_composable.AppIconButton import ireader.presentation.R @@ -23,18 +23,18 @@ import ireader.presentation.R @OptIn(ExperimentalMaterial3Api::class) @Composable fun MainBottomSettingComposable( - modifier: Modifier = Modifier, - scope: CoroutineScope, - drawerState: DrawerState, - chapters: List, - chapter: Chapter?, - currentChapterIndex: Int, - onSetting: () -> Unit, - onNext: () -> Unit, - onPrev: () -> Unit, - onPlay: () -> Unit, - onSliderFinished: () -> Unit, - onSliderChange: (index: Float) -> Unit, + modifier: Modifier = Modifier, + scope: CoroutineScope, + drawerState: DrawerState, + chapters: List, + chapter: Chapter?, + currentChapterIndex: Int, + onSetting: () -> Unit, + onNext: () -> Unit, + onPrev: () -> Unit, + onPlay: () -> Unit, + onSliderFinished: () -> Unit, + onSliderChange: (index: Float) -> Unit, ) { ChaptersSliderComposable( onNext = { diff --git a/presentation/src/main/java/ireader/presentation/ui/reader/viewmodel/ReaderScreenState.kt b/presentation/src/main/java/ireader/presentation/ui/reader/viewmodel/ReaderScreenState.kt index 84ec87910..b3a4de52c 100644 --- a/presentation/src/main/java/ireader/presentation/ui/reader/viewmodel/ReaderScreenState.kt +++ b/presentation/src/main/java/ireader/presentation/ui/reader/viewmodel/ReaderScreenState.kt @@ -12,7 +12,7 @@ import androidx.compose.runtime.setValue import androidx.compose.runtime.snapshots.SnapshotStateList import ireader.common.models.entities.Book import ireader.domain.models.entities.CatalogLocal -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.core.source.Source import ireader.core.source.model.Page import org.koin.core.annotation.Factory diff --git a/presentation/src/main/java/ireader/presentation/ui/reader/viewmodel/ReaderScreenViewModel.kt b/presentation/src/main/java/ireader/presentation/ui/reader/viewmodel/ReaderScreenViewModel.kt index 18d832b2b..1966f7bdb 100644 --- a/presentation/src/main/java/ireader/presentation/ui/reader/viewmodel/ReaderScreenViewModel.kt +++ b/presentation/src/main/java/ireader/presentation/ui/reader/viewmodel/ReaderScreenViewModel.kt @@ -13,7 +13,7 @@ import androidx.compose.ui.text.ExperimentalTextApi import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.viewModelScope -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.core.http.WebViewManger import ireader.core.source.model.Text import ireader.domain.catalogs.interactor.GetLocalCatalog @@ -217,7 +217,7 @@ class ReaderScreenViewModel( } private suspend fun getRemoteChapter( - chapter: Chapter, + chapter: Chapter, ) { val catalog = catalog remoteUseCases.getRemoteReadingContent( diff --git a/presentation/src/main/java/ireader/presentation/ui/video/VideoPlayerViewModel.kt b/presentation/src/main/java/ireader/presentation/ui/video/VideoPlayerViewModel.kt index 8152d4f9f..c8ae6f7a9 100644 --- a/presentation/src/main/java/ireader/presentation/ui/video/VideoPlayerViewModel.kt +++ b/presentation/src/main/java/ireader/presentation/ui/video/VideoPlayerViewModel.kt @@ -4,9 +4,8 @@ import androidx.compose.runtime.* import androidx.compose.ui.text.ExperimentalTextApi import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.viewModelScope -import androidx.media3.common.* import androidx.media3.exoplayer.ExoPlayer -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.core.http.HttpClients import ireader.core.log.Log import ireader.core.source.HttpSource @@ -27,12 +26,10 @@ import ireader.presentation.ui.video.component.core.toSubtitleData import ireader.presentation.ui.video.component.cores.PlayerSubtitleHelper.Companion.toSubtitleMimeType import ireader.presentation.ui.video.component.cores.SubtitleData import ireader.presentation.ui.video.component.cores.SubtitleOrigin -import ireader.presentation.ui.video.component.cores.player.* import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import org.koin.android.annotation.KoinViewModel -import java.util.* @OptIn(ExperimentalTextApi::class) @KoinViewModel diff --git a/presentation/src/main/java/ireader/presentation/ui/web/WebViewViewModel.kt b/presentation/src/main/java/ireader/presentation/ui/web/WebViewViewModel.kt index 20406c6d0..9bbb39efa 100644 --- a/presentation/src/main/java/ireader/presentation/ui/web/WebViewViewModel.kt +++ b/presentation/src/main/java/ireader/presentation/ui/web/WebViewViewModel.kt @@ -11,7 +11,7 @@ import androidx.lifecycle.viewModelScope import com.google.accompanist.web.WebViewState import ireader.common.models.entities.Book import ireader.domain.models.entities.CatalogLocal -import ireader.common.models.entities.Chapter +import ireader.domain.models.entities.Chapter import ireader.i18n.UiText import ireader.core.source.model.Command import ireader.presentation.ui.core.viewmodel.BaseViewModel @@ -110,8 +110,8 @@ class WebViewPageModel( @OptIn(ExperimentalCoroutinesApi::class) fun getContentFromWebView( - chapter: Chapter, - webView: WebView, + chapter: Chapter, + webView: WebView, ) { val catalog = catalog viewModelScope.launch {