phase 0: fork Episteme, rename package to org.dueattendant149.bookreader

- Cloned from Aryan-Raj3112/episteme (AGPL-3.0)
- Package: com.aryan.reader → org.dueattendant149.bookreader
- Application ID: org.dueattendant149.bookreader
- Added AGENTS.md with migration plan
- Upstream: github.com/Aryan-Raj3112/episteme
- Origin: git.dueattendant149.org/Atte149/book-reader
This commit is contained in:
Atte149 2026-06-24 00:33:58 +03:00
parent e615128a23
commit 5f64f3d722
631 changed files with 3082 additions and 3006 deletions

View file

@ -1,42 +0,0 @@
package com.aryan.reader
import com.aryan.reader.data.RecentFileItem
import com.aryan.reader.shared.ReaderFeatureSurface
import com.aryan.reader.shared.ReaderPlatform
import com.aryan.reader.shared.SharedFileCapabilities
typealias AddBooksSource = com.aryan.reader.shared.AddBooksSource
typealias FileType = com.aryan.reader.shared.FileType
typealias RenderMode = com.aryan.reader.shared.RenderMode
typealias SortOrder = com.aryan.reader.shared.SortOrder
typealias ReadStatusFilter = com.aryan.reader.shared.ReadStatusFilter
typealias LibraryFilters = com.aryan.reader.shared.LibraryFilters
typealias SyncedFolder = com.aryan.reader.shared.SyncedFolder
typealias ShelfType = com.aryan.reader.shared.ShelfType
internal val ANDROID_READABLE_FILE_TYPES = SharedFileCapabilities.readableTypesFor(ReaderPlatform.ANDROID)
internal val ANDROID_SYNCABLE_FILE_TYPES = SharedFileCapabilities.syncableTypesFor(ReaderPlatform.ANDROID)
internal val COMIC_ARCHIVE_FILE_TYPES = SharedFileCapabilities.comicArchiveTypes
internal val PDF_VIEWER_FILE_TYPES = com.aryan.reader.shared.PDF_VIEWER_FILE_TYPES
internal val EPUB_READER_FILE_TYPES = com.aryan.reader.shared.EPUB_READER_FILE_TYPES
internal fun FileType.readerSurfaceOnAndroid(): ReaderFeatureSurface? {
return SharedFileCapabilities.surfaceFor(this, ReaderPlatform.ANDROID)
}
data class Shelf(
val id: String,
val name: String,
val type: ShelfType,
val books: List<RecentFileItem>,
val directBooks: List<RecentFileItem> = books,
val parentShelfId: String? = null,
val childShelfIds: List<String> = emptyList(),
val depth: Int = 0,
val sortKey: String = name.lowercase()
) {
val bookCount: Int get() = books.size
val topBook: RecentFileItem? by lazy(LazyThreadSafetyMode.NONE) { books.maxByOrNull { it.timestamp } }
val directBookCount: Int get() = directBooks.size
val childShelfCount: Int get() = childShelfIds.size
}

View file

@ -1,20 +0,0 @@
package com.aryan.reader.data
import com.aryan.reader.toSharedBookItem
import com.aryan.reader.shared.SmartCollectionEngine as SharedSmartCollectionEngine
typealias SmartField = com.aryan.reader.shared.SmartField
typealias SmartOperator = com.aryan.reader.shared.SmartOperator
typealias SmartRule = com.aryan.reader.shared.SmartRule
typealias SmartCollectionDefinition = com.aryan.reader.shared.SmartCollectionDefinition
object SmartCollectionEngine {
fun toJson(definition: SmartCollectionDefinition): String =
SharedSmartCollectionEngine.toJson(definition)
fun fromJson(json: String?): SmartCollectionDefinition? =
SharedSmartCollectionEngine.fromJson(json)
fun evaluate(book: RecentFileItem, definition: SmartCollectionDefinition): Boolean =
SharedSmartCollectionEngine.evaluate(book.toSharedBookItem(), definition)
}

View file

@ -1,10 +0,0 @@
package com.aryan.reader.opds
typealias OpdsCatalog = com.aryan.reader.shared.opds.OpdsCatalog
typealias OpdsFacet = com.aryan.reader.shared.opds.OpdsFacet
typealias OpdsFeed = com.aryan.reader.shared.opds.OpdsFeed
typealias OpdsAuthor = com.aryan.reader.shared.opds.OpdsAuthor
typealias OpdsAcquisition = com.aryan.reader.shared.opds.OpdsAcquisition
typealias OpdsEntry = com.aryan.reader.shared.opds.OpdsEntry
typealias OpdsDownloadState = com.aryan.reader.shared.opds.SharedOpdsDownloadState
typealias OpdsScreenState = com.aryan.reader.shared.opds.SharedOpdsScreenState

View file

@ -1,3 +0,0 @@
package com.aryan.reader.opds
typealias OpdsParser = com.aryan.reader.shared.opds.SharedOpdsParser

View file

@ -1,8 +0,0 @@
package com.aryan.reader.tts
const val ACTION_OPEN_TTS_SESSION = "com.aryan.reader.tts.OPEN_SESSION"
const val EXTRA_TTS_BOOK_ID = "com.aryan.reader.tts.extra.BOOK_ID"
const val EXTRA_TTS_CHAPTER_INDEX = "com.aryan.reader.tts.extra.CHAPTER_INDEX"
const val EXTRA_TTS_SOURCE_CFI = "com.aryan.reader.tts.extra.SOURCE_CFI"
const val EXTRA_TTS_START_OFFSET = "com.aryan.reader.tts.extra.START_OFFSET"
const val EXTRA_TTS_PAGE_INDEX = "com.aryan.reader.tts.extra.PAGE_INDEX"

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column

View file

@ -1,8 +1,8 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import android.net.Uri
import androidx.core.net.toUri
import com.aryan.reader.data.RecentFileItem
import org.dueattendant149.bookreader.data.RecentFileItem
import timber.log.Timber
class AndroidFolderPathResolver : FolderPathResolver {

View file

@ -1,8 +1,8 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import com.aryan.reader.shared.SharedFeaturePolicy
import com.aryan.reader.shared.SharedSettingsHubInput
import com.aryan.reader.shared.SharedSettingsPlatform
import org.dueattendant149.bookreader.shared.SharedFeaturePolicy
import org.dueattendant149.bookreader.shared.SharedSettingsHubInput
import org.dueattendant149.bookreader.shared.SharedSettingsPlatform
fun androidSettingsHubInput(
uiState: ReaderScreenState,

View file

@ -1,14 +1,14 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import com.aryan.reader.data.RecentFileItem
import com.aryan.reader.data.TagEntity
import com.aryan.reader.shared.AppAction as SharedAppAction
import com.aryan.reader.shared.LibraryAction as SharedLibraryAction
import com.aryan.reader.shared.SharedFolderPathResolver
import com.aryan.reader.shared.SharedLibraryProjectionInput
import com.aryan.reader.shared.SharedLibraryStateProjector
import com.aryan.reader.shared.SharedReaderScreenState
import com.aryan.reader.shared.reduce
import org.dueattendant149.bookreader.data.RecentFileItem
import org.dueattendant149.bookreader.data.TagEntity
import org.dueattendant149.bookreader.shared.AppAction as SharedAppAction
import org.dueattendant149.bookreader.shared.LibraryAction as SharedLibraryAction
import org.dueattendant149.bookreader.shared.SharedFolderPathResolver
import org.dueattendant149.bookreader.shared.SharedLibraryProjectionInput
import org.dueattendant149.bookreader.shared.SharedLibraryStateProjector
import org.dueattendant149.bookreader.shared.SharedReaderScreenState
import org.dueattendant149.bookreader.shared.reduce
internal object AndroidSharedStateBridge {
fun prepareLibraryProjection(

View file

@ -1,8 +1,8 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import com.aryan.reader.data.CustomFontEntity
import org.dueattendant149.bookreader.data.CustomFontEntity
import java.io.File
fun AppFontPreference.toAndroidAppFontFamily(customFonts: List<CustomFontEntity>): FontFamily? {

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader
package org.dueattendant149.bookreader
import android.os.Build
import timber.log.Timber
@ -59,14 +59,14 @@ import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.currentBackStackEntryAsState
import com.aryan.reader.epubreader.EpubReaderScreen
import com.aryan.reader.feedback.FeedbackScreen
import com.aryan.reader.feedback.SupportProjectScreen
import com.aryan.reader.pdf.PdfViewerScreen
import com.aryan.reader.shared.ReaderFeatureSurface
import com.aryan.reader.tts.ReaderTtsMiniBar
import com.aryan.reader.tts.readerTtsMiniBarBottomPaddingDp
import com.aryan.reader.tts.shouldShowReaderTtsMiniBar
import org.dueattendant149.bookreader.epubreader.EpubReaderScreen
import org.dueattendant149.bookreader.feedback.FeedbackScreen
import org.dueattendant149.bookreader.feedback.SupportProjectScreen
import org.dueattendant149.bookreader.pdf.PdfViewerScreen
import org.dueattendant149.bookreader.shared.ReaderFeatureSurface
import org.dueattendant149.bookreader.tts.ReaderTtsMiniBar
import org.dueattendant149.bookreader.tts.readerTtsMiniBarBottomPaddingDp
import org.dueattendant149.bookreader.tts.shouldShowReaderTtsMiniBar
import kotlinx.coroutines.delay
object AppDestinations {

View file

@ -1,20 +1,20 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import android.net.Uri
import com.aryan.reader.data.RecentFileItem
import com.aryan.reader.data.TagEntity
import com.aryan.reader.epub.CalibreBundleResult
import com.aryan.reader.epub.EpubBook
import com.aryan.reader.paginatedreader.Locator
import org.dueattendant149.bookreader.data.RecentFileItem
import org.dueattendant149.bookreader.data.TagEntity
import org.dueattendant149.bookreader.epub.CalibreBundleResult
import org.dueattendant149.bookreader.epub.EpubBook
import org.dueattendant149.bookreader.paginatedreader.Locator
import java.util.Date
typealias BannerMessage = com.aryan.reader.shared.BannerMessage
typealias UserData = com.aryan.reader.shared.UserData
typealias AppThemeMode = com.aryan.reader.shared.AppThemeMode
typealias AppContrastOption = com.aryan.reader.shared.AppContrastOption
typealias AppFontPreference = com.aryan.reader.shared.AppFontPreference
typealias AppFontPreferenceKind = com.aryan.reader.shared.AppFontPreferenceKind
typealias CustomAppTheme = com.aryan.reader.shared.CustomAppTheme
typealias BannerMessage = org.dueattendant149.bookreader.shared.BannerMessage
typealias UserData = org.dueattendant149.bookreader.shared.UserData
typealias AppThemeMode = org.dueattendant149.bookreader.shared.AppThemeMode
typealias AppContrastOption = org.dueattendant149.bookreader.shared.AppContrastOption
typealias AppFontPreference = org.dueattendant149.bookreader.shared.AppFontPreference
typealias AppFontPreferenceKind = org.dueattendant149.bookreader.shared.AppFontPreferenceKind
typealias CustomAppTheme = org.dueattendant149.bookreader.shared.CustomAppTheme
data class ImportResult(
val internalUri: Uri,

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader
package org.dueattendant149.bookreader
import android.content.Context
import android.net.Uri
@ -29,7 +29,7 @@ import java.io.FileOutputStream
import java.io.InputStream
import java.util.UUID
import androidx.core.net.toUri
import com.aryan.reader.shared.SharedFileCapabilities
import org.dueattendant149.bookreader.shared.SharedFileCapabilities
private const val BOOKS_DIR = "books"

View file

@ -1,11 +1,11 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import android.content.Context
import androidx.core.content.edit
import com.aryan.reader.shared.ReaderBookReplacementPreferences
import com.aryan.reader.shared.ReaderBookReplacementPreferencesJson
import com.aryan.reader.shared.ReaderWordReplacementEngine
import com.aryan.reader.shared.ReaderWordReplacementRule
import org.dueattendant149.bookreader.shared.ReaderBookReplacementPreferences
import org.dueattendant149.bookreader.shared.ReaderBookReplacementPreferencesJson
import org.dueattendant149.bookreader.shared.ReaderWordReplacementEngine
import org.dueattendant149.bookreader.shared.ReaderWordReplacementRule
import org.jsoup.nodes.Document
import org.jsoup.nodes.Node
import org.jsoup.nodes.TextNode

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import androidx.annotation.StringRes
import androidx.compose.foundation.layout.Arrangement
@ -50,9 +50,9 @@ import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.aryan.reader.shared.ReaderBookReplacementEngine
import com.aryan.reader.shared.ReaderBookReplacementPreferences
import com.aryan.reader.shared.ReaderWordReplacementRule
import org.dueattendant149.bookreader.shared.ReaderBookReplacementEngine
import org.dueattendant149.bookreader.shared.ReaderBookReplacementPreferences
import org.dueattendant149.bookreader.shared.ReaderWordReplacementRule
private data class BookRuleEditTarget(
val ruleId: String? = null,

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import android.content.ClipData
import android.content.ClipboardManager

View file

@ -1,7 +1,7 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import com.aryan.reader.data.BookMetadata
import com.aryan.reader.data.RecentFileItem
import org.dueattendant149.bookreader.data.BookMetadata
import org.dueattendant149.bookreader.data.RecentFileItem
internal fun RecentFileItem.needsRemoteEpubAnnotationMetadataGuard(): Boolean {
return type in EPUB_READER_FILE_TYPES &&

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import java.io.File

View file

@ -1,10 +1,10 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import android.util.Log
import com.aryan.reader.data.BookMetadata
import com.aryan.reader.data.RecentFileItem
import com.aryan.reader.data.effectiveAnnotationModifiedTimestamp
import com.aryan.reader.data.effectiveReadingPositionModifiedTimestamp
import org.dueattendant149.bookreader.data.BookMetadata
import org.dueattendant149.bookreader.data.RecentFileItem
import org.dueattendant149.bookreader.data.effectiveAnnotationModifiedTimestamp
import org.dueattendant149.bookreader.data.effectiveReadingPositionModifiedTimestamp
import timber.log.Timber
internal const val CloudSyncTraceTag = "EpistemeCloudSync"

View file

@ -1,7 +1,7 @@
// Common.kt
@file:OptIn(ExperimentalMaterial3Api::class) @file:Suppress("KotlinConstantConditions")
package com.aryan.reader
package org.dueattendant149.bookreader
import android.content.Context
import android.graphics.Bitmap
@ -166,23 +166,23 @@ import androidx.compose.ui.window.PopupProperties
import androidx.core.content.edit
import androidx.core.graphics.toColorInt
import androidx.media3.common.util.UnstableApi
import com.aryan.reader.epubreader.PREF_CUSTOM_THEMES
import com.aryan.reader.epubreader.PREF_READER_THEME
import com.aryan.reader.paginatedreader.TtsChunk
import com.aryan.reader.pdf.PdfHighlightColor
import com.aryan.reader.shared.BuiltInReaderThemes
import com.aryan.reader.shared.ReaderTextureFilePrefix
import com.aryan.reader.shared.normalizeReaderTextureExtension
import com.aryan.reader.shared.readerTextureDisplayName as sharedReaderTextureDisplayName
import com.aryan.reader.shared.readerTextureMimeTypeForExtension
import com.aryan.reader.tts.GEMINI_TTS_SPEAKERS
import com.aryan.reader.tts.SpeakerSamplePlayer
import com.aryan.reader.tts.TtsCacheManager
import com.aryan.reader.tts.TtsPlaybackManager
import com.aryan.reader.tts.formatBytes
import com.aryan.reader.tts.loadTtsMode
import com.aryan.reader.tts.rememberTtsController
import com.aryan.reader.tts.splitTextIntoChunks
import org.dueattendant149.bookreader.epubreader.PREF_CUSTOM_THEMES
import org.dueattendant149.bookreader.epubreader.PREF_READER_THEME
import org.dueattendant149.bookreader.paginatedreader.TtsChunk
import org.dueattendant149.bookreader.pdf.PdfHighlightColor
import org.dueattendant149.bookreader.shared.BuiltInReaderThemes
import org.dueattendant149.bookreader.shared.ReaderTextureFilePrefix
import org.dueattendant149.bookreader.shared.normalizeReaderTextureExtension
import org.dueattendant149.bookreader.shared.readerTextureDisplayName as sharedReaderTextureDisplayName
import org.dueattendant149.bookreader.shared.readerTextureMimeTypeForExtension
import org.dueattendant149.bookreader.tts.GEMINI_TTS_SPEAKERS
import org.dueattendant149.bookreader.tts.SpeakerSamplePlayer
import org.dueattendant149.bookreader.tts.TtsCacheManager
import org.dueattendant149.bookreader.tts.TtsPlaybackManager
import org.dueattendant149.bookreader.tts.formatBytes
import org.dueattendant149.bookreader.tts.loadTtsMode
import org.dueattendant149.bookreader.tts.rememberTtsController
import org.dueattendant149.bookreader.tts.splitTextIntoChunks
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
@ -218,8 +218,8 @@ import kotlin.math.min
import kotlin.math.roundToInt
import kotlin.math.sqrt
typealias ReaderTexture = com.aryan.reader.shared.ReaderTexture
typealias ReaderTheme = com.aryan.reader.shared.ReaderTheme
typealias ReaderTexture = org.dueattendant149.bookreader.shared.ReaderTexture
typealias ReaderTheme = org.dueattendant149.bookreader.shared.ReaderTheme
const val aiServerBasePath = BuildConfig.AI_WORKER_URL
const val summarizeEndpoint = "/summarize"
@ -474,9 +474,9 @@ data class SearchResult(
val chunkIndex: Int
)
typealias AiDefinitionResult = com.aryan.reader.shared.AiDefinitionResult
typealias AiDefinitionResult = org.dueattendant149.bookreader.shared.AiDefinitionResult
typealias SummarizationResult = com.aryan.reader.shared.SummarizationResult
typealias SummarizationResult = org.dueattendant149.bookreader.shared.SummarizationResult
data class CachedSummaryItem(
val chapterIndex: Int,
@ -3845,7 +3845,7 @@ fun AiResultContentView(
result: SummarizationResult?,
isLoading: Boolean,
isMainTtsActive: Boolean,
ttsController: com.aryan.reader.tts.TtsController,
ttsController: org.dueattendant149.bookreader.tts.TtsController,
ttsState: TtsPlaybackManager.TtsState,
getAuthToken: suspend () -> String?,
onRegenerate: (() -> Unit)? = null,

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import android.util.Xml
import org.xmlpull.v1.XmlPullParser

View file

@ -1,14 +1,14 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import android.content.Context
import android.net.Uri
import androidx.core.net.toUri
import androidx.documentfile.provider.DocumentFile
import com.aryan.reader.data.BookMetadataEdit
import com.aryan.reader.data.RecentFileItem
import com.aryan.reader.shared.reader.SharedEpubMetadataEditor
import com.aryan.reader.shared.reader.SharedEpubMetadataSnapshot
import com.aryan.reader.shared.reader.SharedEpubMetadataUpdate
import org.dueattendant149.bookreader.data.BookMetadataEdit
import org.dueattendant149.bookreader.data.RecentFileItem
import org.dueattendant149.bookreader.shared.reader.SharedEpubMetadataEditor
import org.dueattendant149.bookreader.shared.reader.SharedEpubMetadataSnapshot
import org.dueattendant149.bookreader.shared.reader.SharedEpubMetadataUpdate
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import java.io.File

View file

@ -1,11 +1,11 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
const val EXTRA_TEMPORARY_EXTERNAL_OPEN = "com.aryan.reader.extra.TEMPORARY_EXTERNAL_OPEN"
const val EXTRA_TEMPORARY_EXTERNAL_OPEN = "org.dueattendant149.bookreader.extra.TEMPORARY_EXTERNAL_OPEN"
object ExternalFileOpenRouteDecider {
const val BEHAVIOR_TEMPORARY = "TEMPORARY"

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader
package org.dueattendant149.bookreader
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext

View file

@ -1,6 +1,6 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import com.aryan.reader.shared.SharedFileCapabilities
import org.dueattendant149.bookreader.shared.SharedFileCapabilities
internal fun resolveFileTypeFromName(fileName: String?): FileType? {
return SharedFileCapabilities.resolveFileTypeForName(fileName)

View file

@ -18,7 +18,7 @@
* mail: epistemereader@gmail.com
*/
// FolderSyncWorker.kt
package com.aryan.reader
package org.dueattendant149.bookreader
import android.content.Context
import timber.log.Timber
@ -29,25 +29,25 @@ import androidx.work.ExistingWorkPolicy
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkerParameters
import androidx.work.WorkManager
import com.aryan.reader.data.RecentFileItem
import com.aryan.reader.data.RecentFilesRepository
import org.dueattendant149.bookreader.data.RecentFileItem
import org.dueattendant149.bookreader.data.RecentFilesRepository
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlinx.coroutines.withContext
import androidx.core.content.edit
import com.aryan.reader.data.LocalSyncUtils
import com.aryan.reader.data.FolderBookMetadata
import com.aryan.reader.data.toSharedFolderBookMetadata
import com.aryan.reader.shared.BookItem as SharedBookItem
import com.aryan.reader.shared.EpubAnnotationSerializer
import com.aryan.reader.shared.EpubBookmark
import com.aryan.reader.shared.LOCAL_FOLDER_SYNC_DATA_DIR
import com.aryan.reader.shared.LocalFolderSyncEngine
import com.aryan.reader.shared.ReaderLocator
import com.aryan.reader.shared.SharedFolderScannedFile
import com.aryan.reader.shared.SharedReaderScreenState
import com.aryan.reader.shared.reader.ReaderBookmark
import org.dueattendant149.bookreader.data.LocalSyncUtils
import org.dueattendant149.bookreader.data.FolderBookMetadata
import org.dueattendant149.bookreader.data.toSharedFolderBookMetadata
import org.dueattendant149.bookreader.shared.BookItem as SharedBookItem
import org.dueattendant149.bookreader.shared.EpubAnnotationSerializer
import org.dueattendant149.bookreader.shared.EpubBookmark
import org.dueattendant149.bookreader.shared.LOCAL_FOLDER_SYNC_DATA_DIR
import org.dueattendant149.bookreader.shared.LocalFolderSyncEngine
import org.dueattendant149.bookreader.shared.ReaderLocator
import org.dueattendant149.bookreader.shared.SharedFolderScannedFile
import org.dueattendant149.bookreader.shared.SharedReaderScreenState
import org.dueattendant149.bookreader.shared.reader.ReaderBookmark
import java.io.File
import android.provider.DocumentsContract

View file

@ -1,7 +1,7 @@
// FontsScreen.kt
@file:Suppress("KotlinConstantConditions")
package com.aryan.reader
package org.dueattendant149.bookreader
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.ExperimentalFoundationApi
@ -68,17 +68,17 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.aryan.reader.shared.CustomFontItem
import com.aryan.reader.shared.CustomFontFamilyItem
import com.aryan.reader.shared.CustomFontVariantItem
import com.aryan.reader.shared.fontFaceLabel
import com.aryan.reader.shared.fontFaceSummary
import com.aryan.reader.shared.groupByFamily
import com.aryan.reader.shared.hasVariableWeightFace
import com.aryan.reader.shared.ui.SharedAppFontSelector
import com.aryan.reader.shared.ui.SharedFontSettingsSection
import com.aryan.reader.shared.ui.SharedFontSettingsTabs
import com.aryan.reader.data.CustomFontEntity
import org.dueattendant149.bookreader.shared.CustomFontItem
import org.dueattendant149.bookreader.shared.CustomFontFamilyItem
import org.dueattendant149.bookreader.shared.CustomFontVariantItem
import org.dueattendant149.bookreader.shared.fontFaceLabel
import org.dueattendant149.bookreader.shared.fontFaceSummary
import org.dueattendant149.bookreader.shared.groupByFamily
import org.dueattendant149.bookreader.shared.hasVariableWeightFace
import org.dueattendant149.bookreader.shared.ui.SharedAppFontSelector
import org.dueattendant149.bookreader.shared.ui.SharedFontSettingsSection
import org.dueattendant149.bookreader.shared.ui.SharedFontSettingsTabs
import org.dueattendant149.bookreader.data.CustomFontEntity
import java.io.File
@OptIn(ExperimentalMaterial3Api::class)

View file

@ -20,7 +20,7 @@
// HomeScreen
@file:Suppress("DEPRECATION")
package com.aryan.reader
package org.dueattendant149.bookreader
import android.annotation.SuppressLint
import android.app.Activity
@ -145,7 +145,7 @@ import androidx.media3.common.util.UnstableApi
import androidx.navigation.NavHostController
import coil.compose.AsyncImage
import coil.request.ImageRequest
import com.aryan.reader.data.RecentFileItem
import org.dueattendant149.bookreader.data.RecentFileItem
import kotlinx.coroutines.launch
import timber.log.Timber
import java.text.SimpleDateFormat

View file

@ -0,0 +1,42 @@
package org.dueattendant149.bookreader
import org.dueattendant149.bookreader.data.RecentFileItem
import org.dueattendant149.bookreader.shared.ReaderFeatureSurface
import org.dueattendant149.bookreader.shared.ReaderPlatform
import org.dueattendant149.bookreader.shared.SharedFileCapabilities
typealias AddBooksSource = org.dueattendant149.bookreader.shared.AddBooksSource
typealias FileType = org.dueattendant149.bookreader.shared.FileType
typealias RenderMode = org.dueattendant149.bookreader.shared.RenderMode
typealias SortOrder = org.dueattendant149.bookreader.shared.SortOrder
typealias ReadStatusFilter = org.dueattendant149.bookreader.shared.ReadStatusFilter
typealias LibraryFilters = org.dueattendant149.bookreader.shared.LibraryFilters
typealias SyncedFolder = org.dueattendant149.bookreader.shared.SyncedFolder
typealias ShelfType = org.dueattendant149.bookreader.shared.ShelfType
internal val ANDROID_READABLE_FILE_TYPES = SharedFileCapabilities.readableTypesFor(ReaderPlatform.ANDROID)
internal val ANDROID_SYNCABLE_FILE_TYPES = SharedFileCapabilities.syncableTypesFor(ReaderPlatform.ANDROID)
internal val COMIC_ARCHIVE_FILE_TYPES = SharedFileCapabilities.comicArchiveTypes
internal val PDF_VIEWER_FILE_TYPES = org.dueattendant149.bookreader.shared.PDF_VIEWER_FILE_TYPES
internal val EPUB_READER_FILE_TYPES = org.dueattendant149.bookreader.shared.EPUB_READER_FILE_TYPES
internal fun FileType.readerSurfaceOnAndroid(): ReaderFeatureSurface? {
return SharedFileCapabilities.surfaceFor(this, ReaderPlatform.ANDROID)
}
data class Shelf(
val id: String,
val name: String,
val type: ShelfType,
val books: List<RecentFileItem>,
val directBooks: List<RecentFileItem> = books,
val parentShelfId: String? = null,
val childShelfIds: List<String> = emptyList(),
val depth: Int = 0,
val sortKey: String = name.lowercase()
) {
val bookCount: Int get() = books.size
val topBook: RecentFileItem? by lazy(LazyThreadSafetyMode.NONE) { books.maxByOrNull { it.timestamp } }
val directBookCount: Int get() = directBooks.size
val childShelfCount: Int get() = childShelfIds.size
}

View file

@ -20,7 +20,7 @@
// LibraryScreen.kt
@file:Suppress("KotlinConstantConditions")
package com.aryan.reader
package org.dueattendant149.bookreader
import android.annotation.SuppressLint
import android.net.Uri
@ -141,16 +141,16 @@ import androidx.navigation.NavHostController
import coil.ImageLoader
import coil.compose.AsyncImage
import coil.decode.SvgDecoder
import com.aryan.reader.data.RecentFileItem
import com.aryan.reader.data.TagEntity
import com.aryan.reader.opds.OpdsAcquisition
import com.aryan.reader.opds.OpdsCatalog
import com.aryan.reader.opds.OpdsDownloadState
import com.aryan.reader.opds.OpdsEntry
import com.aryan.reader.opds.OpdsRepository
import com.aryan.reader.opds.OpdsViewModel
import com.aryan.reader.shared.LOCAL_FOLDER_SYNC_DATA_DIR
import com.aryan.reader.shared.opds.SharedOpdsLocalBookMatcher
import org.dueattendant149.bookreader.data.RecentFileItem
import org.dueattendant149.bookreader.data.TagEntity
import org.dueattendant149.bookreader.opds.OpdsAcquisition
import org.dueattendant149.bookreader.opds.OpdsCatalog
import org.dueattendant149.bookreader.opds.OpdsDownloadState
import org.dueattendant149.bookreader.opds.OpdsEntry
import org.dueattendant149.bookreader.opds.OpdsRepository
import org.dueattendant149.bookreader.opds.OpdsViewModel
import org.dueattendant149.bookreader.shared.LOCAL_FOLDER_SYNC_DATA_DIR
import org.dueattendant149.bookreader.shared.opds.SharedOpdsLocalBookMatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.distinctUntilChanged

View file

@ -1,14 +1,14 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import com.aryan.reader.data.BookShelfCrossRef
import com.aryan.reader.data.BookTagCrossRef
import com.aryan.reader.data.RecentFileItem
import com.aryan.reader.data.ShelfEntity
import com.aryan.reader.data.TagEntity
import com.aryan.reader.shared.SharedReaderScreenState
import com.aryan.reader.shared.applyLibraryFilters as sharedApplyLibraryFilters
import com.aryan.reader.shared.filterBySearch as sharedFilterBySearch
import com.aryan.reader.shared.sortBooks as sharedSortBooks
import org.dueattendant149.bookreader.data.BookShelfCrossRef
import org.dueattendant149.bookreader.data.BookTagCrossRef
import org.dueattendant149.bookreader.data.RecentFileItem
import org.dueattendant149.bookreader.data.ShelfEntity
import org.dueattendant149.bookreader.data.TagEntity
import org.dueattendant149.bookreader.shared.SharedReaderScreenState
import org.dueattendant149.bookreader.shared.applyLibraryFilters as sharedApplyLibraryFilters
import org.dueattendant149.bookreader.shared.filterBySearch as sharedFilterBySearch
import org.dueattendant149.bookreader.shared.sortBooks as sharedSortBooks
fun interface FolderPathResolver {
fun relativeFolderSegments(item: RecentFileItem): List<String>
@ -151,7 +151,7 @@ fun sortFiles(files: List<RecentFileItem>, sortOrder: SortOrder): List<RecentFil
return files.mapSharedResults(sharedSortBooks(files.map { it.toSharedProjectionBookItem() }, sortOrder))
}
private fun List<RecentFileItem>.mapSharedResults(sharedBooks: List<com.aryan.reader.shared.BookItem>): List<RecentFileItem> {
private fun List<RecentFileItem>.mapSharedResults(sharedBooks: List<org.dueattendant149.bookreader.shared.BookItem>): List<RecentFileItem> {
val byId = associateBy { it.bookId }
return sharedBooks.mapNotNull { byId[it.id] }
}

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader
package org.dueattendant149.bookreader
import android.content.Intent
import android.os.Build
@ -41,8 +41,8 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.lifecycle.lifecycleScope
import androidx.navigation.compose.rememberNavController
import com.aryan.reader.data.PlatformFeaturesRepository
import com.aryan.reader.ui.theme.AppTheme
import org.dueattendant149.bookreader.data.PlatformFeaturesRepository
import org.dueattendant149.bookreader.ui.theme.AppTheme
import kotlinx.coroutines.launch
import timber.log.Timber
import androidx.compose.foundation.isSystemInDarkTheme
@ -50,12 +50,12 @@ import androidx.compose.runtime.getValue
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.media3.common.util.UnstableApi
import com.aryan.reader.tts.ACTION_OPEN_TTS_SESSION
import com.aryan.reader.tts.EXTRA_TTS_BOOK_ID
import com.aryan.reader.tts.EXTRA_TTS_CHAPTER_INDEX
import com.aryan.reader.tts.EXTRA_TTS_PAGE_INDEX
import com.aryan.reader.tts.EXTRA_TTS_SOURCE_CFI
import com.aryan.reader.tts.EXTRA_TTS_START_OFFSET
import org.dueattendant149.bookreader.tts.ACTION_OPEN_TTS_SESSION
import org.dueattendant149.bookreader.tts.EXTRA_TTS_BOOK_ID
import org.dueattendant149.bookreader.tts.EXTRA_TTS_CHAPTER_INDEX
import org.dueattendant149.bookreader.tts.EXTRA_TTS_PAGE_INDEX
import org.dueattendant149.bookreader.tts.EXTRA_TTS_SOURCE_CFI
import org.dueattendant149.bookreader.tts.EXTRA_TTS_START_OFFSET
@UnstableApi
open class MainActivity : AppCompatActivity() {

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
internal const val KEY_RENDER_MODE = "render_mode"
internal const val KEY_FOLDER_SYNC_ENABLED = "folder_sync_enabled"

View file

@ -18,7 +18,7 @@
* mail: epistemereader@gmail.com
*/
// MainScreen.kt
package com.aryan.reader
package org.dueattendant149.bookreader
import androidx.activity.ComponentActivity
import androidx.activity.enableEdgeToEdge

View file

@ -20,7 +20,7 @@
// MainViewModel.kt
@file:Suppress("DEPRECATION", "ANNOTATION_WILL_BE_APPLIED_ALSO_TO_PROPERTY_OR_FIELD")
package com.aryan.reader
package org.dueattendant149.bookreader
import android.app.Application
import android.content.ClipData
@ -31,11 +31,11 @@ import android.database.Cursor
import android.graphics.Bitmap
import android.net.Uri
import android.os.Build
import com.aryan.reader.tts.TtsController
import com.aryan.reader.tts.TtsPlaybackManager
import com.aryan.reader.paginatedreader.LocatorConverter
import org.dueattendant149.bookreader.tts.TtsController
import org.dueattendant149.bookreader.tts.TtsPlaybackManager
import org.dueattendant149.bookreader.paginatedreader.LocatorConverter
import kotlinx.serialization.protobuf.ProtoBuf
import com.aryan.reader.paginatedreader.semanticBlockModule
import org.dueattendant149.bookreader.paginatedreader.semanticBlockModule
import android.provider.DocumentsContract
import android.provider.OpenableColumns
import androidx.annotation.OptIn
@ -53,72 +53,72 @@ import androidx.work.ExistingWorkPolicy
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkInfo
import androidx.work.WorkManager
import com.aryan.reader.data.BookMetadata
import com.aryan.reader.data.BookMetadataEdit
import com.aryan.reader.data.CloudflareRepository
import com.aryan.reader.data.CustomFontEntity
import com.aryan.reader.data.FeedbackRepository
import com.aryan.reader.data.FirestoreRepository
import com.aryan.reader.data.FontMetadata
import com.aryan.reader.data.FontsRepository
import com.aryan.reader.data.GoogleDriveRepository
import com.aryan.reader.data.LocalSyncUtils
import com.aryan.reader.data.PurchaseEntity
import com.aryan.reader.data.RecentFileItem
import com.aryan.reader.data.RecentFilesRepository
import com.aryan.reader.data.RemoteConfigRepository
import com.aryan.reader.data.ShelfMetadata
import com.aryan.reader.data.TagEntity
import com.aryan.reader.data.effectiveAnnotationModifiedTimestamp
import com.aryan.reader.data.effectiveReadingPositionModifiedTimestamp
import com.aryan.reader.data.getUri
import com.aryan.reader.data.toBookMetadata
import com.aryan.reader.data.toRecentFileItem
import com.aryan.reader.epub.CalibreBundleExtractor
import com.aryan.reader.epub.CalibreBundleResult
import com.aryan.reader.epub.EpubBook
import com.aryan.reader.epub.EpubParser
import com.aryan.reader.epub.ImportedFileCache
import com.aryan.reader.epub.MobiParser
import com.aryan.reader.epub.SingleFileImporter
import com.aryan.reader.epub.hasReadableExtractedContent
import com.aryan.reader.ml.ISpeechBubbleDetector
import com.aryan.reader.ml.SpeechBubble
import com.aryan.reader.ml.SpeechBubbleDetector
import com.aryan.reader.paginatedreader.Locator
import com.aryan.reader.paginatedreader.data.BookCacheDatabase
import com.aryan.reader.paginatedreader.data.BookProcessingWorker
import com.aryan.reader.pdf.PdfCoverGenerator
import com.aryan.reader.pdf.PDF_BLANK_PAGE_PERSISTENCE_TAG
import com.aryan.reader.pdf.PdfUserHighlight
import com.aryan.reader.pdf.PdfiumCoreProvider
import com.aryan.reader.pdf.PdfiumEngineProvider
import com.aryan.reader.pdf.PdfiumAnnotationExporter
import com.aryan.reader.pdf.ReflowWorker
import com.aryan.reader.pdf.pdfLayoutDebugSummary
import com.aryan.reader.pdf.remapPdfAnnotationsForLayoutChange
import com.aryan.reader.pdf.remapPdfBookmarksJsonForLayoutChange
import com.aryan.reader.pdf.data.PageLayoutRepository
import com.aryan.reader.pdf.data.PdfAnnotation
import com.aryan.reader.pdf.data.PdfAnnotationRepository
import com.aryan.reader.pdf.data.PdfHighlightRepository
import com.aryan.reader.pdf.data.PdfTextBox
import com.aryan.reader.pdf.data.PdfTextBoxRepository
import com.aryan.reader.pdf.data.PdfTextRepository
import com.aryan.reader.pdf.data.VirtualPage
import com.aryan.reader.pptx.PptxCoverGenerator
import com.aryan.reader.shared.SharedFileCapabilities
import com.aryan.reader.shared.SharedLibraryEditor
import com.aryan.reader.shared.SharedImportOutcomeCounts
import com.aryan.reader.shared.SharedImportPlanner
import com.aryan.reader.shared.pdf.SharedPdfAnnotationSidecarCodec
import com.aryan.reader.shared.shouldApplyRemoteCloudBookMetadataUpdate
import com.aryan.reader.shared.shouldDownloadRemoteCloudBookContent
import com.aryan.reader.shared.shouldUploadLocalCloudBookContent
import com.aryan.reader.shared.shouldUploadLocalCloudBookMetadataUpdate
import com.aryan.reader.shared.sharedCloudBookContentFileName
import com.aryan.reader.shared.AppAction as SharedAppAction
import com.aryan.reader.shared.LibraryAction as SharedLibraryAction
import org.dueattendant149.bookreader.data.BookMetadata
import org.dueattendant149.bookreader.data.BookMetadataEdit
import org.dueattendant149.bookreader.data.CloudflareRepository
import org.dueattendant149.bookreader.data.CustomFontEntity
import org.dueattendant149.bookreader.data.FeedbackRepository
import org.dueattendant149.bookreader.data.FirestoreRepository
import org.dueattendant149.bookreader.data.FontMetadata
import org.dueattendant149.bookreader.data.FontsRepository
import org.dueattendant149.bookreader.data.GoogleDriveRepository
import org.dueattendant149.bookreader.data.LocalSyncUtils
import org.dueattendant149.bookreader.data.PurchaseEntity
import org.dueattendant149.bookreader.data.RecentFileItem
import org.dueattendant149.bookreader.data.RecentFilesRepository
import org.dueattendant149.bookreader.data.RemoteConfigRepository
import org.dueattendant149.bookreader.data.ShelfMetadata
import org.dueattendant149.bookreader.data.TagEntity
import org.dueattendant149.bookreader.data.effectiveAnnotationModifiedTimestamp
import org.dueattendant149.bookreader.data.effectiveReadingPositionModifiedTimestamp
import org.dueattendant149.bookreader.data.getUri
import org.dueattendant149.bookreader.data.toBookMetadata
import org.dueattendant149.bookreader.data.toRecentFileItem
import org.dueattendant149.bookreader.epub.CalibreBundleExtractor
import org.dueattendant149.bookreader.epub.CalibreBundleResult
import org.dueattendant149.bookreader.epub.EpubBook
import org.dueattendant149.bookreader.epub.EpubParser
import org.dueattendant149.bookreader.epub.ImportedFileCache
import org.dueattendant149.bookreader.epub.MobiParser
import org.dueattendant149.bookreader.epub.SingleFileImporter
import org.dueattendant149.bookreader.epub.hasReadableExtractedContent
import org.dueattendant149.bookreader.ml.ISpeechBubbleDetector
import org.dueattendant149.bookreader.ml.SpeechBubble
import org.dueattendant149.bookreader.ml.SpeechBubbleDetector
import org.dueattendant149.bookreader.paginatedreader.Locator
import org.dueattendant149.bookreader.paginatedreader.data.BookCacheDatabase
import org.dueattendant149.bookreader.paginatedreader.data.BookProcessingWorker
import org.dueattendant149.bookreader.pdf.PdfCoverGenerator
import org.dueattendant149.bookreader.pdf.PDF_BLANK_PAGE_PERSISTENCE_TAG
import org.dueattendant149.bookreader.pdf.PdfUserHighlight
import org.dueattendant149.bookreader.pdf.PdfiumCoreProvider
import org.dueattendant149.bookreader.pdf.PdfiumEngineProvider
import org.dueattendant149.bookreader.pdf.PdfiumAnnotationExporter
import org.dueattendant149.bookreader.pdf.ReflowWorker
import org.dueattendant149.bookreader.pdf.pdfLayoutDebugSummary
import org.dueattendant149.bookreader.pdf.remapPdfAnnotationsForLayoutChange
import org.dueattendant149.bookreader.pdf.remapPdfBookmarksJsonForLayoutChange
import org.dueattendant149.bookreader.pdf.data.PageLayoutRepository
import org.dueattendant149.bookreader.pdf.data.PdfAnnotation
import org.dueattendant149.bookreader.pdf.data.PdfAnnotationRepository
import org.dueattendant149.bookreader.pdf.data.PdfHighlightRepository
import org.dueattendant149.bookreader.pdf.data.PdfTextBox
import org.dueattendant149.bookreader.pdf.data.PdfTextBoxRepository
import org.dueattendant149.bookreader.pdf.data.PdfTextRepository
import org.dueattendant149.bookreader.pdf.data.VirtualPage
import org.dueattendant149.bookreader.pptx.PptxCoverGenerator
import org.dueattendant149.bookreader.shared.SharedFileCapabilities
import org.dueattendant149.bookreader.shared.SharedLibraryEditor
import org.dueattendant149.bookreader.shared.SharedImportOutcomeCounts
import org.dueattendant149.bookreader.shared.SharedImportPlanner
import org.dueattendant149.bookreader.shared.pdf.SharedPdfAnnotationSidecarCodec
import org.dueattendant149.bookreader.shared.shouldApplyRemoteCloudBookMetadataUpdate
import org.dueattendant149.bookreader.shared.shouldDownloadRemoteCloudBookContent
import org.dueattendant149.bookreader.shared.shouldUploadLocalCloudBookContent
import org.dueattendant149.bookreader.shared.shouldUploadLocalCloudBookMetadataUpdate
import org.dueattendant149.bookreader.shared.sharedCloudBookContentFileName
import org.dueattendant149.bookreader.shared.AppAction as SharedAppAction
import org.dueattendant149.bookreader.shared.LibraryAction as SharedLibraryAction
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Deferred
@ -190,13 +190,13 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
private val bookCacheDao by lazy { BookCacheDatabase.getDatabase(application).bookCacheDao() }
private val epubParser by lazy { EpubParser(appContext) }
private val mobiParser by lazy { MobiParser(appContext) }
private val fb2Parser by lazy { com.aryan.reader.epub.Fb2Parser(appContext) }
private val odtParser by lazy { com.aryan.reader.epub.OdtParser(appContext) }
private val fb2Parser by lazy { org.dueattendant149.bookreader.epub.Fb2Parser(appContext) }
private val odtParser by lazy { org.dueattendant149.bookreader.epub.OdtParser(appContext) }
private val singleFileImporter by lazy { SingleFileImporter(appContext) }
private val bookImporter by lazy { BookImporter(appContext) }
private val epubMetadataFileEditor by lazy { EpubMetadataFileEditor(appContext) }
private val pageLayoutRepository by lazy { PageLayoutRepository(appContext) }
private val pdfRichTextRepository by lazy { com.aryan.reader.pdf.PdfRichTextRepository(appContext) }
private val pdfRichTextRepository by lazy { org.dueattendant149.bookreader.pdf.PdfRichTextRepository(appContext) }
private val pdfTextBoxRepository by lazy { PdfTextBoxRepository(appContext) }
private val pdfHighlightRepository by lazy { PdfHighlightRepository(appContext) }
private val pdfAnnotationRepository by lazy { PdfAnnotationRepository(appContext) }
@ -232,7 +232,7 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
private var cloudContentRetryJob: Job? = null
private val cloudMetadataUploadJobs = ConcurrentHashMap<String, Job>()
private var panelDetector: com.aryan.reader.ml.IPanelDetector? = null
private var panelDetector: org.dueattendant149.bookreader.ml.IPanelDetector? = null
private var speechBubbleDetector: ISpeechBubbleDetector? = null
private val mlDispatcher = newSingleThreadExecutor().asCoroutineDispatcher()
@ -240,17 +240,17 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
private val speechBubbleCache = ConcurrentHashMap<SpeechBubbleCacheKey, List<CachedSpeechBubble>>()
private val speechBubbleDetectionJobs = ConcurrentHashMap<SpeechBubbleCacheKey, Deferred<List<CachedSpeechBubble>>>()
private fun getOrInitDetector(context: Context): com.aryan.reader.ml.IPanelDetector? {
private fun getOrInitDetector(context: Context): org.dueattendant149.bookreader.ml.IPanelDetector? {
if (panelDetector == null && BuildConfig.DEBUG) {
val modelFile = File(context.getExternalFilesDir(null), "best_float16.tflite")
if (modelFile.exists()) {
try {
val clazz = Class.forName(
"com.aryan.reader.ml.ComicPanelDetector",
"org.dueattendant149.bookreader.ml.ComicPanelDetector",
false,
context.classLoader
)
panelDetector = clazz.getConstructor(File::class.java).newInstance(modelFile) as com.aryan.reader.ml.IPanelDetector
panelDetector = clazz.getConstructor(File::class.java).newInstance(modelFile) as org.dueattendant149.bookreader.ml.IPanelDetector
} catch (e: Exception) {
Timber.e(e, "Failed to instantiate ComicPanelDetector via reflection")
}
@ -364,7 +364,7 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
}
Timber.d("CBZ copied to cache successfully. Opening archive...")
val archiveDoc = com.aryan.reader.pdf.ArchiveDocumentWrapper(cacheFile)
val archiveDoc = org.dueattendant149.bookreader.pdf.ArchiveDocumentWrapper(cacheFile)
val totalPages = archiveDoc.getPageCount()
Timber.d("Archive opened. Total pages: $totalPages")
@ -1944,24 +1944,24 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
when (val deviceStatus =
firestoreRepository.getDeviceStatus(currentUser.uid, deviceId)) {
is com.aryan.reader.data.DeviceStatus.Active -> {
is org.dueattendant149.bookreader.data.DeviceStatus.Active -> {
Timber.d("Device is active. Updating last seen.")
firestoreRepository.updateDeviceLastSeen(currentUser.uid, deviceId)
}
is com.aryan.reader.data.DeviceStatus.Revoked -> {
is org.dueattendant149.bookreader.data.DeviceStatus.Revoked -> {
Timber.w("Device has been revoked. Signing out.")
firestoreRepository.deleteDevice(currentUser.uid, deviceId) // Clean up
signOut()
showBanner(appContext.getString(R.string.banner_device_removed))
}
is com.aryan.reader.data.DeviceStatus.NotFound -> {
is org.dueattendant149.bookreader.data.DeviceStatus.NotFound -> {
Timber.d("Device not found during verification. Triggering full registration.")
registerOrUpdateDeviceOnSignIn(currentUser.uid)
}
is com.aryan.reader.data.DeviceStatus.Error -> {
is org.dueattendant149.bookreader.data.DeviceStatus.Error -> {
Timber.e(deviceStatus.exception, "Error checking device status.")
_internalState.update {
it.copy(
@ -2038,7 +2038,7 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
sourceUri: Uri,
destUri: Uri,
annotations: Map<Int, List<PdfAnnotation>>,
richTextPageLayouts: List<com.aryan.reader.pdf.PageTextLayout>? = null,
richTextPageLayouts: List<org.dueattendant149.bookreader.pdf.PageTextLayout>? = null,
textBoxes: List<PdfTextBox>? = null,
highlights: List<PdfUserHighlight>? = null,
bookId: String
@ -2175,7 +2175,7 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
activityContext: Context,
sourceUri: Uri,
annotations: Map<Int, List<PdfAnnotation>>,
richTextPageLayouts: List<com.aryan.reader.pdf.PageTextLayout>? = null,
richTextPageLayouts: List<org.dueattendant149.bookreader.pdf.PageTextLayout>? = null,
textBoxes: List<PdfTextBox>? = null,
highlights: List<PdfUserHighlight>? = null,
includeAnnotations: Boolean,
@ -4657,7 +4657,7 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
cacheFile.outputStream().use { output -> input.copyTo(output) }
}
}
val archiveDoc = com.aryan.reader.pdf.ArchiveDocumentWrapper(cacheFile)
val archiveDoc = org.dueattendant149.bookreader.pdf.ArchiveDocumentWrapper(cacheFile)
if (archiveDoc.getPageCount() > 0) {
val page = archiveDoc.openPage(0)
if (page != null) {
@ -6430,7 +6430,7 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
val currentUser = uiState.value.currentUser ?: return
viewModelScope.launch(Dispatchers.IO) {
val db = com.aryan.reader.data.AppDatabase.getDatabase(appContext)
val db = org.dueattendant149.bookreader.data.AppDatabase.getDatabase(appContext)
val shelf = db.shelfDao().getShelfById(shelfId) ?: return@launch
val crossRefs = db.shelfDao().getCrossRefsForShelf(shelfId)
val manualOnlyBookIds = recentFilesRepository.getAllFilesForSync()
@ -7164,7 +7164,7 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
val initDuration = System.currentTimeMillis() - initStartTime
Timber.d(">>> [BATCH] Model Initialization: ${initDuration}ms")
val archiveDoc = com.aryan.reader.pdf.ArchiveDocumentWrapper(cacheFile)
val archiveDoc = org.dueattendant149.bookreader.pdf.ArchiveDocumentWrapper(cacheFile)
val totalPages = archiveDoc.getPageCount()
val startIndex = 3

View file

@ -1,5 +1,5 @@
// MetadataExtractionWorker.kt
package com.aryan.reader
package org.dueattendant149.bookreader
import android.content.Context
import android.provider.OpenableColumns
@ -10,10 +10,10 @@ import androidx.work.ExistingWorkPolicy
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkerParameters
import androidx.work.WorkManager
import com.aryan.reader.data.RecentFileItem
import com.aryan.reader.data.RecentFilesRepository
import com.aryan.reader.pdf.PdfiumCoreProvider
import com.aryan.reader.pdf.PdfiumEngineProvider
import org.dueattendant149.bookreader.data.RecentFileItem
import org.dueattendant149.bookreader.data.RecentFilesRepository
import org.dueattendant149.bookreader.pdf.PdfiumCoreProvider
import org.dueattendant149.bookreader.pdf.PdfiumEngineProvider
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.xmlpull.v1.XmlPullParser

View file

@ -17,14 +17,14 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader
package org.dueattendant149.bookreader
import android.app.Application
import android.webkit.WebView
import coil.ImageLoader
import coil.ImageLoaderFactory
import coil.decode.SvgDecoder
import com.aryan.reader.paginatedreader.SvgStringFetcher
import org.dueattendant149.bookreader.paginatedreader.SvgStringFetcher
import timber.log.Timber // Add this
class MyApplication : Application(), ImageLoaderFactory {

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader
package org.dueattendant149.bookreader
import android.app.Activity
import timber.log.Timber
@ -61,7 +61,7 @@ import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.aryan.reader.data.ProductDetailsEntity
import org.dueattendant149.bookreader.data.ProductDetailsEntity
import kotlinx.coroutines.launch
import java.text.NumberFormat
import java.util.Currency

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import java.security.MessageDigest
import java.util.Base64

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import android.content.Context
import android.view.Window
@ -33,7 +33,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.core.content.edit
import com.aryan.reader.shared.ui.ReaderMinimalSlider
import org.dueattendant149.bookreader.shared.ui.ReaderMinimalSlider
import kotlin.math.roundToInt
private const val READER_PREFS_NAME = "reader_prefs"

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
@ -6,7 +6,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import com.aryan.reader.data.RecentFileItem
import org.dueattendant149.bookreader.data.RecentFileItem
@Composable
private fun rememberReaderFileInfoItem(

View file

@ -1,8 +1,8 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import com.aryan.reader.shared.detectFontVariant
import com.aryan.reader.shared.familyFilenameSignature
import com.aryan.reader.shared.supportsVariableWeightAxis
import org.dueattendant149.bookreader.shared.detectFontVariant
import org.dueattendant149.bookreader.shared.familyFilenameSignature
import org.dueattendant149.bookreader.shared.supportsVariableWeightAxis
const val ReaderFontDiagnosticsTag = "ReaderFontDiag"

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import android.content.Context
import androidx.core.content.edit

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import timber.log.Timber

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import kotlin.math.roundToInt

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import android.app.Activity
import android.content.Context

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import android.content.Context
import androidx.compose.ui.graphics.Color

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import android.content.Context
import android.content.res.Configuration

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.layout.WindowInsets
@ -27,45 +27,45 @@ import androidx.compose.ui.res.stringResource
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.media3.common.util.UnstableApi
import androidx.navigation.NavHostController
import com.aryan.reader.data.CustomFontEntity
import com.aryan.reader.epubreader.FormatSettings as AndroidFormatSettings
import com.aryan.reader.epubreader.ReaderFont as AndroidReaderFont
import com.aryan.reader.epubreader.ReaderTextAlign as AndroidReaderTextAlign
import com.aryan.reader.epubreader.loadFormatSettings
import com.aryan.reader.epubreader.loadPageInfoMode
import com.aryan.reader.epubreader.loadPageInfoPosition
import com.aryan.reader.epubreader.loadPullToTurn
import com.aryan.reader.epubreader.loadPullToTurnMultiplier
import com.aryan.reader.epubreader.loadSystemUiMode
import com.aryan.reader.epubreader.savePageInfoMode
import com.aryan.reader.epubreader.savePageInfoPosition
import com.aryan.reader.epubreader.savePullToTurn
import com.aryan.reader.epubreader.savePullToTurnMultiplier
import com.aryan.reader.epubreader.saveReaderSettings
import com.aryan.reader.epubreader.saveSystemUiMode
import com.aryan.reader.pdf.savePdfSystemUiMode
import com.aryan.reader.pdf.savePdfThemeId
import com.aryan.reader.pdf.savePdfVerticalPageGapVisible
import com.aryan.reader.pdf.savePdfPageNumberOverlayVisible
import com.aryan.reader.pdf.loadPdfSystemUiMode
import com.aryan.reader.pdf.loadPdfThemeId
import com.aryan.reader.pdf.loadPdfVerticalPageGapVisible
import com.aryan.reader.pdf.loadPdfPageNumberOverlayVisible
import com.aryan.reader.shared.BuiltInPdfReaderThemes
import com.aryan.reader.shared.CustomFontItem
import com.aryan.reader.shared.SharedSettingsAction
import com.aryan.reader.shared.SharedSettingsDestination
import com.aryan.reader.shared.parentDestination
import com.aryan.reader.shared.toReaderSettingsFontFamily
import com.aryan.reader.shared.toSharedReaderTextAlign
import com.aryan.reader.shared.reader.ReaderReadingMode
import com.aryan.reader.shared.reader.ReaderSettings
import com.aryan.reader.shared.reader.SharedReaderTextAlign
import com.aryan.reader.shared.readerThemeById
import com.aryan.reader.shared.sharedSettingsHubModel
import com.aryan.reader.shared.toReaderSettings
import com.aryan.reader.shared.ui.SharedSettingsHub
import com.aryan.reader.tts.loadTtsMode
import org.dueattendant149.bookreader.data.CustomFontEntity
import org.dueattendant149.bookreader.epubreader.FormatSettings as AndroidFormatSettings
import org.dueattendant149.bookreader.epubreader.ReaderFont as AndroidReaderFont
import org.dueattendant149.bookreader.epubreader.ReaderTextAlign as AndroidReaderTextAlign
import org.dueattendant149.bookreader.epubreader.loadFormatSettings
import org.dueattendant149.bookreader.epubreader.loadPageInfoMode
import org.dueattendant149.bookreader.epubreader.loadPageInfoPosition
import org.dueattendant149.bookreader.epubreader.loadPullToTurn
import org.dueattendant149.bookreader.epubreader.loadPullToTurnMultiplier
import org.dueattendant149.bookreader.epubreader.loadSystemUiMode
import org.dueattendant149.bookreader.epubreader.savePageInfoMode
import org.dueattendant149.bookreader.epubreader.savePageInfoPosition
import org.dueattendant149.bookreader.epubreader.savePullToTurn
import org.dueattendant149.bookreader.epubreader.savePullToTurnMultiplier
import org.dueattendant149.bookreader.epubreader.saveReaderSettings
import org.dueattendant149.bookreader.epubreader.saveSystemUiMode
import org.dueattendant149.bookreader.pdf.savePdfSystemUiMode
import org.dueattendant149.bookreader.pdf.savePdfThemeId
import org.dueattendant149.bookreader.pdf.savePdfVerticalPageGapVisible
import org.dueattendant149.bookreader.pdf.savePdfPageNumberOverlayVisible
import org.dueattendant149.bookreader.pdf.loadPdfSystemUiMode
import org.dueattendant149.bookreader.pdf.loadPdfThemeId
import org.dueattendant149.bookreader.pdf.loadPdfVerticalPageGapVisible
import org.dueattendant149.bookreader.pdf.loadPdfPageNumberOverlayVisible
import org.dueattendant149.bookreader.shared.BuiltInPdfReaderThemes
import org.dueattendant149.bookreader.shared.CustomFontItem
import org.dueattendant149.bookreader.shared.SharedSettingsAction
import org.dueattendant149.bookreader.shared.SharedSettingsDestination
import org.dueattendant149.bookreader.shared.parentDestination
import org.dueattendant149.bookreader.shared.toReaderSettingsFontFamily
import org.dueattendant149.bookreader.shared.toSharedReaderTextAlign
import org.dueattendant149.bookreader.shared.reader.ReaderReadingMode
import org.dueattendant149.bookreader.shared.reader.ReaderSettings
import org.dueattendant149.bookreader.shared.reader.SharedReaderTextAlign
import org.dueattendant149.bookreader.shared.readerThemeById
import org.dueattendant149.bookreader.shared.sharedSettingsHubModel
import org.dueattendant149.bookreader.shared.toReaderSettings
import org.dueattendant149.bookreader.shared.ui.SharedSettingsHub
import org.dueattendant149.bookreader.tts.loadTtsMode
import kotlinx.coroutines.launch
import kotlin.math.max
import kotlin.math.roundToInt

View file

@ -18,7 +18,7 @@
* mail: epistemereader@gmail.com
*/
// SharedComposables.kt
package com.aryan.reader
package org.dueattendant149.bookreader
import android.content.Context
import android.content.Intent
@ -43,7 +43,7 @@ import androidx.compose.foundation.lazy.items
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.rememberModalBottomSheetState
import com.aryan.reader.data.TagEntity
import org.dueattendant149.bookreader.data.TagEntity
import androidx.compose.material.icons.filled.Search
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
@ -143,14 +143,14 @@ import androidx.compose.ui.window.DialogProperties
import androidx.compose.ui.viewinterop.AndroidView
import androidx.core.net.toUri
import androidx.core.text.HtmlCompat
import com.aryan.reader.shared.SharedFileCapabilities
import com.aryan.reader.shared.SharedLegalLinks
import com.aryan.reader.shared.SharedLegalProfile
import com.aryan.reader.data.BookMetadataEdit
import com.aryan.reader.data.RecentFileItem
import com.aryan.reader.shared.SharedText
import com.aryan.reader.shared.sharedLegalLinksForProfile
import com.aryan.reader.shared.ui.SharedMarkdownText
import org.dueattendant149.bookreader.shared.SharedFileCapabilities
import org.dueattendant149.bookreader.shared.SharedLegalLinks
import org.dueattendant149.bookreader.shared.SharedLegalProfile
import org.dueattendant149.bookreader.data.BookMetadataEdit
import org.dueattendant149.bookreader.data.RecentFileItem
import org.dueattendant149.bookreader.shared.SharedText
import org.dueattendant149.bookreader.shared.sharedLegalLinksForProfile
import org.dueattendant149.bookreader.shared.ui.SharedMarkdownText
import timber.log.Timber
import java.text.SimpleDateFormat
import java.util.Date

View file

@ -1,22 +1,22 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import com.aryan.reader.data.BookShelfCrossRef
import com.aryan.reader.data.BookTagCrossRef
import com.aryan.reader.data.RecentFileItem
import com.aryan.reader.data.ShelfEntity
import com.aryan.reader.data.TagEntity
import com.aryan.reader.shared.BookItem as SharedBookItem
import com.aryan.reader.shared.BookShelfRef as SharedBookShelfRef
import com.aryan.reader.shared.EpubAnnotationSerializer
import com.aryan.reader.shared.FileType as SharedFileType
import com.aryan.reader.shared.LibraryFilters as SharedLibraryFilters
import com.aryan.reader.shared.ReaderLocator as SharedReaderLocator
import com.aryan.reader.shared.SharedReaderScreenState
import com.aryan.reader.shared.Shelf as SharedShelf
import com.aryan.reader.shared.ShelfRecord
import com.aryan.reader.shared.SyncedFolder as SharedSyncedFolder
import com.aryan.reader.shared.Tag as SharedTag
import com.aryan.reader.shared.toStablePositionCfi
import org.dueattendant149.bookreader.data.BookShelfCrossRef
import org.dueattendant149.bookreader.data.BookTagCrossRef
import org.dueattendant149.bookreader.data.RecentFileItem
import org.dueattendant149.bookreader.data.ShelfEntity
import org.dueattendant149.bookreader.data.TagEntity
import org.dueattendant149.bookreader.shared.BookItem as SharedBookItem
import org.dueattendant149.bookreader.shared.BookShelfRef as SharedBookShelfRef
import org.dueattendant149.bookreader.shared.EpubAnnotationSerializer
import org.dueattendant149.bookreader.shared.FileType as SharedFileType
import org.dueattendant149.bookreader.shared.LibraryFilters as SharedLibraryFilters
import org.dueattendant149.bookreader.shared.ReaderLocator as SharedReaderLocator
import org.dueattendant149.bookreader.shared.SharedReaderScreenState
import org.dueattendant149.bookreader.shared.Shelf as SharedShelf
import org.dueattendant149.bookreader.shared.ShelfRecord
import org.dueattendant149.bookreader.shared.SyncedFolder as SharedSyncedFolder
import org.dueattendant149.bookreader.shared.Tag as SharedTag
import org.dueattendant149.bookreader.shared.toStablePositionCfi
fun FileType.toSharedFileType(): SharedFileType = this

View file

@ -1,5 +1,5 @@
// StorageTracker.kt
package com.aryan.reader
package org.dueattendant149.bookreader
import android.content.Context
import timber.log.Timber

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import org.json.JSONArray
import org.json.JSONObject

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import androidx.compose.foundation.background
import androidx.compose.foundation.border
@ -31,7 +31,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import coil.compose.AsyncImage
import coil.request.ImageRequest
import com.aryan.reader.data.RecentFileItem
import org.dueattendant149.bookreader.data.RecentFileItem
import java.io.File
import kotlin.math.absoluteValue

View file

@ -1,11 +1,11 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import android.content.Context
import androidx.core.content.edit
import com.aryan.reader.paginatedreader.TtsChunk
import com.aryan.reader.shared.ReaderTtsReplacementEngine
import com.aryan.reader.shared.ReaderTtsReplacementPreferences
import com.aryan.reader.shared.ReaderTtsReplacementPreferencesJson
import org.dueattendant149.bookreader.paginatedreader.TtsChunk
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementEngine
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementPreferences
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementPreferencesJson
private const val READER_PREFS_NAME = "reader_prefs"
private const val TTS_REPLACEMENTS_KEY = "tts_word_replacements_json"

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
@ -56,11 +56,11 @@ import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.aryan.reader.shared.ReaderTtsReplacementBookSettings
import com.aryan.reader.shared.ReaderTtsReplacementEngine
import com.aryan.reader.shared.ReaderTtsReplacementPreferences
import com.aryan.reader.shared.ReaderTtsReplacementRule
import com.aryan.reader.shared.ReaderTtsReplacementSuggestions
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementBookSettings
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementEngine
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementPreferences
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementRule
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementSuggestions
private enum class TtsReplacementScope {
Global,

View file

@ -1,4 +1,4 @@
package com.aryan.reader
package org.dueattendant149.bookreader
import androidx.annotation.StringRes
import java.text.Normalizer

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
import android.content.Context
import androidx.room.Database

View file

@ -1,4 +1,4 @@
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
data class BookMetadataEdit(
val title: String?,

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
import androidx.room.Dao
import androidx.room.Insert

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
import androidx.room.ColumnInfo
import androidx.room.Entity

View file

@ -17,10 +17,10 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
import androidx.room.TypeConverter
import com.aryan.reader.FileType
import org.dueattendant149.bookreader.FileType
class FileTypeConverter {
@TypeConverter

View file

@ -1,8 +1,8 @@
// FolderBookMetadata.kt
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
import com.aryan.reader.FileType
import com.aryan.reader.shared.SharedFolderBookMetadata
import org.dueattendant149.bookreader.FileType
import org.dueattendant149.bookreader.shared.SharedFolderBookMetadata
data class FolderBookMetadata(
val bookId: String,

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
import android.content.Context
import android.net.Uri
@ -25,8 +25,8 @@ import android.provider.OpenableColumns
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.withContext
import com.aryan.reader.ReaderFontDiagnosticsTag
import com.aryan.reader.readerFontDiagnosticSummary
import org.dueattendant149.bookreader.ReaderFontDiagnosticsTag
import org.dueattendant149.bookreader.readerFontDiagnosticSummary
import timber.log.Timber
import java.io.File
import java.io.FileOutputStream

View file

@ -1,4 +1,4 @@
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
import androidx.room.Dao
import androidx.room.Insert

View file

@ -1,4 +1,4 @@
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
import androidx.room.Entity
import androidx.room.ForeignKey

View file

@ -1,19 +1,19 @@
// LocalSyncUtils.kt
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
import android.content.Context
import android.net.Uri
import android.os.Environment
import android.provider.DocumentsContract
import androidx.documentfile.provider.DocumentFile
import com.aryan.reader.ReaderPerfLog
import com.aryan.reader.shared.LOCAL_FOLDER_SIDECAR_HASH_PREFIX
import com.aryan.reader.shared.LOCAL_FOLDER_SYNC_DATA_DIR
import com.aryan.reader.shared.localFolderSyncAnnotationFileName
import com.aryan.reader.shared.localFolderSyncAnnotationTempFileName
import com.aryan.reader.shared.localFolderSyncMetadataFileName
import com.aryan.reader.shared.localFolderSyncMetadataTempFileName
import com.aryan.reader.shared.localFolderSyncSidecarStem
import org.dueattendant149.bookreader.ReaderPerfLog
import org.dueattendant149.bookreader.shared.LOCAL_FOLDER_SIDECAR_HASH_PREFIX
import org.dueattendant149.bookreader.shared.LOCAL_FOLDER_SYNC_DATA_DIR
import org.dueattendant149.bookreader.shared.localFolderSyncAnnotationFileName
import org.dueattendant149.bookreader.shared.localFolderSyncAnnotationTempFileName
import org.dueattendant149.bookreader.shared.localFolderSyncMetadataFileName
import org.dueattendant149.bookreader.shared.localFolderSyncMetadataTempFileName
import org.dueattendant149.bookreader.shared.localFolderSyncSidecarStem
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.json.JSONObject

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
/**
* Agnostic representation of a purchase to decouple MainViewModel from Billing Library.

View file

@ -18,7 +18,7 @@
* mail: epistemereader@gmail.com
*/
// RecentFileDao.kt
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
import androidx.room.Dao
import androidx.room.Query

View file

@ -17,13 +17,13 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import androidx.room.TypeConverters
import com.aryan.reader.FileType
import org.dueattendant149.bookreader.FileType
@Entity(tableName = "recent_files")
@TypeConverters(FileTypeConverter::class)

View file

@ -17,9 +17,9 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
import com.aryan.reader.FileType
import org.dueattendant149.bookreader.FileType
data class RecentFileItem(
val bookId: String,

View file

@ -1,4 +1,4 @@
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
import android.net.Uri
import androidx.core.net.toUri

View file

@ -18,27 +18,27 @@
* mail: epistemereader@gmail.com
*/
// RecentFilesRepository.kt
package com.aryan.reader.data
package org.dueattendant149.bookreader.data
import android.content.Context
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.net.Uri
import androidx.core.net.toUri
import com.aryan.reader.FileType
import com.aryan.reader.ReaderPerfLog
import com.aryan.reader.SyncedFolderPrefs
import com.aryan.reader.cloudSyncPreview
import com.aryan.reader.cloudSyncTraceSummary
import com.aryan.reader.logCloudAnnotationSyncTrace
import com.aryan.reader.logCloudSyncTrace
import com.aryan.reader.scaledToCanvasLimit
import org.dueattendant149.bookreader.FileType
import org.dueattendant149.bookreader.ReaderPerfLog
import org.dueattendant149.bookreader.SyncedFolderPrefs
import org.dueattendant149.bookreader.cloudSyncPreview
import org.dueattendant149.bookreader.cloudSyncTraceSummary
import org.dueattendant149.bookreader.logCloudAnnotationSyncTrace
import org.dueattendant149.bookreader.logCloudSyncTrace
import org.dueattendant149.bookreader.scaledToCanvasLimit
import timber.log.Timber
import com.aryan.reader.BookImporter
import com.aryan.reader.cloudSyncAnnotationSummary
import com.aryan.reader.paginatedreader.Locator
import com.aryan.reader.pdf.PdfRichTextRepository
import com.aryan.reader.epub.ImportedFileCache
import org.dueattendant149.bookreader.BookImporter
import org.dueattendant149.bookreader.cloudSyncAnnotationSummary
import org.dueattendant149.bookreader.paginatedreader.Locator
import org.dueattendant149.bookreader.pdf.PdfRichTextRepository
import org.dueattendant149.bookreader.epub.ImportedFileCache
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
@ -46,10 +46,10 @@ import kotlinx.coroutines.withContext
import androidx.room.withTransaction
import java.io.File
import java.io.FileOutputStream
import com.aryan.reader.pdf.data.PdfAnnotationRepository
import com.aryan.reader.pdf.data.PageLayoutRepository
import com.aryan.reader.pdf.data.PdfTextBoxRepository
import com.aryan.reader.shared.pdf.SharedPdfAnnotationSidecarCodec
import org.dueattendant149.bookreader.pdf.data.PdfAnnotationRepository
import org.dueattendant149.bookreader.pdf.data.PageLayoutRepository
import org.dueattendant149.bookreader.pdf.data.PdfTextBoxRepository
import org.dueattendant149.bookreader.shared.pdf.SharedPdfAnnotationSidecarCodec
import org.json.JSONObject
import org.json.JSONArray
import java.util.UUID
@ -71,7 +71,7 @@ class RecentFilesRepository(private val context: Context) {
private val pdfRichTextRepository = PdfRichTextRepository(context)
private val pageLayoutRepository = PageLayoutRepository(context)
private val pdfTextBoxRepository = PdfTextBoxRepository(context)
private val pdfHighlightRepository = com.aryan.reader.pdf.data.PdfHighlightRepository(context)
private val pdfHighlightRepository = org.dueattendant149.bookreader.pdf.data.PdfHighlightRepository(context)
val activeShelvesFlow = database.shelfDao().getAllActiveShelves()
val shelfCrossRefsFlow = database.shelfDao().getAllBookShelfCrossRefs()

View file

@ -0,0 +1,20 @@
package org.dueattendant149.bookreader.data
import org.dueattendant149.bookreader.toSharedBookItem
import org.dueattendant149.bookreader.shared.SmartCollectionEngine as SharedSmartCollectionEngine
typealias SmartField = org.dueattendant149.bookreader.shared.SmartField
typealias SmartOperator = org.dueattendant149.bookreader.shared.SmartOperator
typealias SmartRule = org.dueattendant149.bookreader.shared.SmartRule
typealias SmartCollectionDefinition = org.dueattendant149.bookreader.shared.SmartCollectionDefinition
object SmartCollectionEngine {
fun toJson(definition: SmartCollectionDefinition): String =
SharedSmartCollectionEngine.toJson(definition)
fun fromJson(json: String?): SmartCollectionDefinition? =
SharedSmartCollectionEngine.fromJson(json)
fun evaluate(book: RecentFileItem, definition: SmartCollectionDefinition): Boolean =
SharedSmartCollectionEngine.evaluate(book.toSharedBookItem(), definition)
}

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epub
package org.dueattendant149.bookreader.epub
import android.graphics.Bitmap
import android.graphics.BitmapFactory

View file

@ -1,13 +1,13 @@
// CalibreBundleExtractor.kt
package com.aryan.reader.epub
package org.dueattendant149.bookreader.epub
import android.content.Context
import android.graphics.BitmapFactory
import android.net.Uri
import androidx.core.net.toUri
import com.aryan.reader.BookImporter
import com.aryan.reader.FileType
import com.aryan.reader.data.RecentFilesRepository
import org.dueattendant149.bookreader.BookImporter
import org.dueattendant149.bookreader.FileType
import org.dueattendant149.bookreader.data.RecentFilesRepository
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.w3c.dom.Element

View file

@ -17,10 +17,10 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epub
package org.dueattendant149.bookreader.epub
import android.graphics.Bitmap
import com.aryan.reader.epub.EpubParser.EpubPageTarget
import org.dueattendant149.bookreader.epub.EpubParser.EpubPageTarget
import kotlinx.serialization.Serializable
import kotlinx.serialization.Transient
import java.io.File

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epub
package org.dueattendant149.bookreader.epub
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epub
package org.dueattendant149.bookreader.epub
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epub
package org.dueattendant149.bookreader.epub
import android.content.Context
import android.graphics.Bitmap

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epub
package org.dueattendant149.bookreader.epub
/**

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epub
package org.dueattendant149.bookreader.epub
import org.w3c.dom.Document
import org.w3c.dom.Element

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epub
package org.dueattendant149.bookreader.epub
import org.jsoup.Jsoup
import org.jsoup.nodes.Document

View file

@ -1,4 +1,4 @@
package com.aryan.reader.epub
package org.dueattendant149.bookreader.epub
import android.content.Context
import android.graphics.BitmapFactory

View file

@ -1,4 +1,4 @@
package com.aryan.reader.epub
package org.dueattendant149.bookreader.epub
import android.content.Context
import java.io.File

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epub
package org.dueattendant149.bookreader.epub
import android.content.Context
import android.graphics.BitmapFactory

View file

@ -1,4 +1,4 @@
package com.aryan.reader.epub
package org.dueattendant149.bookreader.epub
import android.content.Context
import android.graphics.BitmapFactory

View file

@ -17,10 +17,10 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epub
package org.dueattendant149.bookreader.epub
import android.content.Context
import com.aryan.reader.FileType
import org.dueattendant149.bookreader.FileType
import com.vladsch.flexmark.ext.autolink.AutolinkExtension
import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension
import com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension
@ -137,7 +137,7 @@ class SingleFileImporter(private val context: Context) {
val lowerHint = originalBookNameHint.lowercase()
val isCsv = lowerHint.endsWith(".csv") || lowerHint.endsWith(".tsv") ||
lowerHint.endsWith(".csv.txt") || lowerHint.endsWith(".tsv.txt")
val isCodeOrData = com.aryan.reader.isCodeOrDataFileName(originalBookNameHint)
val isCodeOrData = org.dueattendant149.bookreader.isCodeOrDataFileName(originalBookNameHint)
if (type == FileType.HTML && (isCsv || isCodeOrData)) {
return parseDynamicContentToHtml(inputStream, originalBookNameHint, bookId, parseContent, isCsv)
@ -747,7 +747,7 @@ class SingleFileImporter(private val context: Context) {
if (!originalBookNameHint.endsWith(".txt", ignoreCase = true)) return originalBookNameHint
val innerName = originalBookNameHint.dropLast(4)
return if (innerName.contains('.') && com.aryan.reader.isCodeOrDataFileName(innerName)) {
return if (innerName.contains('.') && org.dueattendant149.bookreader.isCodeOrDataFileName(innerName)) {
innerName
} else {
originalBookNameHint

View file

@ -18,7 +18,7 @@
* mail: epistemereader@gmail.com
*/
// ChapterWebView.kt
package com.aryan.reader.epubreader
package org.dueattendant149.bookreader.epubreader
import android.annotation.SuppressLint
import android.content.ActivityNotFoundException
@ -84,18 +84,18 @@ import androidx.compose.ui.viewinterop.AndroidView
import androidx.compose.ui.window.Popup
import androidx.compose.ui.window.PopupPositionProvider
import androidx.core.net.toUri
import com.aryan.reader.R
import com.aryan.reader.ReaderFontDiagnosticsTag
import com.aryan.reader.copyPlainTextToClipboard
import com.aryan.reader.getReaderTextureDataUri
import com.aryan.reader.readerFontDiagnosticSummary
import com.aryan.reader.shared.detectFontVariant
import com.aryan.reader.shared.familyFilenameSignature
import com.aryan.reader.shared.fontWeightCssDescriptor
import com.aryan.reader.shared.ui.SharedSelectionMenuRect
import com.aryan.reader.shared.ui.SharedSelectionMenuSize
import com.aryan.reader.shared.ui.SharedSelectionMenuViewport
import com.aryan.reader.shared.ui.sharedSelectionMenuPlacement
import org.dueattendant149.bookreader.R
import org.dueattendant149.bookreader.ReaderFontDiagnosticsTag
import org.dueattendant149.bookreader.copyPlainTextToClipboard
import org.dueattendant149.bookreader.getReaderTextureDataUri
import org.dueattendant149.bookreader.readerFontDiagnosticSummary
import org.dueattendant149.bookreader.shared.detectFontVariant
import org.dueattendant149.bookreader.shared.familyFilenameSignature
import org.dueattendant149.bookreader.shared.fontWeightCssDescriptor
import org.dueattendant149.bookreader.shared.ui.SharedSelectionMenuRect
import org.dueattendant149.bookreader.shared.ui.SharedSelectionMenuSize
import org.dueattendant149.bookreader.shared.ui.SharedSelectionMenuViewport
import org.dueattendant149.bookreader.shared.ui.sharedSelectionMenuPlacement
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import org.json.JSONObject

View file

@ -1,4 +1,4 @@
package com.aryan.reader.epubreader
package org.dueattendant149.bookreader.epubreader
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
@ -46,9 +46,9 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.core.graphics.drawable.toBitmap
import com.aryan.reader.R
import com.aryan.reader.areReaderAiFeaturesEnabled
import com.aryan.reader.readerModalMaxHeightDp
import org.dueattendant149.bookreader.R
import org.dueattendant149.bookreader.areReaderAiFeaturesEnabled
import org.dueattendant149.bookreader.readerModalMaxHeightDp
@Suppress("KotlinConstantConditions")
@OptIn(ExperimentalMaterial3Api::class)

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epubreader
package org.dueattendant149.bookreader.epubreader
import android.content.Context
import androidx.compose.foundation.layout.fillMaxWidth
@ -31,20 +31,20 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import com.aryan.reader.AiDefinitionPopup
import com.aryan.reader.AiFeature
import com.aryan.reader.AiDefinitionResult
import com.aryan.reader.AiHubBottomSheet
import com.aryan.reader.BuildConfig
import com.aryan.reader.R
import com.aryan.reader.SummarizationResult
import com.aryan.reader.SummaryCacheManager
import com.aryan.reader.callByokTextAi
import com.aryan.reader.epub.EpubBook
import com.aryan.reader.epub.contentFilePath
import com.aryan.reader.fetchRecap
import com.aryan.reader.paginatedreader.IPaginator
import com.aryan.reader.summarizationUrl
import org.dueattendant149.bookreader.AiDefinitionPopup
import org.dueattendant149.bookreader.AiFeature
import org.dueattendant149.bookreader.AiDefinitionResult
import org.dueattendant149.bookreader.AiHubBottomSheet
import org.dueattendant149.bookreader.BuildConfig
import org.dueattendant149.bookreader.R
import org.dueattendant149.bookreader.SummarizationResult
import org.dueattendant149.bookreader.SummaryCacheManager
import org.dueattendant149.bookreader.callByokTextAi
import org.dueattendant149.bookreader.epub.EpubBook
import org.dueattendant149.bookreader.epub.contentFilePath
import org.dueattendant149.bookreader.fetchRecap
import org.dueattendant149.bookreader.paginatedreader.IPaginator
import org.dueattendant149.bookreader.summarizationUrl
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.withContext

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epubreader
package org.dueattendant149.bookreader.epubreader
import android.content.Context
import android.widget.TextView
@ -69,19 +69,19 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import androidx.core.content.edit
import androidx.core.text.HtmlCompat
import com.aryan.reader.R
import com.aryan.reader.epub.EpubChapter
import com.aryan.reader.shared.EpubAnnotationSerializer
import com.aryan.reader.shared.ReaderLocator
import org.dueattendant149.bookreader.R
import org.dueattendant149.bookreader.epub.EpubChapter
import org.dueattendant149.bookreader.shared.EpubAnnotationSerializer
import org.dueattendant149.bookreader.shared.ReaderLocator
private const val BOOKMARK_PREFS_NAME = "epub_reader_bookmarks"
typealias Bookmark = com.aryan.reader.shared.EpubBookmark
typealias HighlightColor = com.aryan.reader.shared.HighlightColor
typealias UserHighlight = com.aryan.reader.shared.UserHighlight
typealias Bookmark = org.dueattendant149.bookreader.shared.EpubBookmark
typealias HighlightColor = org.dueattendant149.bookreader.shared.HighlightColor
typealias UserHighlight = org.dueattendant149.bookreader.shared.UserHighlight
fun escapeJsString(value: String): String {
return com.aryan.reader.shared.escapeJsString(value)
return org.dueattendant149.bookreader.shared.escapeJsString(value)
}
fun saveHighlightPalette(context: Context, palette: List<HighlightColor>) {

View file

@ -17,15 +17,15 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epubreader
package org.dueattendant149.bookreader.epubreader
import android.content.Context
import com.aryan.reader.R
import com.aryan.reader.applyBookReplacementsToHtmlDocument
import com.aryan.reader.epub.EpubBook
import com.aryan.reader.epub.contentFilePath
import com.aryan.reader.paginatedreader.LocatorConverter
import com.aryan.reader.shared.ReaderBookReplacementPreferences
import org.dueattendant149.bookreader.R
import org.dueattendant149.bookreader.applyBookReplacementsToHtmlDocument
import org.dueattendant149.bookreader.epub.EpubBook
import org.dueattendant149.bookreader.epub.contentFilePath
import org.dueattendant149.bookreader.paginatedreader.LocatorConverter
import org.dueattendant149.bookreader.shared.ReaderBookReplacementPreferences
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.jsoup.Jsoup

View file

@ -1,4 +1,4 @@
package com.aryan.reader.epubreader
package org.dueattendant149.bookreader.epubreader
import android.os.Build
import androidx.annotation.RequiresApi
@ -116,20 +116,20 @@ import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties
import androidx.compose.ui.zIndex
import androidx.media3.common.util.UnstableApi
import com.aryan.reader.BuildConfig
import com.aryan.reader.R
import com.aryan.reader.RenderMode
import com.aryan.reader.SearchState
import com.aryan.reader.SearchTopBar
import com.aryan.reader.TooltipIconButton
import com.aryan.reader.areReaderAiFeaturesEnabled
import com.aryan.reader.loadNativeVoice
import com.aryan.reader.readerSliderStepPage
import com.aryan.reader.shared.ui.ReaderMinimalSlider
import com.aryan.reader.tts.GEMINI_TTS_SPEAKERS
import com.aryan.reader.tts.ReaderTtsOverlaySize
import com.aryan.reader.tts.TtsPlaybackManager.TtsState
import com.aryan.reader.tts.formatReaderTtsChunkLabel
import org.dueattendant149.bookreader.BuildConfig
import org.dueattendant149.bookreader.R
import org.dueattendant149.bookreader.RenderMode
import org.dueattendant149.bookreader.SearchState
import org.dueattendant149.bookreader.SearchTopBar
import org.dueattendant149.bookreader.TooltipIconButton
import org.dueattendant149.bookreader.areReaderAiFeaturesEnabled
import org.dueattendant149.bookreader.loadNativeVoice
import org.dueattendant149.bookreader.readerSliderStepPage
import org.dueattendant149.bookreader.shared.ui.ReaderMinimalSlider
import org.dueattendant149.bookreader.tts.GEMINI_TTS_SPEAKERS
import org.dueattendant149.bookreader.tts.ReaderTtsOverlaySize
import org.dueattendant149.bookreader.tts.TtsPlaybackManager.TtsState
import org.dueattendant149.bookreader.tts.formatReaderTtsChunkLabel
import kotlin.math.roundToInt
enum class ReaderTool(@StringRes val titleRes: Int, val category: String) {
@ -1018,7 +1018,7 @@ fun EpubReaderBottomBar(
isTtsSessionActive: Boolean,
ttsState: TtsState,
isProUser: Boolean,
currentTtsMode: com.aryan.reader.tts.TtsPlaybackManager.TtsMode,
currentTtsMode: org.dueattendant149.bookreader.tts.TtsPlaybackManager.TtsMode,
isSliderActive: Boolean,
onOpenSlider: () -> Unit,
onOpenDrawer: () -> Unit,
@ -2097,9 +2097,9 @@ private fun HiddenEpubToolMenuItem(
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun TtsOverlayControls(
ttsController: com.aryan.reader.tts.TtsController,
ttsController: org.dueattendant149.bookreader.tts.TtsController,
ttsState: TtsState,
currentTtsMode: com.aryan.reader.tts.TtsPlaybackManager.TtsMode,
currentTtsMode: org.dueattendant149.bookreader.tts.TtsPlaybackManager.TtsMode,
overlaySize: ReaderTtsOverlaySize,
onOverlaySizeChange: (ReaderTtsOverlaySize) -> Unit,
onLocateCurrentChunk: () -> Unit,
@ -2114,7 +2114,7 @@ fun TtsOverlayControls(
var isDraggingRate by remember { mutableStateOf(false) }
var isDraggingPitch by remember { mutableStateOf(false) }
val activeMode = try { com.aryan.reader.tts.TtsPlaybackManager.TtsMode.valueOf(ttsState.ttsMode) } catch(_: Exception) { com.aryan.reader.tts.TtsPlaybackManager.TtsMode.CLOUD }
val activeMode = try { org.dueattendant149.bookreader.tts.TtsPlaybackManager.TtsMode.valueOf(ttsState.ttsMode) } catch(_: Exception) { org.dueattendant149.bookreader.tts.TtsPlaybackManager.TtsMode.CLOUD }
val progressPercent = ttsState.bookProgressPercent
val cleanChapterTitle = remember(ttsState.chapterTitle) {
ttsState.chapterTitle
@ -2163,7 +2163,7 @@ fun TtsOverlayControls(
val saveAndApply = {
saveTtsSpeechRate(context, rate)
saveTtsPitch(context, pitch)
if (activeMode == com.aryan.reader.tts.TtsPlaybackManager.TtsMode.CLOUD) {
if (activeMode == org.dueattendant149.bookreader.tts.TtsPlaybackManager.TtsMode.CLOUD) {
ttsController.setPlaybackParameters(rate, pitch)
} else {
ttsController.sliceAndRetainPosition()
@ -2357,7 +2357,7 @@ fun TtsOverlayControls(
shape = RoundedCornerShape(8.dp)
) {
Text(
if (activeMode == com.aryan.reader.tts.TtsPlaybackManager.TtsMode.CLOUD) {
if (activeMode == org.dueattendant149.bookreader.tts.TtsPlaybackManager.TtsMode.CLOUD) {
stringResource(R.string.tts_mode_cloud_ai)
} else {
stringResource(R.string.tts_mode_device_native)
@ -2372,7 +2372,7 @@ fun TtsOverlayControls(
color = MaterialTheme.colorScheme.secondaryContainer,
shape = RoundedCornerShape(8.dp)
) {
val voiceName = if (activeMode == com.aryan.reader.tts.TtsPlaybackManager.TtsMode.CLOUD) {
val voiceName = if (activeMode == org.dueattendant149.bookreader.tts.TtsPlaybackManager.TtsMode.CLOUD) {
GEMINI_TTS_SPEAKERS.find { it.id == ttsState.speakerId }?.name ?: ttsState.speakerId
} else loadNativeVoice(context)?.split("-")?.lastOrNull() ?: stringResource(R.string.label_default)
@ -2386,7 +2386,7 @@ fun TtsOverlayControls(
)
}
if (BuildConfig.FLAVOR != "oss" && activeMode == com.aryan.reader.tts.TtsPlaybackManager.TtsMode.CLOUD) {
if (BuildConfig.FLAVOR != "oss" && activeMode == org.dueattendant149.bookreader.tts.TtsPlaybackManager.TtsMode.CLOUD) {
Surface(
color = MaterialTheme.colorScheme.tertiaryContainer,
shape = RoundedCornerShape(8.dp)
@ -2554,7 +2554,7 @@ fun TtsOverlayControls(
Slider(
value = rate,
onValueChange = {
rate = it; if (!isDraggingRate && activeMode != com.aryan.reader.tts.TtsPlaybackManager.TtsMode.CLOUD) {
rate = it; if (!isDraggingRate && activeMode != org.dueattendant149.bookreader.tts.TtsPlaybackManager.TtsMode.CLOUD) {
isDraggingRate = true; ttsController.pause()
}
},
@ -2627,7 +2627,7 @@ fun TtsOverlayControls(
Slider(
value = pitch,
onValueChange = {
pitch = it; if (!isDraggingPitch && activeMode != com.aryan.reader.tts.TtsPlaybackManager.TtsMode.CLOUD) {
pitch = it; if (!isDraggingPitch && activeMode != org.dueattendant149.bookreader.tts.TtsPlaybackManager.TtsMode.CLOUD) {
isDraggingPitch = true; ttsController.pause()
}
},

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epubreader
package org.dueattendant149.bookreader.epubreader
import android.graphics.BitmapFactory
import androidx.compose.animation.animateColorAsState
@ -97,10 +97,10 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.util.fastSumBy
import com.aryan.reader.R
import com.aryan.reader.RenderMode
import com.aryan.reader.epub.EpubChapter
import com.aryan.reader.epub.EpubTocEntry
import org.dueattendant149.bookreader.R
import org.dueattendant149.bookreader.RenderMode
import org.dueattendant149.bookreader.epub.EpubChapter
import org.dueattendant149.bookreader.epub.EpubTocEntry
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

View file

@ -1,8 +1,8 @@
package com.aryan.reader.epubreader
package org.dueattendant149.bookreader.epubreader
import com.aryan.reader.epub.EpubBook
import com.aryan.reader.epub.EpubChapter
import com.aryan.reader.paginatedreader.AndroidHtmlResourceResolver
import org.dueattendant149.bookreader.epub.EpubBook
import org.dueattendant149.bookreader.epub.EpubChapter
import org.dueattendant149.bookreader.paginatedreader.AndroidHtmlResourceResolver
import org.jsoup.Jsoup
import org.jsoup.nodes.Element
import java.io.File

View file

@ -22,7 +22,7 @@
"UnusedVariable", "Unused", "SimplifyBooleanWithConstants", "KotlinConstantConditions"
)
package com.aryan.reader.epubreader
package org.dueattendant149.bookreader.epubreader
import android.Manifest
import android.annotation.SuppressLint
@ -151,90 +151,90 @@ import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.media3.common.util.UnstableApi
import com.aryan.reader.AiDefinitionResult
import com.aryan.reader.BuildConfig
import com.aryan.reader.copyPlainTextToClipboard
import com.aryan.reader.BookWordReplacementsSheet
import com.aryan.reader.BuiltInThemes
import com.aryan.reader.MainViewModel
import com.aryan.reader.R
import com.aryan.reader.ReaderBrightnessEffect
import com.aryan.reader.ReaderFileInfoDialogs
import com.aryan.reader.ReaderBrightnessSheet
import com.aryan.reader.ReaderScreenOrientationEffect
import com.aryan.reader.ReaderScreenOrientationSheet
import com.aryan.reader.ReaderThemePanel
import com.aryan.reader.RenderMode
import com.aryan.reader.SearchResult
import com.aryan.reader.SummarizationResult
import com.aryan.reader.SummaryCacheManager
import com.aryan.reader.TtsSettingsSheet
import com.aryan.reader.TtsWordReplacementsSheet
import com.aryan.reader.areReaderAiFeaturesEnabled
import com.aryan.reader.countWords
import com.aryan.reader.isByokCloudTtsAvailable
import com.aryan.reader.data.CustomFontEntity
import com.aryan.reader.epub.EpubBook
import com.aryan.reader.epub.hasReadableExtractedContent
import com.aryan.reader.epub.plainTextCharacterCount
import com.aryan.reader.fetchAiDefinition
import com.aryan.reader.loadCustomThemes
import com.aryan.reader.loadGlobalTextureTransparency
import com.aryan.reader.loadBookReplacementPreferences
import com.aryan.reader.loadReaderBrightnessSettings
import com.aryan.reader.loadReaderScreenOrientationMode
import com.aryan.reader.loadEpubRightToLeftPagination
import com.aryan.reader.loadReaderThemeId
import com.aryan.reader.loadReaderSliderToggled
import com.aryan.reader.loadReaderTextureBitmap
import com.aryan.reader.loadTtsReplacementPreferences
import com.aryan.reader.readerSliderBookmarkPosition
import com.aryan.reader.readerSliderChromeColors
import com.aryan.reader.readerSliderToggleState
import com.aryan.reader.paginatedreader.CssParser
import com.aryan.reader.paginatedreader.BookPaginator
import com.aryan.reader.paginatedreader.HeaderBlock
import com.aryan.reader.paginatedreader.IPaginator
import com.aryan.reader.paginatedreader.ListItemBlock
import com.aryan.reader.paginatedreader.Locator
import com.aryan.reader.paginatedreader.LocatorConverter
import com.aryan.reader.paginatedreader.NativeVerticalLocation
import com.aryan.reader.paginatedreader.NativeVerticalReaderScreen
import com.aryan.reader.paginatedreader.PaginatedReaderScreen
import com.aryan.reader.paginatedreader.ParagraphBlock
import com.aryan.reader.paginatedreader.QuoteBlock
import com.aryan.reader.paginatedreader.TextContentBlock
import com.aryan.reader.paginatedreader.TtsChunk
import com.aryan.reader.paginatedreader.buildEpubFontFaceCss
import com.aryan.reader.paginatedreader.data.BookCacheDatabase
import com.aryan.reader.paginatedreader.locatorForPersistence
import com.aryan.reader.paginatedreader.nativeVerticalChapterPageInfo
import com.aryan.reader.paginatedreader.nativeVerticalProgressForCompatPage
import com.aryan.reader.paginatedreader.semanticBlockModule
import com.aryan.reader.rememberSearchState
import com.aryan.reader.saveCustomThemes
import com.aryan.reader.saveGlobalTextureTransparency
import com.aryan.reader.saveBookReplacementPreferences
import com.aryan.reader.saveReaderBrightnessSettings
import com.aryan.reader.saveReaderScreenOrientationMode
import com.aryan.reader.saveEpubRightToLeftPagination
import com.aryan.reader.saveReaderThemeId
import com.aryan.reader.saveReaderSliderToggled
import com.aryan.reader.saveTtsReplacementPreferences
import com.aryan.reader.shouldRenderReaderSlider
import com.aryan.reader.shared.ReaderBookReplacementPreferences
import com.aryan.reader.shared.ReaderTtsReplacementPreferences
import com.aryan.reader.shared.ReaderLocator as SharedReaderLocator
import com.aryan.reader.tts.ReaderTtsOverlaySize
import com.aryan.reader.tts.SpeakerSamplePlayer
import com.aryan.reader.tts.TtsPlaybackManager
import com.aryan.reader.tts.loadTtsMode
import com.aryan.reader.tts.loadReaderTtsOverlaySize
import com.aryan.reader.tts.readerTtsOverlayAlignmentBias
import com.aryan.reader.tts.saveReaderTtsOverlaySize
import com.aryan.reader.tts.splitTextIntoChunks
import com.aryan.reader.withTtsReplacements
import com.aryan.reader.shared.reader.ReaderJumpHistory
import org.dueattendant149.bookreader.AiDefinitionResult
import org.dueattendant149.bookreader.BuildConfig
import org.dueattendant149.bookreader.copyPlainTextToClipboard
import org.dueattendant149.bookreader.BookWordReplacementsSheet
import org.dueattendant149.bookreader.BuiltInThemes
import org.dueattendant149.bookreader.MainViewModel
import org.dueattendant149.bookreader.R
import org.dueattendant149.bookreader.ReaderBrightnessEffect
import org.dueattendant149.bookreader.ReaderFileInfoDialogs
import org.dueattendant149.bookreader.ReaderBrightnessSheet
import org.dueattendant149.bookreader.ReaderScreenOrientationEffect
import org.dueattendant149.bookreader.ReaderScreenOrientationSheet
import org.dueattendant149.bookreader.ReaderThemePanel
import org.dueattendant149.bookreader.RenderMode
import org.dueattendant149.bookreader.SearchResult
import org.dueattendant149.bookreader.SummarizationResult
import org.dueattendant149.bookreader.SummaryCacheManager
import org.dueattendant149.bookreader.TtsSettingsSheet
import org.dueattendant149.bookreader.TtsWordReplacementsSheet
import org.dueattendant149.bookreader.areReaderAiFeaturesEnabled
import org.dueattendant149.bookreader.countWords
import org.dueattendant149.bookreader.isByokCloudTtsAvailable
import org.dueattendant149.bookreader.data.CustomFontEntity
import org.dueattendant149.bookreader.epub.EpubBook
import org.dueattendant149.bookreader.epub.hasReadableExtractedContent
import org.dueattendant149.bookreader.epub.plainTextCharacterCount
import org.dueattendant149.bookreader.fetchAiDefinition
import org.dueattendant149.bookreader.loadCustomThemes
import org.dueattendant149.bookreader.loadGlobalTextureTransparency
import org.dueattendant149.bookreader.loadBookReplacementPreferences
import org.dueattendant149.bookreader.loadReaderBrightnessSettings
import org.dueattendant149.bookreader.loadReaderScreenOrientationMode
import org.dueattendant149.bookreader.loadEpubRightToLeftPagination
import org.dueattendant149.bookreader.loadReaderThemeId
import org.dueattendant149.bookreader.loadReaderSliderToggled
import org.dueattendant149.bookreader.loadReaderTextureBitmap
import org.dueattendant149.bookreader.loadTtsReplacementPreferences
import org.dueattendant149.bookreader.readerSliderBookmarkPosition
import org.dueattendant149.bookreader.readerSliderChromeColors
import org.dueattendant149.bookreader.readerSliderToggleState
import org.dueattendant149.bookreader.paginatedreader.CssParser
import org.dueattendant149.bookreader.paginatedreader.BookPaginator
import org.dueattendant149.bookreader.paginatedreader.HeaderBlock
import org.dueattendant149.bookreader.paginatedreader.IPaginator
import org.dueattendant149.bookreader.paginatedreader.ListItemBlock
import org.dueattendant149.bookreader.paginatedreader.Locator
import org.dueattendant149.bookreader.paginatedreader.LocatorConverter
import org.dueattendant149.bookreader.paginatedreader.NativeVerticalLocation
import org.dueattendant149.bookreader.paginatedreader.NativeVerticalReaderScreen
import org.dueattendant149.bookreader.paginatedreader.PaginatedReaderScreen
import org.dueattendant149.bookreader.paginatedreader.ParagraphBlock
import org.dueattendant149.bookreader.paginatedreader.QuoteBlock
import org.dueattendant149.bookreader.paginatedreader.TextContentBlock
import org.dueattendant149.bookreader.paginatedreader.TtsChunk
import org.dueattendant149.bookreader.paginatedreader.buildEpubFontFaceCss
import org.dueattendant149.bookreader.paginatedreader.data.BookCacheDatabase
import org.dueattendant149.bookreader.paginatedreader.locatorForPersistence
import org.dueattendant149.bookreader.paginatedreader.nativeVerticalChapterPageInfo
import org.dueattendant149.bookreader.paginatedreader.nativeVerticalProgressForCompatPage
import org.dueattendant149.bookreader.paginatedreader.semanticBlockModule
import org.dueattendant149.bookreader.rememberSearchState
import org.dueattendant149.bookreader.saveCustomThemes
import org.dueattendant149.bookreader.saveGlobalTextureTransparency
import org.dueattendant149.bookreader.saveBookReplacementPreferences
import org.dueattendant149.bookreader.saveReaderBrightnessSettings
import org.dueattendant149.bookreader.saveReaderScreenOrientationMode
import org.dueattendant149.bookreader.saveEpubRightToLeftPagination
import org.dueattendant149.bookreader.saveReaderThemeId
import org.dueattendant149.bookreader.saveReaderSliderToggled
import org.dueattendant149.bookreader.saveTtsReplacementPreferences
import org.dueattendant149.bookreader.shouldRenderReaderSlider
import org.dueattendant149.bookreader.shared.ReaderBookReplacementPreferences
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementPreferences
import org.dueattendant149.bookreader.shared.ReaderLocator as SharedReaderLocator
import org.dueattendant149.bookreader.tts.ReaderTtsOverlaySize
import org.dueattendant149.bookreader.tts.SpeakerSamplePlayer
import org.dueattendant149.bookreader.tts.TtsPlaybackManager
import org.dueattendant149.bookreader.tts.loadTtsMode
import org.dueattendant149.bookreader.tts.loadReaderTtsOverlaySize
import org.dueattendant149.bookreader.tts.readerTtsOverlayAlignmentBias
import org.dueattendant149.bookreader.tts.saveReaderTtsOverlaySize
import org.dueattendant149.bookreader.tts.splitTextIntoChunks
import org.dueattendant149.bookreader.withTtsReplacements
import org.dueattendant149.bookreader.shared.reader.ReaderJumpHistory
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
@ -707,7 +707,7 @@ fun EpubReaderHost(
var showBrightnessSheet by remember { mutableStateOf(false) }
ReaderBrightnessEffect(window, readerBrightnessSettings)
val updateReaderBrightness: (com.aryan.reader.ReaderBrightnessSettings) -> Unit = { settings ->
val updateReaderBrightness: (org.dueattendant149.bookreader.ReaderBrightnessSettings) -> Unit = { settings ->
readerBrightnessSettings = settings
saveReaderBrightnessSettings(context, settings)
}

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epubreader
package org.dueattendant149.bookreader.epubreader
import timber.log.Timber
import android.webkit.WebView
@ -39,14 +39,14 @@ import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.aryan.reader.RenderMode
import com.aryan.reader.SearchNavigationControls
import com.aryan.reader.SearchResult
import com.aryan.reader.SearchResultsPanel
import com.aryan.reader.SearchState
import com.aryan.reader.epub.EpubBook
import com.aryan.reader.epub.contentFilePath
import com.aryan.reader.paginatedreader.IPaginator
import org.dueattendant149.bookreader.RenderMode
import org.dueattendant149.bookreader.SearchNavigationControls
import org.dueattendant149.bookreader.SearchResult
import org.dueattendant149.bookreader.SearchResultsPanel
import org.dueattendant149.bookreader.SearchState
import org.dueattendant149.bookreader.epub.EpubBook
import org.dueattendant149.bookreader.epub.contentFilePath
import org.dueattendant149.bookreader.paginatedreader.IPaginator
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epubreader
package org.dueattendant149.bookreader.epubreader
import android.content.Context
import android.net.Uri
@ -106,29 +106,29 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.core.content.edit
import com.aryan.reader.R
import com.aryan.reader.ReaderFontDiagnosticsTag
import com.aryan.reader.data.CustomFontEntity
import com.aryan.reader.readerModalMaxHeightDp
import com.aryan.reader.readerFontDiagnosticSummary
import com.aryan.reader.supportedFontMimeTypes
import com.aryan.reader.shared.CustomFontItem
import com.aryan.reader.shared.detectFontVariant
import com.aryan.reader.shared.fontFaceSummary
import com.aryan.reader.shared.familyFilenameSignature
import com.aryan.reader.shared.groupByFamily
import com.aryan.reader.shared.hasVariableWeightFace
import com.aryan.reader.shared.supportsVariableWeightAxis
import org.dueattendant149.bookreader.R
import org.dueattendant149.bookreader.ReaderFontDiagnosticsTag
import org.dueattendant149.bookreader.data.CustomFontEntity
import org.dueattendant149.bookreader.readerModalMaxHeightDp
import org.dueattendant149.bookreader.readerFontDiagnosticSummary
import org.dueattendant149.bookreader.supportedFontMimeTypes
import org.dueattendant149.bookreader.shared.CustomFontItem
import org.dueattendant149.bookreader.shared.detectFontVariant
import org.dueattendant149.bookreader.shared.fontFaceSummary
import org.dueattendant149.bookreader.shared.familyFilenameSignature
import org.dueattendant149.bookreader.shared.groupByFamily
import org.dueattendant149.bookreader.shared.hasVariableWeightFace
import org.dueattendant149.bookreader.shared.supportsVariableWeightAxis
import timber.log.Timber
import java.io.File
import kotlin.math.roundToInt
typealias ReaderFont = com.aryan.reader.shared.ReaderFont
typealias ReaderTextAlign = com.aryan.reader.shared.ReaderTextAlign
typealias SystemUiMode = com.aryan.reader.shared.SystemUiMode
typealias PageInfoMode = com.aryan.reader.shared.PageInfoMode
typealias PageInfoPosition = com.aryan.reader.shared.PageInfoPosition
typealias FormatSettings = com.aryan.reader.shared.FormatSettings
typealias ReaderFont = org.dueattendant149.bookreader.shared.ReaderFont
typealias ReaderTextAlign = org.dueattendant149.bookreader.shared.ReaderTextAlign
typealias SystemUiMode = org.dueattendant149.bookreader.shared.SystemUiMode
typealias PageInfoMode = org.dueattendant149.bookreader.shared.PageInfoMode
typealias PageInfoPosition = org.dueattendant149.bookreader.shared.PageInfoPosition
typealias FormatSettings = org.dueattendant149.bookreader.shared.FormatSettings
const val SETTINGS_PREFS_NAME = "epub_reader_settings"
private const val TEXT_ALIGN_KEY = "reader_text_align"

View file

@ -17,7 +17,7 @@
*
* mail: epistemereader@gmail.com
*/
package com.aryan.reader.epubreader
package org.dueattendant149.bookreader.epubreader
import timber.log.Timber
import android.graphics.Color
@ -34,9 +34,9 @@ import androidx.compose.ui.input.key.type
import androidx.core.view.WindowCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsControllerCompat
import com.aryan.reader.paginatedreader.AndroidEpubKeyCommand
import com.aryan.reader.paginatedreader.androidEpubKeyCommandOrNull
import com.aryan.reader.RenderMode
import org.dueattendant149.bookreader.paginatedreader.AndroidEpubKeyCommand
import org.dueattendant149.bookreader.paginatedreader.androidEpubKeyCommandOrNull
import org.dueattendant149.bookreader.RenderMode
@Composable
fun EpubReaderSystemUiController(

Some files were not shown because too many files have changed in this diff Show more