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:
parent
e615128a23
commit
5f64f3d722
631 changed files with 3082 additions and 3006 deletions
76
AGENTS.md
Normal file
76
AGENTS.md
Normal file
|
|
@ -0,0 +1,76 @@
|
||||||
|
# Book Reader — Episteme fork + bookshelf-api/ABS
|
||||||
|
|
||||||
|
> Форк `Aryan-Raj3112/episteme` под bookshelf-api + Audiobookshelf + Material You 3 (Myne-style UI).
|
||||||
|
|
||||||
|
## Stack
|
||||||
|
|
||||||
|
- **Язык:** Kotlin 100%
|
||||||
|
- **UI:** Jetpack Compose + Material3 (Myne-style: round cards, dynamic color, minimal)
|
||||||
|
- **DI:** Dagger Hilt
|
||||||
|
- **БД:** Room
|
||||||
|
- **Настройки:** DataStore
|
||||||
|
- **Сеть:** Retrofit + OkHttp + Kotlinx Serialization
|
||||||
|
- **Аудио:** ExoPlayer (Media3) + MediaSession
|
||||||
|
- **Фоновые задачи:** WorkManager
|
||||||
|
- **Читалка:** Episteme paginatedreader (CSS-движок, ContentBlock/Page модель)
|
||||||
|
- **Форматы:** EPUB, FB2, PDF, MOBI/AZW3, DOCX, ODT, TXT, Markdown, HTML, comics
|
||||||
|
- **minSdk:** 26 (Episteme default)
|
||||||
|
- **compileSdk/targetSdk:** 36
|
||||||
|
|
||||||
|
## Origin
|
||||||
|
|
||||||
|
- **upstream:** `https://github.com/Aryan-Raj3112/episteme.git` (AGPL-3.0)
|
||||||
|
- **origin:** `https://git.dueattendant149.org/Atte149/book-reader.git` (Forgejo)
|
||||||
|
- **Лицензия:** AGPL-3.0 (наследуется от Episteme)
|
||||||
|
|
||||||
|
## Goal
|
||||||
|
|
||||||
|
- Взять зрелый reader engine из Episteme (пагинация, все форматы, TTS, annotations)
|
||||||
|
- Redesign UI под Myne-стиль (Material You 3, round cards, dynamic color)
|
||||||
|
- Заменить backend (OPDS/Gutenberg/LocalFolder) на bookshelf-api + ABS
|
||||||
|
- Добавить фичи из Book's Story: audio player, RSVP, Librarr search, TTS jobs, cache, progress sync, upload
|
||||||
|
|
||||||
|
## Layout
|
||||||
|
|
||||||
|
- `app/src/main/` — Android app (после KMP→Android упрощения)
|
||||||
|
- `app/src/oss/` — OSS flavor (без проприетарных ML Kit/cloud)
|
||||||
|
- `app/src/releaseOffline/` — offline-only flavor
|
||||||
|
- ~~`desktopApp/`~~ — удалён (Android-only)
|
||||||
|
- ~~`shared/`~~ — слит в `app/src/main/` (после Этапа 1)
|
||||||
|
|
||||||
|
## Backend
|
||||||
|
|
||||||
|
- **bookshelf-api:** `https://books.dueattendant149.org/api/v1/*`
|
||||||
|
- `GET /api/v1/books/libraries`
|
||||||
|
- `GET /api/v1/books/{item_id}`
|
||||||
|
- `GET /api/v1/books/library/{id}/items`
|
||||||
|
- `POST /api/v1/search`
|
||||||
|
- `POST /api/v1/tts`, `GET /api/v1/tts/{job_id}`
|
||||||
|
- `POST /api/v1/download`, `GET /api/v1/download/list`
|
||||||
|
- **Audiobookshelf (напрямую):**
|
||||||
|
- `GET /api/items/{id}/file/{ino}`
|
||||||
|
- `GET /api/items/{id}/cover`
|
||||||
|
- `GET /api/items/{id}/download`
|
||||||
|
|
||||||
|
## WARNs
|
||||||
|
|
||||||
|
- **Не пушить в `upstream` (Aryan-Raj3112/episteme).** Только в `origin` (Forgejo).
|
||||||
|
- **AGPL-3.0** — если публикуем, исходный код должен быть открыт (включая server-side modifications если есть network use).
|
||||||
|
- **`pro` flavor** содержит проприетарные компоненты (ML Kit OCR, cloud sync) — не использовать, только `oss`.
|
||||||
|
- **Секреты** (ABS token, API keys) — только в `.env` / DataStore, никогда в коде.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./gradlew :app:assembleOssDebug
|
||||||
|
```
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
- Phase 0: clone + package rename — completed
|
||||||
|
- Phase 1: KMP → Android-only — pending
|
||||||
|
- Phase 2: backend swap (bookshelf-api + ABS) — pending
|
||||||
|
- Phase 3: UI redesign (Myne-style) — pending
|
||||||
|
- Phase 4: features from Book's Story (audio/RSVP/search/TTS/cache) — pending
|
||||||
|
- Phase 5: reader engine integration — pending
|
||||||
|
- Phase 6: build, test, deploy — pending
|
||||||
|
|
@ -50,11 +50,11 @@ kotlin {
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.aryan.reader"
|
namespace = "org.dueattendant149.bookreader"
|
||||||
compileSdk = 36
|
compileSdk = 36
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "com.aryan.reader"
|
applicationId = "org.dueattendant149.bookreader"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 54
|
versionCode = 54
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import com.aryan.reader.shared.FileType
|
import org.dueattendant149.bookreader.shared.FileType
|
||||||
import com.aryan.reader.shared.ReaderFeatureSurface
|
import org.dueattendant149.bookreader.shared.ReaderFeatureSurface
|
||||||
import com.aryan.reader.shared.ReaderPlatform
|
import org.dueattendant149.bookreader.shared.ReaderPlatform
|
||||||
import com.aryan.reader.shared.SharedFileCapabilities
|
import org.dueattendant149.bookreader.shared.SharedFileCapabilities
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
|
@ -11,7 +11,7 @@ import androidx.compose.ui.test.performClick
|
||||||
import androidx.compose.ui.test.performTouchInput
|
import androidx.compose.ui.test.performTouchInput
|
||||||
import androidx.test.core.app.ApplicationProvider
|
import androidx.test.core.app.ApplicationProvider
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import org.junit.Rule
|
import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||||
|
|
@ -17,8 +17,8 @@ import androidx.compose.ui.test.performTextInput
|
||||||
import androidx.compose.ui.test.performTouchInput
|
import androidx.compose.ui.test.performTouchInput
|
||||||
import androidx.test.core.app.ApplicationProvider
|
import androidx.test.core.app.ApplicationProvider
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import com.aryan.reader.data.TagEntity
|
import org.dueattendant149.bookreader.data.TagEntity
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import org.junit.Rule
|
import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader.epubreader
|
package org.dueattendant149.bookreader.epubreader
|
||||||
|
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package com.aryan.reader.epubreader
|
package org.dueattendant149.bookreader.epubreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.test.core.app.ApplicationProvider
|
import androidx.test.core.app.ApplicationProvider
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import com.aryan.reader.epub.EpubChapter
|
import org.dueattendant149.bookreader.epub.EpubChapter
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import org.json.JSONArray
|
import org.json.JSONArray
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
package com.aryan.reader.epubreader
|
package org.dueattendant149.bookreader.epubreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.compose.ui.text.SpanStyle
|
import androidx.compose.ui.text.SpanStyle
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.test.core.app.ApplicationProvider
|
import androidx.test.core.app.ApplicationProvider
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import com.aryan.reader.epub.EpubBook
|
import org.dueattendant149.bookreader.epub.EpubBook
|
||||||
import com.aryan.reader.epub.EpubChapter
|
import org.dueattendant149.bookreader.epub.EpubChapter
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.After
|
import org.junit.After
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader.epubreader
|
package org.dueattendant149.bookreader.epubreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
|
@ -23,15 +23,15 @@ import androidx.test.core.app.ActivityScenario
|
||||||
import androidx.test.core.app.ApplicationProvider
|
import androidx.test.core.app.ApplicationProvider
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
import androidx.test.platform.app.InstrumentationRegistry
|
||||||
import com.aryan.reader.FileType
|
import org.dueattendant149.bookreader.FileType
|
||||||
import com.aryan.reader.FileHasher
|
import org.dueattendant149.bookreader.FileHasher
|
||||||
import com.aryan.reader.MainActivity
|
import org.dueattendant149.bookreader.MainActivity
|
||||||
import com.aryan.reader.R
|
import org.dueattendant149.bookreader.R
|
||||||
import com.aryan.reader.RenderMode
|
import org.dueattendant149.bookreader.RenderMode
|
||||||
import com.aryan.reader.data.AppDatabase
|
import org.dueattendant149.bookreader.data.AppDatabase
|
||||||
import com.aryan.reader.data.RecentFileEntity
|
import org.dueattendant149.bookreader.data.RecentFileEntity
|
||||||
import com.aryan.reader.shared.EpubAnnotationSerializer
|
import org.dueattendant149.bookreader.shared.EpubAnnotationSerializer
|
||||||
import com.aryan.reader.shared.ReaderLocator
|
import org.dueattendant149.bookreader.shared.ReaderLocator
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
import org.junit.After
|
import org.junit.After
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader.tts
|
package org.dueattendant149.bookreader.epubreader
|
||||||
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// CssParserTest.kt
|
// CssParserTest.kt
|
||||||
package com.aryan.reader.paginatedreader
|
package org.dueattendant149.bookreader.paginatedreader
|
||||||
|
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.isSpecified
|
import androidx.compose.ui.graphics.isSpecified
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// HtmlParserTest.kt
|
// HtmlParserTest.kt
|
||||||
package com.aryan.reader.paginatedreader
|
package org.dueattendant149.bookreader.paginatedreader
|
||||||
|
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// MainDispatcherRule.kt
|
// MainDispatcherRule.kt
|
||||||
package com.aryan.reader.pdf
|
package org.dueattendant149.bookreader.paginatedreader
|
||||||
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// PaginatedReaderDataTest.kt
|
// PaginatedReaderDataTest.kt
|
||||||
package com.aryan.reader.paginatedreader
|
package org.dueattendant149.bookreader.paginatedreader
|
||||||
|
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.text.ParagraphStyle
|
import androidx.compose.ui.text.ParagraphStyle
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader.paginatedreader
|
package org.dueattendant149.bookreader.paginatedreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
|
|
@ -15,8 +15,8 @@ import androidx.compose.ui.unit.Density
|
||||||
import androidx.test.core.app.ApplicationProvider
|
import androidx.test.core.app.ApplicationProvider
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import androidx.test.filters.SdkSuppress
|
import androidx.test.filters.SdkSuppress
|
||||||
import com.aryan.reader.SearchResult
|
import org.dueattendant149.bookreader.SearchResult
|
||||||
import com.aryan.reader.epub.EpubBook
|
import org.dueattendant149.bookreader.epub.EpubBook
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import io.mockk.mockk
|
import io.mockk.mockk
|
||||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// PaginatorTest.kt
|
// PaginatorTest.kt
|
||||||
package com.aryan.reader.paginatedreader
|
package org.dueattendant149.bookreader.paginatedreader
|
||||||
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import androidx.compose.ui.text.AnnotatedString
|
import androidx.compose.ui.text.AnnotatedString
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader.paginatedreader
|
package org.dueattendant149.bookreader.paginatedreader
|
||||||
|
|
||||||
import androidx.compose.ui.geometry.Offset
|
import androidx.compose.ui.geometry.Offset
|
||||||
import androidx.compose.ui.test.junit4.createComposeRule
|
import androidx.compose.ui.test.junit4.createComposeRule
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// StyleUtilsTest.kt
|
// StyleUtilsTest.kt
|
||||||
package com.aryan.reader.paginatedreader
|
package org.dueattendant149.bookreader.paginatedreader
|
||||||
|
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.isUnspecified
|
import androidx.compose.ui.unit.isUnspecified
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// MainDispatcherRule.kt
|
// MainDispatcherRule.kt
|
||||||
package com.aryan.reader.paginatedreader
|
package org.dueattendant149.bookreader.pdf
|
||||||
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// PdfAnnotationTest.kt
|
// PdfAnnotationTest.kt
|
||||||
package com.aryan.reader.pdf
|
package org.dueattendant149.bookreader.pdf
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
|
@ -20,8 +20,8 @@ import androidx.core.content.FileProvider
|
||||||
import androidx.test.core.app.ActivityScenario
|
import androidx.test.core.app.ActivityScenario
|
||||||
import androidx.test.core.app.ApplicationProvider
|
import androidx.test.core.app.ApplicationProvider
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import com.aryan.reader.MainActivity
|
import org.dueattendant149.bookreader.MainActivity
|
||||||
import com.aryan.reader.R
|
import org.dueattendant149.bookreader.R
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import org.junit.After
|
import org.junit.After
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// app/src/androidTest/java/com/aryan/reader/pdf/PdfCoverGeneratorTest.kt
|
// app/src/androidTest/java/com/aryan/reader/pdf/PdfCoverGeneratorTest.kt
|
||||||
package com.aryan.reader.pdf
|
package org.dueattendant149.bookreader.pdf
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// app/src/androidTest/java/com/aryan/reader/pdf/PdfHelperTest.kt
|
// app/src/androidTest/java/com/aryan/reader/pdf/PdfHelperTest.kt
|
||||||
package com.aryan.reader.pdf
|
package org.dueattendant149.bookreader.pdf
|
||||||
|
|
||||||
import android.graphics.Rect
|
import android.graphics.Rect
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader.pdf
|
package org.dueattendant149.bookreader.pdf
|
||||||
|
|
||||||
import android.Manifest
|
import android.Manifest
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
|
@ -21,8 +21,8 @@ import androidx.test.core.app.ActivityScenario
|
||||||
import androidx.test.core.app.ApplicationProvider
|
import androidx.test.core.app.ApplicationProvider
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
import androidx.test.rule.GrantPermissionRule
|
import androidx.test.rule.GrantPermissionRule
|
||||||
import com.aryan.reader.MainActivity
|
import org.dueattendant149.bookreader.MainActivity
|
||||||
import com.aryan.reader.R
|
import org.dueattendant149.bookreader.R
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import org.junit.After
|
import org.junit.After
|
||||||
import org.junit.Before
|
import org.junit.Before
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// BaseTtsSynthesizerTest.kt
|
// BaseTtsSynthesizerTest.kt
|
||||||
package com.aryan.reader.tts
|
package org.dueattendant149.bookreader.tts
|
||||||
|
|
||||||
import android.speech.tts.TextToSpeech
|
import android.speech.tts.TextToSpeech
|
||||||
import androidx.test.core.app.ApplicationProvider
|
import androidx.test.core.app.ApplicationProvider
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader.epubreader
|
package org.dueattendant149.bookreader.tts
|
||||||
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// TtsUtilsTest.kt
|
// TtsUtilsTest.kt
|
||||||
package com.aryan.reader.tts
|
package org.dueattendant149.bookreader.tts
|
||||||
|
|
||||||
import com.google.common.truth.Truth.assertThat
|
import com.google.common.truth.Truth.assertThat
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
package com.aryan.reader.epubreader
|
package org.dueattendant149.bookreader.epubreader
|
||||||
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import com.aryan.reader.RenderMode
|
import org.dueattendant149.bookreader.RenderMode
|
||||||
import com.aryan.reader.epub.EpubBook
|
import org.dueattendant149.bookreader.epub.EpubBook
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
|
|
||||||
class EpubTestActivity : ComponentActivity() {
|
class EpubTestActivity : ComponentActivity() {
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader.epubreader
|
package org.dueattendant149.bookreader.epubreader
|
||||||
|
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader.ml
|
package org.dueattendant149.bookreader.ml
|
||||||
|
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import android.graphics.RectF
|
import android.graphics.RectF
|
||||||
|
|
@ -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
|
|
||||||
}
|
|
||||||
|
|
@ -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)
|
|
||||||
}
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
package com.aryan.reader.opds
|
|
||||||
|
|
||||||
typealias OpdsParser = com.aryan.reader.shared.opds.SharedOpdsParser
|
|
||||||
|
|
@ -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"
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
||||||
class AndroidFolderPathResolver : FolderPathResolver {
|
class AndroidFolderPathResolver : FolderPathResolver {
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import com.aryan.reader.shared.SharedFeaturePolicy
|
import org.dueattendant149.bookreader.shared.SharedFeaturePolicy
|
||||||
import com.aryan.reader.shared.SharedSettingsHubInput
|
import org.dueattendant149.bookreader.shared.SharedSettingsHubInput
|
||||||
import com.aryan.reader.shared.SharedSettingsPlatform
|
import org.dueattendant149.bookreader.shared.SharedSettingsPlatform
|
||||||
|
|
||||||
fun androidSettingsHubInput(
|
fun androidSettingsHubInput(
|
||||||
uiState: ReaderScreenState,
|
uiState: ReaderScreenState,
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import com.aryan.reader.data.TagEntity
|
import org.dueattendant149.bookreader.data.TagEntity
|
||||||
import com.aryan.reader.shared.AppAction as SharedAppAction
|
import org.dueattendant149.bookreader.shared.AppAction as SharedAppAction
|
||||||
import com.aryan.reader.shared.LibraryAction as SharedLibraryAction
|
import org.dueattendant149.bookreader.shared.LibraryAction as SharedLibraryAction
|
||||||
import com.aryan.reader.shared.SharedFolderPathResolver
|
import org.dueattendant149.bookreader.shared.SharedFolderPathResolver
|
||||||
import com.aryan.reader.shared.SharedLibraryProjectionInput
|
import org.dueattendant149.bookreader.shared.SharedLibraryProjectionInput
|
||||||
import com.aryan.reader.shared.SharedLibraryStateProjector
|
import org.dueattendant149.bookreader.shared.SharedLibraryStateProjector
|
||||||
import com.aryan.reader.shared.SharedReaderScreenState
|
import org.dueattendant149.bookreader.shared.SharedReaderScreenState
|
||||||
import com.aryan.reader.shared.reduce
|
import org.dueattendant149.bookreader.shared.reduce
|
||||||
|
|
||||||
internal object AndroidSharedStateBridge {
|
internal object AndroidSharedStateBridge {
|
||||||
fun prepareLibraryProjection(
|
fun prepareLibraryProjection(
|
||||||
|
|
@ -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.Font
|
||||||
import androidx.compose.ui.text.font.FontFamily
|
import androidx.compose.ui.text.font.FontFamily
|
||||||
import com.aryan.reader.data.CustomFontEntity
|
import org.dueattendant149.bookreader.data.CustomFontEntity
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
fun AppFontPreference.toAndroidAppFontFamily(customFonts: List<CustomFontEntity>): FontFamily? {
|
fun AppFontPreference.toAndroidAppFontFamily(customFonts: List<CustomFontEntity>): FontFamily? {
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
*
|
*
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
@ -59,14 +59,14 @@ import androidx.navigation.NavHostController
|
||||||
import androidx.navigation.compose.NavHost
|
import androidx.navigation.compose.NavHost
|
||||||
import androidx.navigation.compose.composable
|
import androidx.navigation.compose.composable
|
||||||
import androidx.navigation.compose.currentBackStackEntryAsState
|
import androidx.navigation.compose.currentBackStackEntryAsState
|
||||||
import com.aryan.reader.epubreader.EpubReaderScreen
|
import org.dueattendant149.bookreader.epubreader.EpubReaderScreen
|
||||||
import com.aryan.reader.feedback.FeedbackScreen
|
import org.dueattendant149.bookreader.feedback.FeedbackScreen
|
||||||
import com.aryan.reader.feedback.SupportProjectScreen
|
import org.dueattendant149.bookreader.feedback.SupportProjectScreen
|
||||||
import com.aryan.reader.pdf.PdfViewerScreen
|
import org.dueattendant149.bookreader.pdf.PdfViewerScreen
|
||||||
import com.aryan.reader.shared.ReaderFeatureSurface
|
import org.dueattendant149.bookreader.shared.ReaderFeatureSurface
|
||||||
import com.aryan.reader.tts.ReaderTtsMiniBar
|
import org.dueattendant149.bookreader.tts.ReaderTtsMiniBar
|
||||||
import com.aryan.reader.tts.readerTtsMiniBarBottomPaddingDp
|
import org.dueattendant149.bookreader.tts.readerTtsMiniBarBottomPaddingDp
|
||||||
import com.aryan.reader.tts.shouldShowReaderTtsMiniBar
|
import org.dueattendant149.bookreader.tts.shouldShowReaderTtsMiniBar
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
|
|
||||||
object AppDestinations {
|
object AppDestinations {
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import com.aryan.reader.data.TagEntity
|
import org.dueattendant149.bookreader.data.TagEntity
|
||||||
import com.aryan.reader.epub.CalibreBundleResult
|
import org.dueattendant149.bookreader.epub.CalibreBundleResult
|
||||||
import com.aryan.reader.epub.EpubBook
|
import org.dueattendant149.bookreader.epub.EpubBook
|
||||||
import com.aryan.reader.paginatedreader.Locator
|
import org.dueattendant149.bookreader.paginatedreader.Locator
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
typealias BannerMessage = com.aryan.reader.shared.BannerMessage
|
typealias BannerMessage = org.dueattendant149.bookreader.shared.BannerMessage
|
||||||
typealias UserData = com.aryan.reader.shared.UserData
|
typealias UserData = org.dueattendant149.bookreader.shared.UserData
|
||||||
typealias AppThemeMode = com.aryan.reader.shared.AppThemeMode
|
typealias AppThemeMode = org.dueattendant149.bookreader.shared.AppThemeMode
|
||||||
typealias AppContrastOption = com.aryan.reader.shared.AppContrastOption
|
typealias AppContrastOption = org.dueattendant149.bookreader.shared.AppContrastOption
|
||||||
typealias AppFontPreference = com.aryan.reader.shared.AppFontPreference
|
typealias AppFontPreference = org.dueattendant149.bookreader.shared.AppFontPreference
|
||||||
typealias AppFontPreferenceKind = com.aryan.reader.shared.AppFontPreferenceKind
|
typealias AppFontPreferenceKind = org.dueattendant149.bookreader.shared.AppFontPreferenceKind
|
||||||
typealias CustomAppTheme = com.aryan.reader.shared.CustomAppTheme
|
typealias CustomAppTheme = org.dueattendant149.bookreader.shared.CustomAppTheme
|
||||||
|
|
||||||
data class ImportResult(
|
data class ImportResult(
|
||||||
val internalUri: Uri,
|
val internalUri: Uri,
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
*
|
*
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
|
@ -29,7 +29,7 @@ import java.io.FileOutputStream
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
import com.aryan.reader.shared.SharedFileCapabilities
|
import org.dueattendant149.bookreader.shared.SharedFileCapabilities
|
||||||
|
|
||||||
private const val BOOKS_DIR = "books"
|
private const val BOOKS_DIR = "books"
|
||||||
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
import com.aryan.reader.shared.ReaderBookReplacementPreferences
|
import org.dueattendant149.bookreader.shared.ReaderBookReplacementPreferences
|
||||||
import com.aryan.reader.shared.ReaderBookReplacementPreferencesJson
|
import org.dueattendant149.bookreader.shared.ReaderBookReplacementPreferencesJson
|
||||||
import com.aryan.reader.shared.ReaderWordReplacementEngine
|
import org.dueattendant149.bookreader.shared.ReaderWordReplacementEngine
|
||||||
import com.aryan.reader.shared.ReaderWordReplacementRule
|
import org.dueattendant149.bookreader.shared.ReaderWordReplacementRule
|
||||||
import org.jsoup.nodes.Document
|
import org.jsoup.nodes.Document
|
||||||
import org.jsoup.nodes.Node
|
import org.jsoup.nodes.Node
|
||||||
import org.jsoup.nodes.TextNode
|
import org.jsoup.nodes.TextNode
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
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.input.KeyboardType
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.aryan.reader.shared.ReaderBookReplacementEngine
|
import org.dueattendant149.bookreader.shared.ReaderBookReplacementEngine
|
||||||
import com.aryan.reader.shared.ReaderBookReplacementPreferences
|
import org.dueattendant149.bookreader.shared.ReaderBookReplacementPreferences
|
||||||
import com.aryan.reader.shared.ReaderWordReplacementRule
|
import org.dueattendant149.bookreader.shared.ReaderWordReplacementRule
|
||||||
|
|
||||||
private data class BookRuleEditTarget(
|
private data class BookRuleEditTarget(
|
||||||
val ruleId: String? = null,
|
val ruleId: String? = null,
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.ClipData
|
import android.content.ClipData
|
||||||
import android.content.ClipboardManager
|
import android.content.ClipboardManager
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import com.aryan.reader.data.BookMetadata
|
import org.dueattendant149.bookreader.data.BookMetadata
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
|
|
||||||
internal fun RecentFileItem.needsRemoteEpubAnnotationMetadataGuard(): Boolean {
|
internal fun RecentFileItem.needsRemoteEpubAnnotationMetadataGuard(): Boolean {
|
||||||
return type in EPUB_READER_FILE_TYPES &&
|
return type in EPUB_READER_FILE_TYPES &&
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.aryan.reader.data.BookMetadata
|
import org.dueattendant149.bookreader.data.BookMetadata
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import com.aryan.reader.data.effectiveAnnotationModifiedTimestamp
|
import org.dueattendant149.bookreader.data.effectiveAnnotationModifiedTimestamp
|
||||||
import com.aryan.reader.data.effectiveReadingPositionModifiedTimestamp
|
import org.dueattendant149.bookreader.data.effectiveReadingPositionModifiedTimestamp
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
||||||
internal const val CloudSyncTraceTag = "EpistemeCloudSync"
|
internal const val CloudSyncTraceTag = "EpistemeCloudSync"
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Common.kt
|
// Common.kt
|
||||||
@file:OptIn(ExperimentalMaterial3Api::class) @file:Suppress("KotlinConstantConditions")
|
@file:OptIn(ExperimentalMaterial3Api::class) @file:Suppress("KotlinConstantConditions")
|
||||||
|
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
|
|
@ -166,23 +166,23 @@ import androidx.compose.ui.window.PopupProperties
|
||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
import androidx.core.graphics.toColorInt
|
import androidx.core.graphics.toColorInt
|
||||||
import androidx.media3.common.util.UnstableApi
|
import androidx.media3.common.util.UnstableApi
|
||||||
import com.aryan.reader.epubreader.PREF_CUSTOM_THEMES
|
import org.dueattendant149.bookreader.epubreader.PREF_CUSTOM_THEMES
|
||||||
import com.aryan.reader.epubreader.PREF_READER_THEME
|
import org.dueattendant149.bookreader.epubreader.PREF_READER_THEME
|
||||||
import com.aryan.reader.paginatedreader.TtsChunk
|
import org.dueattendant149.bookreader.paginatedreader.TtsChunk
|
||||||
import com.aryan.reader.pdf.PdfHighlightColor
|
import org.dueattendant149.bookreader.pdf.PdfHighlightColor
|
||||||
import com.aryan.reader.shared.BuiltInReaderThemes
|
import org.dueattendant149.bookreader.shared.BuiltInReaderThemes
|
||||||
import com.aryan.reader.shared.ReaderTextureFilePrefix
|
import org.dueattendant149.bookreader.shared.ReaderTextureFilePrefix
|
||||||
import com.aryan.reader.shared.normalizeReaderTextureExtension
|
import org.dueattendant149.bookreader.shared.normalizeReaderTextureExtension
|
||||||
import com.aryan.reader.shared.readerTextureDisplayName as sharedReaderTextureDisplayName
|
import org.dueattendant149.bookreader.shared.readerTextureDisplayName as sharedReaderTextureDisplayName
|
||||||
import com.aryan.reader.shared.readerTextureMimeTypeForExtension
|
import org.dueattendant149.bookreader.shared.readerTextureMimeTypeForExtension
|
||||||
import com.aryan.reader.tts.GEMINI_TTS_SPEAKERS
|
import org.dueattendant149.bookreader.tts.GEMINI_TTS_SPEAKERS
|
||||||
import com.aryan.reader.tts.SpeakerSamplePlayer
|
import org.dueattendant149.bookreader.tts.SpeakerSamplePlayer
|
||||||
import com.aryan.reader.tts.TtsCacheManager
|
import org.dueattendant149.bookreader.tts.TtsCacheManager
|
||||||
import com.aryan.reader.tts.TtsPlaybackManager
|
import org.dueattendant149.bookreader.tts.TtsPlaybackManager
|
||||||
import com.aryan.reader.tts.formatBytes
|
import org.dueattendant149.bookreader.tts.formatBytes
|
||||||
import com.aryan.reader.tts.loadTtsMode
|
import org.dueattendant149.bookreader.tts.loadTtsMode
|
||||||
import com.aryan.reader.tts.rememberTtsController
|
import org.dueattendant149.bookreader.tts.rememberTtsController
|
||||||
import com.aryan.reader.tts.splitTextIntoChunks
|
import org.dueattendant149.bookreader.tts.splitTextIntoChunks
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
|
|
@ -218,8 +218,8 @@ import kotlin.math.min
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
import kotlin.math.sqrt
|
import kotlin.math.sqrt
|
||||||
|
|
||||||
typealias ReaderTexture = com.aryan.reader.shared.ReaderTexture
|
typealias ReaderTexture = org.dueattendant149.bookreader.shared.ReaderTexture
|
||||||
typealias ReaderTheme = com.aryan.reader.shared.ReaderTheme
|
typealias ReaderTheme = org.dueattendant149.bookreader.shared.ReaderTheme
|
||||||
|
|
||||||
const val aiServerBasePath = BuildConfig.AI_WORKER_URL
|
const val aiServerBasePath = BuildConfig.AI_WORKER_URL
|
||||||
const val summarizeEndpoint = "/summarize"
|
const val summarizeEndpoint = "/summarize"
|
||||||
|
|
@ -474,9 +474,9 @@ data class SearchResult(
|
||||||
val chunkIndex: Int
|
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(
|
data class CachedSummaryItem(
|
||||||
val chapterIndex: Int,
|
val chapterIndex: Int,
|
||||||
|
|
@ -3845,7 +3845,7 @@ fun AiResultContentView(
|
||||||
result: SummarizationResult?,
|
result: SummarizationResult?,
|
||||||
isLoading: Boolean,
|
isLoading: Boolean,
|
||||||
isMainTtsActive: Boolean,
|
isMainTtsActive: Boolean,
|
||||||
ttsController: com.aryan.reader.tts.TtsController,
|
ttsController: org.dueattendant149.bookreader.tts.TtsController,
|
||||||
ttsState: TtsPlaybackManager.TtsState,
|
ttsState: TtsPlaybackManager.TtsState,
|
||||||
getAuthToken: suspend () -> String?,
|
getAuthToken: suspend () -> String?,
|
||||||
onRegenerate: (() -> Unit)? = null,
|
onRegenerate: (() -> Unit)? = null,
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.util.Xml
|
import android.util.Xml
|
||||||
import org.xmlpull.v1.XmlPullParser
|
import org.xmlpull.v1.XmlPullParser
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
import androidx.documentfile.provider.DocumentFile
|
import androidx.documentfile.provider.DocumentFile
|
||||||
import com.aryan.reader.data.BookMetadataEdit
|
import org.dueattendant149.bookreader.data.BookMetadataEdit
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import com.aryan.reader.shared.reader.SharedEpubMetadataEditor
|
import org.dueattendant149.bookreader.shared.reader.SharedEpubMetadataEditor
|
||||||
import com.aryan.reader.shared.reader.SharedEpubMetadataSnapshot
|
import org.dueattendant149.bookreader.shared.reader.SharedEpubMetadataSnapshot
|
||||||
import com.aryan.reader.shared.reader.SharedEpubMetadataUpdate
|
import org.dueattendant149.bookreader.shared.reader.SharedEpubMetadataUpdate
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
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 {
|
object ExternalFileOpenRouteDecider {
|
||||||
const val BEHAVIOR_TEMPORARY = "TEMPORARY"
|
const val BEHAVIOR_TEMPORARY = "TEMPORARY"
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
*
|
*
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
|
|
@ -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? {
|
internal fun resolveFileTypeFromName(fileName: String?): FileType? {
|
||||||
return SharedFileCapabilities.resolveFileTypeForName(fileName)
|
return SharedFileCapabilities.resolveFileTypeForName(fileName)
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
// FolderSyncWorker.kt
|
// FolderSyncWorker.kt
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
@ -29,25 +29,25 @@ import androidx.work.ExistingWorkPolicy
|
||||||
import androidx.work.OneTimeWorkRequestBuilder
|
import androidx.work.OneTimeWorkRequestBuilder
|
||||||
import androidx.work.WorkerParameters
|
import androidx.work.WorkerParameters
|
||||||
import androidx.work.WorkManager
|
import androidx.work.WorkManager
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import com.aryan.reader.data.RecentFilesRepository
|
import org.dueattendant149.bookreader.data.RecentFilesRepository
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.sync.Mutex
|
import kotlinx.coroutines.sync.Mutex
|
||||||
import kotlinx.coroutines.sync.withLock
|
import kotlinx.coroutines.sync.withLock
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
import com.aryan.reader.data.LocalSyncUtils
|
import org.dueattendant149.bookreader.data.LocalSyncUtils
|
||||||
import com.aryan.reader.data.FolderBookMetadata
|
import org.dueattendant149.bookreader.data.FolderBookMetadata
|
||||||
import com.aryan.reader.data.toSharedFolderBookMetadata
|
import org.dueattendant149.bookreader.data.toSharedFolderBookMetadata
|
||||||
import com.aryan.reader.shared.BookItem as SharedBookItem
|
import org.dueattendant149.bookreader.shared.BookItem as SharedBookItem
|
||||||
import com.aryan.reader.shared.EpubAnnotationSerializer
|
import org.dueattendant149.bookreader.shared.EpubAnnotationSerializer
|
||||||
import com.aryan.reader.shared.EpubBookmark
|
import org.dueattendant149.bookreader.shared.EpubBookmark
|
||||||
import com.aryan.reader.shared.LOCAL_FOLDER_SYNC_DATA_DIR
|
import org.dueattendant149.bookreader.shared.LOCAL_FOLDER_SYNC_DATA_DIR
|
||||||
import com.aryan.reader.shared.LocalFolderSyncEngine
|
import org.dueattendant149.bookreader.shared.LocalFolderSyncEngine
|
||||||
import com.aryan.reader.shared.ReaderLocator
|
import org.dueattendant149.bookreader.shared.ReaderLocator
|
||||||
import com.aryan.reader.shared.SharedFolderScannedFile
|
import org.dueattendant149.bookreader.shared.SharedFolderScannedFile
|
||||||
import com.aryan.reader.shared.SharedReaderScreenState
|
import org.dueattendant149.bookreader.shared.SharedReaderScreenState
|
||||||
import com.aryan.reader.shared.reader.ReaderBookmark
|
import org.dueattendant149.bookreader.shared.reader.ReaderBookmark
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import android.provider.DocumentsContract
|
import android.provider.DocumentsContract
|
||||||
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// FontsScreen.kt
|
// FontsScreen.kt
|
||||||
@file:Suppress("KotlinConstantConditions")
|
@file:Suppress("KotlinConstantConditions")
|
||||||
|
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import androidx.activity.compose.BackHandler
|
import androidx.activity.compose.BackHandler
|
||||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
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.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||||
import com.aryan.reader.shared.CustomFontItem
|
import org.dueattendant149.bookreader.shared.CustomFontItem
|
||||||
import com.aryan.reader.shared.CustomFontFamilyItem
|
import org.dueattendant149.bookreader.shared.CustomFontFamilyItem
|
||||||
import com.aryan.reader.shared.CustomFontVariantItem
|
import org.dueattendant149.bookreader.shared.CustomFontVariantItem
|
||||||
import com.aryan.reader.shared.fontFaceLabel
|
import org.dueattendant149.bookreader.shared.fontFaceLabel
|
||||||
import com.aryan.reader.shared.fontFaceSummary
|
import org.dueattendant149.bookreader.shared.fontFaceSummary
|
||||||
import com.aryan.reader.shared.groupByFamily
|
import org.dueattendant149.bookreader.shared.groupByFamily
|
||||||
import com.aryan.reader.shared.hasVariableWeightFace
|
import org.dueattendant149.bookreader.shared.hasVariableWeightFace
|
||||||
import com.aryan.reader.shared.ui.SharedAppFontSelector
|
import org.dueattendant149.bookreader.shared.ui.SharedAppFontSelector
|
||||||
import com.aryan.reader.shared.ui.SharedFontSettingsSection
|
import org.dueattendant149.bookreader.shared.ui.SharedFontSettingsSection
|
||||||
import com.aryan.reader.shared.ui.SharedFontSettingsTabs
|
import org.dueattendant149.bookreader.shared.ui.SharedFontSettingsTabs
|
||||||
import com.aryan.reader.data.CustomFontEntity
|
import org.dueattendant149.bookreader.data.CustomFontEntity
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
// HomeScreen
|
// HomeScreen
|
||||||
@file:Suppress("DEPRECATION")
|
@file:Suppress("DEPRECATION")
|
||||||
|
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
|
|
@ -145,7 +145,7 @@ import androidx.media3.common.util.UnstableApi
|
||||||
import androidx.navigation.NavHostController
|
import androidx.navigation.NavHostController
|
||||||
import coil.compose.AsyncImage
|
import coil.compose.AsyncImage
|
||||||
import coil.request.ImageRequest
|
import coil.request.ImageRequest
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
|
|
@ -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
|
||||||
|
}
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
// LibraryScreen.kt
|
// LibraryScreen.kt
|
||||||
@file:Suppress("KotlinConstantConditions")
|
@file:Suppress("KotlinConstantConditions")
|
||||||
|
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
|
@ -141,16 +141,16 @@ import androidx.navigation.NavHostController
|
||||||
import coil.ImageLoader
|
import coil.ImageLoader
|
||||||
import coil.compose.AsyncImage
|
import coil.compose.AsyncImage
|
||||||
import coil.decode.SvgDecoder
|
import coil.decode.SvgDecoder
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import com.aryan.reader.data.TagEntity
|
import org.dueattendant149.bookreader.data.TagEntity
|
||||||
import com.aryan.reader.opds.OpdsAcquisition
|
import org.dueattendant149.bookreader.opds.OpdsAcquisition
|
||||||
import com.aryan.reader.opds.OpdsCatalog
|
import org.dueattendant149.bookreader.opds.OpdsCatalog
|
||||||
import com.aryan.reader.opds.OpdsDownloadState
|
import org.dueattendant149.bookreader.opds.OpdsDownloadState
|
||||||
import com.aryan.reader.opds.OpdsEntry
|
import org.dueattendant149.bookreader.opds.OpdsEntry
|
||||||
import com.aryan.reader.opds.OpdsRepository
|
import org.dueattendant149.bookreader.opds.OpdsRepository
|
||||||
import com.aryan.reader.opds.OpdsViewModel
|
import org.dueattendant149.bookreader.opds.OpdsViewModel
|
||||||
import com.aryan.reader.shared.LOCAL_FOLDER_SYNC_DATA_DIR
|
import org.dueattendant149.bookreader.shared.LOCAL_FOLDER_SYNC_DATA_DIR
|
||||||
import com.aryan.reader.shared.opds.SharedOpdsLocalBookMatcher
|
import org.dueattendant149.bookreader.shared.opds.SharedOpdsLocalBookMatcher
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import com.aryan.reader.data.BookShelfCrossRef
|
import org.dueattendant149.bookreader.data.BookShelfCrossRef
|
||||||
import com.aryan.reader.data.BookTagCrossRef
|
import org.dueattendant149.bookreader.data.BookTagCrossRef
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import com.aryan.reader.data.ShelfEntity
|
import org.dueattendant149.bookreader.data.ShelfEntity
|
||||||
import com.aryan.reader.data.TagEntity
|
import org.dueattendant149.bookreader.data.TagEntity
|
||||||
import com.aryan.reader.shared.SharedReaderScreenState
|
import org.dueattendant149.bookreader.shared.SharedReaderScreenState
|
||||||
import com.aryan.reader.shared.applyLibraryFilters as sharedApplyLibraryFilters
|
import org.dueattendant149.bookreader.shared.applyLibraryFilters as sharedApplyLibraryFilters
|
||||||
import com.aryan.reader.shared.filterBySearch as sharedFilterBySearch
|
import org.dueattendant149.bookreader.shared.filterBySearch as sharedFilterBySearch
|
||||||
import com.aryan.reader.shared.sortBooks as sharedSortBooks
|
import org.dueattendant149.bookreader.shared.sortBooks as sharedSortBooks
|
||||||
|
|
||||||
fun interface FolderPathResolver {
|
fun interface FolderPathResolver {
|
||||||
fun relativeFolderSegments(item: RecentFileItem): List<String>
|
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))
|
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 }
|
val byId = associateBy { it.bookId }
|
||||||
return sharedBooks.mapNotNull { byId[it.id] }
|
return sharedBooks.mapNotNull { byId[it.id] }
|
||||||
}
|
}
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
*
|
*
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
|
|
@ -41,8 +41,8 @@ import androidx.compose.runtime.remember
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import androidx.navigation.compose.rememberNavController
|
import androidx.navigation.compose.rememberNavController
|
||||||
import com.aryan.reader.data.PlatformFeaturesRepository
|
import org.dueattendant149.bookreader.data.PlatformFeaturesRepository
|
||||||
import com.aryan.reader.ui.theme.AppTheme
|
import org.dueattendant149.bookreader.ui.theme.AppTheme
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import androidx.compose.foundation.isSystemInDarkTheme
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
|
|
@ -50,12 +50,12 @@ import androidx.compose.runtime.getValue
|
||||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||||
import androidx.media3.common.util.UnstableApi
|
import androidx.media3.common.util.UnstableApi
|
||||||
import com.aryan.reader.tts.ACTION_OPEN_TTS_SESSION
|
import org.dueattendant149.bookreader.tts.ACTION_OPEN_TTS_SESSION
|
||||||
import com.aryan.reader.tts.EXTRA_TTS_BOOK_ID
|
import org.dueattendant149.bookreader.tts.EXTRA_TTS_BOOK_ID
|
||||||
import com.aryan.reader.tts.EXTRA_TTS_CHAPTER_INDEX
|
import org.dueattendant149.bookreader.tts.EXTRA_TTS_CHAPTER_INDEX
|
||||||
import com.aryan.reader.tts.EXTRA_TTS_PAGE_INDEX
|
import org.dueattendant149.bookreader.tts.EXTRA_TTS_PAGE_INDEX
|
||||||
import com.aryan.reader.tts.EXTRA_TTS_SOURCE_CFI
|
import org.dueattendant149.bookreader.tts.EXTRA_TTS_SOURCE_CFI
|
||||||
import com.aryan.reader.tts.EXTRA_TTS_START_OFFSET
|
import org.dueattendant149.bookreader.tts.EXTRA_TTS_START_OFFSET
|
||||||
|
|
||||||
@UnstableApi
|
@UnstableApi
|
||||||
open class MainActivity : AppCompatActivity() {
|
open class MainActivity : AppCompatActivity() {
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
internal const val KEY_RENDER_MODE = "render_mode"
|
internal const val KEY_RENDER_MODE = "render_mode"
|
||||||
internal const val KEY_FOLDER_SYNC_ENABLED = "folder_sync_enabled"
|
internal const val KEY_FOLDER_SYNC_ENABLED = "folder_sync_enabled"
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
// MainScreen.kt
|
// MainScreen.kt
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.enableEdgeToEdge
|
import androidx.activity.enableEdgeToEdge
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
// MainViewModel.kt
|
// MainViewModel.kt
|
||||||
@file:Suppress("DEPRECATION", "ANNOTATION_WILL_BE_APPLIED_ALSO_TO_PROPERTY_OR_FIELD")
|
@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.app.Application
|
||||||
import android.content.ClipData
|
import android.content.ClipData
|
||||||
|
|
@ -31,11 +31,11 @@ import android.database.Cursor
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import com.aryan.reader.tts.TtsController
|
import org.dueattendant149.bookreader.tts.TtsController
|
||||||
import com.aryan.reader.tts.TtsPlaybackManager
|
import org.dueattendant149.bookreader.tts.TtsPlaybackManager
|
||||||
import com.aryan.reader.paginatedreader.LocatorConverter
|
import org.dueattendant149.bookreader.paginatedreader.LocatorConverter
|
||||||
import kotlinx.serialization.protobuf.ProtoBuf
|
import kotlinx.serialization.protobuf.ProtoBuf
|
||||||
import com.aryan.reader.paginatedreader.semanticBlockModule
|
import org.dueattendant149.bookreader.paginatedreader.semanticBlockModule
|
||||||
import android.provider.DocumentsContract
|
import android.provider.DocumentsContract
|
||||||
import android.provider.OpenableColumns
|
import android.provider.OpenableColumns
|
||||||
import androidx.annotation.OptIn
|
import androidx.annotation.OptIn
|
||||||
|
|
@ -53,72 +53,72 @@ import androidx.work.ExistingWorkPolicy
|
||||||
import androidx.work.OneTimeWorkRequestBuilder
|
import androidx.work.OneTimeWorkRequestBuilder
|
||||||
import androidx.work.WorkInfo
|
import androidx.work.WorkInfo
|
||||||
import androidx.work.WorkManager
|
import androidx.work.WorkManager
|
||||||
import com.aryan.reader.data.BookMetadata
|
import org.dueattendant149.bookreader.data.BookMetadata
|
||||||
import com.aryan.reader.data.BookMetadataEdit
|
import org.dueattendant149.bookreader.data.BookMetadataEdit
|
||||||
import com.aryan.reader.data.CloudflareRepository
|
import org.dueattendant149.bookreader.data.CloudflareRepository
|
||||||
import com.aryan.reader.data.CustomFontEntity
|
import org.dueattendant149.bookreader.data.CustomFontEntity
|
||||||
import com.aryan.reader.data.FeedbackRepository
|
import org.dueattendant149.bookreader.data.FeedbackRepository
|
||||||
import com.aryan.reader.data.FirestoreRepository
|
import org.dueattendant149.bookreader.data.FirestoreRepository
|
||||||
import com.aryan.reader.data.FontMetadata
|
import org.dueattendant149.bookreader.data.FontMetadata
|
||||||
import com.aryan.reader.data.FontsRepository
|
import org.dueattendant149.bookreader.data.FontsRepository
|
||||||
import com.aryan.reader.data.GoogleDriveRepository
|
import org.dueattendant149.bookreader.data.GoogleDriveRepository
|
||||||
import com.aryan.reader.data.LocalSyncUtils
|
import org.dueattendant149.bookreader.data.LocalSyncUtils
|
||||||
import com.aryan.reader.data.PurchaseEntity
|
import org.dueattendant149.bookreader.data.PurchaseEntity
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import com.aryan.reader.data.RecentFilesRepository
|
import org.dueattendant149.bookreader.data.RecentFilesRepository
|
||||||
import com.aryan.reader.data.RemoteConfigRepository
|
import org.dueattendant149.bookreader.data.RemoteConfigRepository
|
||||||
import com.aryan.reader.data.ShelfMetadata
|
import org.dueattendant149.bookreader.data.ShelfMetadata
|
||||||
import com.aryan.reader.data.TagEntity
|
import org.dueattendant149.bookreader.data.TagEntity
|
||||||
import com.aryan.reader.data.effectiveAnnotationModifiedTimestamp
|
import org.dueattendant149.bookreader.data.effectiveAnnotationModifiedTimestamp
|
||||||
import com.aryan.reader.data.effectiveReadingPositionModifiedTimestamp
|
import org.dueattendant149.bookreader.data.effectiveReadingPositionModifiedTimestamp
|
||||||
import com.aryan.reader.data.getUri
|
import org.dueattendant149.bookreader.data.getUri
|
||||||
import com.aryan.reader.data.toBookMetadata
|
import org.dueattendant149.bookreader.data.toBookMetadata
|
||||||
import com.aryan.reader.data.toRecentFileItem
|
import org.dueattendant149.bookreader.data.toRecentFileItem
|
||||||
import com.aryan.reader.epub.CalibreBundleExtractor
|
import org.dueattendant149.bookreader.epub.CalibreBundleExtractor
|
||||||
import com.aryan.reader.epub.CalibreBundleResult
|
import org.dueattendant149.bookreader.epub.CalibreBundleResult
|
||||||
import com.aryan.reader.epub.EpubBook
|
import org.dueattendant149.bookreader.epub.EpubBook
|
||||||
import com.aryan.reader.epub.EpubParser
|
import org.dueattendant149.bookreader.epub.EpubParser
|
||||||
import com.aryan.reader.epub.ImportedFileCache
|
import org.dueattendant149.bookreader.epub.ImportedFileCache
|
||||||
import com.aryan.reader.epub.MobiParser
|
import org.dueattendant149.bookreader.epub.MobiParser
|
||||||
import com.aryan.reader.epub.SingleFileImporter
|
import org.dueattendant149.bookreader.epub.SingleFileImporter
|
||||||
import com.aryan.reader.epub.hasReadableExtractedContent
|
import org.dueattendant149.bookreader.epub.hasReadableExtractedContent
|
||||||
import com.aryan.reader.ml.ISpeechBubbleDetector
|
import org.dueattendant149.bookreader.ml.ISpeechBubbleDetector
|
||||||
import com.aryan.reader.ml.SpeechBubble
|
import org.dueattendant149.bookreader.ml.SpeechBubble
|
||||||
import com.aryan.reader.ml.SpeechBubbleDetector
|
import org.dueattendant149.bookreader.ml.SpeechBubbleDetector
|
||||||
import com.aryan.reader.paginatedreader.Locator
|
import org.dueattendant149.bookreader.paginatedreader.Locator
|
||||||
import com.aryan.reader.paginatedreader.data.BookCacheDatabase
|
import org.dueattendant149.bookreader.paginatedreader.data.BookCacheDatabase
|
||||||
import com.aryan.reader.paginatedreader.data.BookProcessingWorker
|
import org.dueattendant149.bookreader.paginatedreader.data.BookProcessingWorker
|
||||||
import com.aryan.reader.pdf.PdfCoverGenerator
|
import org.dueattendant149.bookreader.pdf.PdfCoverGenerator
|
||||||
import com.aryan.reader.pdf.PDF_BLANK_PAGE_PERSISTENCE_TAG
|
import org.dueattendant149.bookreader.pdf.PDF_BLANK_PAGE_PERSISTENCE_TAG
|
||||||
import com.aryan.reader.pdf.PdfUserHighlight
|
import org.dueattendant149.bookreader.pdf.PdfUserHighlight
|
||||||
import com.aryan.reader.pdf.PdfiumCoreProvider
|
import org.dueattendant149.bookreader.pdf.PdfiumCoreProvider
|
||||||
import com.aryan.reader.pdf.PdfiumEngineProvider
|
import org.dueattendant149.bookreader.pdf.PdfiumEngineProvider
|
||||||
import com.aryan.reader.pdf.PdfiumAnnotationExporter
|
import org.dueattendant149.bookreader.pdf.PdfiumAnnotationExporter
|
||||||
import com.aryan.reader.pdf.ReflowWorker
|
import org.dueattendant149.bookreader.pdf.ReflowWorker
|
||||||
import com.aryan.reader.pdf.pdfLayoutDebugSummary
|
import org.dueattendant149.bookreader.pdf.pdfLayoutDebugSummary
|
||||||
import com.aryan.reader.pdf.remapPdfAnnotationsForLayoutChange
|
import org.dueattendant149.bookreader.pdf.remapPdfAnnotationsForLayoutChange
|
||||||
import com.aryan.reader.pdf.remapPdfBookmarksJsonForLayoutChange
|
import org.dueattendant149.bookreader.pdf.remapPdfBookmarksJsonForLayoutChange
|
||||||
import com.aryan.reader.pdf.data.PageLayoutRepository
|
import org.dueattendant149.bookreader.pdf.data.PageLayoutRepository
|
||||||
import com.aryan.reader.pdf.data.PdfAnnotation
|
import org.dueattendant149.bookreader.pdf.data.PdfAnnotation
|
||||||
import com.aryan.reader.pdf.data.PdfAnnotationRepository
|
import org.dueattendant149.bookreader.pdf.data.PdfAnnotationRepository
|
||||||
import com.aryan.reader.pdf.data.PdfHighlightRepository
|
import org.dueattendant149.bookreader.pdf.data.PdfHighlightRepository
|
||||||
import com.aryan.reader.pdf.data.PdfTextBox
|
import org.dueattendant149.bookreader.pdf.data.PdfTextBox
|
||||||
import com.aryan.reader.pdf.data.PdfTextBoxRepository
|
import org.dueattendant149.bookreader.pdf.data.PdfTextBoxRepository
|
||||||
import com.aryan.reader.pdf.data.PdfTextRepository
|
import org.dueattendant149.bookreader.pdf.data.PdfTextRepository
|
||||||
import com.aryan.reader.pdf.data.VirtualPage
|
import org.dueattendant149.bookreader.pdf.data.VirtualPage
|
||||||
import com.aryan.reader.pptx.PptxCoverGenerator
|
import org.dueattendant149.bookreader.pptx.PptxCoverGenerator
|
||||||
import com.aryan.reader.shared.SharedFileCapabilities
|
import org.dueattendant149.bookreader.shared.SharedFileCapabilities
|
||||||
import com.aryan.reader.shared.SharedLibraryEditor
|
import org.dueattendant149.bookreader.shared.SharedLibraryEditor
|
||||||
import com.aryan.reader.shared.SharedImportOutcomeCounts
|
import org.dueattendant149.bookreader.shared.SharedImportOutcomeCounts
|
||||||
import com.aryan.reader.shared.SharedImportPlanner
|
import org.dueattendant149.bookreader.shared.SharedImportPlanner
|
||||||
import com.aryan.reader.shared.pdf.SharedPdfAnnotationSidecarCodec
|
import org.dueattendant149.bookreader.shared.pdf.SharedPdfAnnotationSidecarCodec
|
||||||
import com.aryan.reader.shared.shouldApplyRemoteCloudBookMetadataUpdate
|
import org.dueattendant149.bookreader.shared.shouldApplyRemoteCloudBookMetadataUpdate
|
||||||
import com.aryan.reader.shared.shouldDownloadRemoteCloudBookContent
|
import org.dueattendant149.bookreader.shared.shouldDownloadRemoteCloudBookContent
|
||||||
import com.aryan.reader.shared.shouldUploadLocalCloudBookContent
|
import org.dueattendant149.bookreader.shared.shouldUploadLocalCloudBookContent
|
||||||
import com.aryan.reader.shared.shouldUploadLocalCloudBookMetadataUpdate
|
import org.dueattendant149.bookreader.shared.shouldUploadLocalCloudBookMetadataUpdate
|
||||||
import com.aryan.reader.shared.sharedCloudBookContentFileName
|
import org.dueattendant149.bookreader.shared.sharedCloudBookContentFileName
|
||||||
import com.aryan.reader.shared.AppAction as SharedAppAction
|
import org.dueattendant149.bookreader.shared.AppAction as SharedAppAction
|
||||||
import com.aryan.reader.shared.LibraryAction as SharedLibraryAction
|
import org.dueattendant149.bookreader.shared.LibraryAction as SharedLibraryAction
|
||||||
import kotlinx.coroutines.CompletableDeferred
|
import kotlinx.coroutines.CompletableDeferred
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Deferred
|
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 bookCacheDao by lazy { BookCacheDatabase.getDatabase(application).bookCacheDao() }
|
||||||
private val epubParser by lazy { EpubParser(appContext) }
|
private val epubParser by lazy { EpubParser(appContext) }
|
||||||
private val mobiParser by lazy { MobiParser(appContext) }
|
private val mobiParser by lazy { MobiParser(appContext) }
|
||||||
private val fb2Parser by lazy { com.aryan.reader.epub.Fb2Parser(appContext) }
|
private val fb2Parser by lazy { org.dueattendant149.bookreader.epub.Fb2Parser(appContext) }
|
||||||
private val odtParser by lazy { com.aryan.reader.epub.OdtParser(appContext) }
|
private val odtParser by lazy { org.dueattendant149.bookreader.epub.OdtParser(appContext) }
|
||||||
private val singleFileImporter by lazy { SingleFileImporter(appContext) }
|
private val singleFileImporter by lazy { SingleFileImporter(appContext) }
|
||||||
private val bookImporter by lazy { BookImporter(appContext) }
|
private val bookImporter by lazy { BookImporter(appContext) }
|
||||||
private val epubMetadataFileEditor by lazy { EpubMetadataFileEditor(appContext) }
|
private val epubMetadataFileEditor by lazy { EpubMetadataFileEditor(appContext) }
|
||||||
private val pageLayoutRepository by lazy { PageLayoutRepository(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 pdfTextBoxRepository by lazy { PdfTextBoxRepository(appContext) }
|
||||||
private val pdfHighlightRepository by lazy { PdfHighlightRepository(appContext) }
|
private val pdfHighlightRepository by lazy { PdfHighlightRepository(appContext) }
|
||||||
private val pdfAnnotationRepository by lazy { PdfAnnotationRepository(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 var cloudContentRetryJob: Job? = null
|
||||||
private val cloudMetadataUploadJobs = ConcurrentHashMap<String, Job>()
|
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 var speechBubbleDetector: ISpeechBubbleDetector? = null
|
||||||
|
|
||||||
private val mlDispatcher = newSingleThreadExecutor().asCoroutineDispatcher()
|
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 speechBubbleCache = ConcurrentHashMap<SpeechBubbleCacheKey, List<CachedSpeechBubble>>()
|
||||||
private val speechBubbleDetectionJobs = ConcurrentHashMap<SpeechBubbleCacheKey, Deferred<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) {
|
if (panelDetector == null && BuildConfig.DEBUG) {
|
||||||
val modelFile = File(context.getExternalFilesDir(null), "best_float16.tflite")
|
val modelFile = File(context.getExternalFilesDir(null), "best_float16.tflite")
|
||||||
if (modelFile.exists()) {
|
if (modelFile.exists()) {
|
||||||
try {
|
try {
|
||||||
val clazz = Class.forName(
|
val clazz = Class.forName(
|
||||||
"com.aryan.reader.ml.ComicPanelDetector",
|
"org.dueattendant149.bookreader.ml.ComicPanelDetector",
|
||||||
false,
|
false,
|
||||||
context.classLoader
|
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) {
|
} catch (e: Exception) {
|
||||||
Timber.e(e, "Failed to instantiate ComicPanelDetector via reflection")
|
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...")
|
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()
|
val totalPages = archiveDoc.getPageCount()
|
||||||
Timber.d("Archive opened. Total pages: $totalPages")
|
Timber.d("Archive opened. Total pages: $totalPages")
|
||||||
|
|
||||||
|
|
@ -1944,24 +1944,24 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
|
||||||
|
|
||||||
when (val deviceStatus =
|
when (val deviceStatus =
|
||||||
firestoreRepository.getDeviceStatus(currentUser.uid, deviceId)) {
|
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.")
|
Timber.d("Device is active. Updating last seen.")
|
||||||
firestoreRepository.updateDeviceLastSeen(currentUser.uid, deviceId)
|
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.")
|
Timber.w("Device has been revoked. Signing out.")
|
||||||
firestoreRepository.deleteDevice(currentUser.uid, deviceId) // Clean up
|
firestoreRepository.deleteDevice(currentUser.uid, deviceId) // Clean up
|
||||||
signOut()
|
signOut()
|
||||||
showBanner(appContext.getString(R.string.banner_device_removed))
|
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.")
|
Timber.d("Device not found during verification. Triggering full registration.")
|
||||||
registerOrUpdateDeviceOnSignIn(currentUser.uid)
|
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.")
|
Timber.e(deviceStatus.exception, "Error checking device status.")
|
||||||
_internalState.update {
|
_internalState.update {
|
||||||
it.copy(
|
it.copy(
|
||||||
|
|
@ -2038,7 +2038,7 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
|
||||||
sourceUri: Uri,
|
sourceUri: Uri,
|
||||||
destUri: Uri,
|
destUri: Uri,
|
||||||
annotations: Map<Int, List<PdfAnnotation>>,
|
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,
|
textBoxes: List<PdfTextBox>? = null,
|
||||||
highlights: List<PdfUserHighlight>? = null,
|
highlights: List<PdfUserHighlight>? = null,
|
||||||
bookId: String
|
bookId: String
|
||||||
|
|
@ -2175,7 +2175,7 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
|
||||||
activityContext: Context,
|
activityContext: Context,
|
||||||
sourceUri: Uri,
|
sourceUri: Uri,
|
||||||
annotations: Map<Int, List<PdfAnnotation>>,
|
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,
|
textBoxes: List<PdfTextBox>? = null,
|
||||||
highlights: List<PdfUserHighlight>? = null,
|
highlights: List<PdfUserHighlight>? = null,
|
||||||
includeAnnotations: Boolean,
|
includeAnnotations: Boolean,
|
||||||
|
|
@ -4657,7 +4657,7 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
|
||||||
cacheFile.outputStream().use { output -> input.copyTo(output) }
|
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) {
|
if (archiveDoc.getPageCount() > 0) {
|
||||||
val page = archiveDoc.openPage(0)
|
val page = archiveDoc.openPage(0)
|
||||||
if (page != null) {
|
if (page != null) {
|
||||||
|
|
@ -6430,7 +6430,7 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
|
||||||
val currentUser = uiState.value.currentUser ?: return
|
val currentUser = uiState.value.currentUser ?: return
|
||||||
|
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
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 shelf = db.shelfDao().getShelfById(shelfId) ?: return@launch
|
||||||
val crossRefs = db.shelfDao().getCrossRefsForShelf(shelfId)
|
val crossRefs = db.shelfDao().getCrossRefsForShelf(shelfId)
|
||||||
val manualOnlyBookIds = recentFilesRepository.getAllFilesForSync()
|
val manualOnlyBookIds = recentFilesRepository.getAllFilesForSync()
|
||||||
|
|
@ -7164,7 +7164,7 @@ open class MainViewModel(application: Application) : AndroidViewModel(applicatio
|
||||||
val initDuration = System.currentTimeMillis() - initStartTime
|
val initDuration = System.currentTimeMillis() - initStartTime
|
||||||
Timber.d(">>> [BATCH] Model Initialization: ${initDuration}ms")
|
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 totalPages = archiveDoc.getPageCount()
|
||||||
|
|
||||||
val startIndex = 3
|
val startIndex = 3
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// MetadataExtractionWorker.kt
|
// MetadataExtractionWorker.kt
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.provider.OpenableColumns
|
import android.provider.OpenableColumns
|
||||||
|
|
@ -10,10 +10,10 @@ import androidx.work.ExistingWorkPolicy
|
||||||
import androidx.work.OneTimeWorkRequestBuilder
|
import androidx.work.OneTimeWorkRequestBuilder
|
||||||
import androidx.work.WorkerParameters
|
import androidx.work.WorkerParameters
|
||||||
import androidx.work.WorkManager
|
import androidx.work.WorkManager
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import com.aryan.reader.data.RecentFilesRepository
|
import org.dueattendant149.bookreader.data.RecentFilesRepository
|
||||||
import com.aryan.reader.pdf.PdfiumCoreProvider
|
import org.dueattendant149.bookreader.pdf.PdfiumCoreProvider
|
||||||
import com.aryan.reader.pdf.PdfiumEngineProvider
|
import org.dueattendant149.bookreader.pdf.PdfiumEngineProvider
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import org.xmlpull.v1.XmlPullParser
|
import org.xmlpull.v1.XmlPullParser
|
||||||
|
|
@ -17,14 +17,14 @@
|
||||||
*
|
*
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import android.webkit.WebView
|
import android.webkit.WebView
|
||||||
import coil.ImageLoader
|
import coil.ImageLoader
|
||||||
import coil.ImageLoaderFactory
|
import coil.ImageLoaderFactory
|
||||||
import coil.decode.SvgDecoder
|
import coil.decode.SvgDecoder
|
||||||
import com.aryan.reader.paginatedreader.SvgStringFetcher
|
import org.dueattendant149.bookreader.paginatedreader.SvgStringFetcher
|
||||||
import timber.log.Timber // Add this
|
import timber.log.Timber // Add this
|
||||||
|
|
||||||
class MyApplication : Application(), ImageLoaderFactory {
|
class MyApplication : Application(), ImageLoaderFactory {
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
*
|
*
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import timber.log.Timber
|
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.text.withStyle
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import com.aryan.reader.data.ProductDetailsEntity
|
import org.dueattendant149.bookreader.data.ProductDetailsEntity
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import java.text.NumberFormat
|
import java.text.NumberFormat
|
||||||
import java.util.Currency
|
import java.util.Currency
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import java.security.MessageDigest
|
import java.security.MessageDigest
|
||||||
import java.util.Base64
|
import java.util.Base64
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.view.Window
|
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.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
import com.aryan.reader.shared.ui.ReaderMinimalSlider
|
import org.dueattendant149.bookreader.shared.ui.ReaderMinimalSlider
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
private const val READER_PREFS_NAME = "reader_prefs"
|
private const val READER_PREFS_NAME = "reader_prefs"
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
|
@ -6,7 +6,7 @@ import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun rememberReaderFileInfoItem(
|
private fun rememberReaderFileInfoItem(
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import com.aryan.reader.shared.detectFontVariant
|
import org.dueattendant149.bookreader.shared.detectFontVariant
|
||||||
import com.aryan.reader.shared.familyFilenameSignature
|
import org.dueattendant149.bookreader.shared.familyFilenameSignature
|
||||||
import com.aryan.reader.shared.supportsVariableWeightAxis
|
import org.dueattendant149.bookreader.shared.supportsVariableWeightAxis
|
||||||
|
|
||||||
const val ReaderFontDiagnosticsTag = "ReaderFontDiag"
|
const val ReaderFontDiagnosticsTag = "ReaderFontDiag"
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import androidx.activity.compose.BackHandler
|
import androidx.activity.compose.BackHandler
|
||||||
import androidx.compose.foundation.layout.WindowInsets
|
import androidx.compose.foundation.layout.WindowInsets
|
||||||
|
|
@ -27,45 +27,45 @@ import androidx.compose.ui.res.stringResource
|
||||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||||
import androidx.media3.common.util.UnstableApi
|
import androidx.media3.common.util.UnstableApi
|
||||||
import androidx.navigation.NavHostController
|
import androidx.navigation.NavHostController
|
||||||
import com.aryan.reader.data.CustomFontEntity
|
import org.dueattendant149.bookreader.data.CustomFontEntity
|
||||||
import com.aryan.reader.epubreader.FormatSettings as AndroidFormatSettings
|
import org.dueattendant149.bookreader.epubreader.FormatSettings as AndroidFormatSettings
|
||||||
import com.aryan.reader.epubreader.ReaderFont as AndroidReaderFont
|
import org.dueattendant149.bookreader.epubreader.ReaderFont as AndroidReaderFont
|
||||||
import com.aryan.reader.epubreader.ReaderTextAlign as AndroidReaderTextAlign
|
import org.dueattendant149.bookreader.epubreader.ReaderTextAlign as AndroidReaderTextAlign
|
||||||
import com.aryan.reader.epubreader.loadFormatSettings
|
import org.dueattendant149.bookreader.epubreader.loadFormatSettings
|
||||||
import com.aryan.reader.epubreader.loadPageInfoMode
|
import org.dueattendant149.bookreader.epubreader.loadPageInfoMode
|
||||||
import com.aryan.reader.epubreader.loadPageInfoPosition
|
import org.dueattendant149.bookreader.epubreader.loadPageInfoPosition
|
||||||
import com.aryan.reader.epubreader.loadPullToTurn
|
import org.dueattendant149.bookreader.epubreader.loadPullToTurn
|
||||||
import com.aryan.reader.epubreader.loadPullToTurnMultiplier
|
import org.dueattendant149.bookreader.epubreader.loadPullToTurnMultiplier
|
||||||
import com.aryan.reader.epubreader.loadSystemUiMode
|
import org.dueattendant149.bookreader.epubreader.loadSystemUiMode
|
||||||
import com.aryan.reader.epubreader.savePageInfoMode
|
import org.dueattendant149.bookreader.epubreader.savePageInfoMode
|
||||||
import com.aryan.reader.epubreader.savePageInfoPosition
|
import org.dueattendant149.bookreader.epubreader.savePageInfoPosition
|
||||||
import com.aryan.reader.epubreader.savePullToTurn
|
import org.dueattendant149.bookreader.epubreader.savePullToTurn
|
||||||
import com.aryan.reader.epubreader.savePullToTurnMultiplier
|
import org.dueattendant149.bookreader.epubreader.savePullToTurnMultiplier
|
||||||
import com.aryan.reader.epubreader.saveReaderSettings
|
import org.dueattendant149.bookreader.epubreader.saveReaderSettings
|
||||||
import com.aryan.reader.epubreader.saveSystemUiMode
|
import org.dueattendant149.bookreader.epubreader.saveSystemUiMode
|
||||||
import com.aryan.reader.pdf.savePdfSystemUiMode
|
import org.dueattendant149.bookreader.pdf.savePdfSystemUiMode
|
||||||
import com.aryan.reader.pdf.savePdfThemeId
|
import org.dueattendant149.bookreader.pdf.savePdfThemeId
|
||||||
import com.aryan.reader.pdf.savePdfVerticalPageGapVisible
|
import org.dueattendant149.bookreader.pdf.savePdfVerticalPageGapVisible
|
||||||
import com.aryan.reader.pdf.savePdfPageNumberOverlayVisible
|
import org.dueattendant149.bookreader.pdf.savePdfPageNumberOverlayVisible
|
||||||
import com.aryan.reader.pdf.loadPdfSystemUiMode
|
import org.dueattendant149.bookreader.pdf.loadPdfSystemUiMode
|
||||||
import com.aryan.reader.pdf.loadPdfThemeId
|
import org.dueattendant149.bookreader.pdf.loadPdfThemeId
|
||||||
import com.aryan.reader.pdf.loadPdfVerticalPageGapVisible
|
import org.dueattendant149.bookreader.pdf.loadPdfVerticalPageGapVisible
|
||||||
import com.aryan.reader.pdf.loadPdfPageNumberOverlayVisible
|
import org.dueattendant149.bookreader.pdf.loadPdfPageNumberOverlayVisible
|
||||||
import com.aryan.reader.shared.BuiltInPdfReaderThemes
|
import org.dueattendant149.bookreader.shared.BuiltInPdfReaderThemes
|
||||||
import com.aryan.reader.shared.CustomFontItem
|
import org.dueattendant149.bookreader.shared.CustomFontItem
|
||||||
import com.aryan.reader.shared.SharedSettingsAction
|
import org.dueattendant149.bookreader.shared.SharedSettingsAction
|
||||||
import com.aryan.reader.shared.SharedSettingsDestination
|
import org.dueattendant149.bookreader.shared.SharedSettingsDestination
|
||||||
import com.aryan.reader.shared.parentDestination
|
import org.dueattendant149.bookreader.shared.parentDestination
|
||||||
import com.aryan.reader.shared.toReaderSettingsFontFamily
|
import org.dueattendant149.bookreader.shared.toReaderSettingsFontFamily
|
||||||
import com.aryan.reader.shared.toSharedReaderTextAlign
|
import org.dueattendant149.bookreader.shared.toSharedReaderTextAlign
|
||||||
import com.aryan.reader.shared.reader.ReaderReadingMode
|
import org.dueattendant149.bookreader.shared.reader.ReaderReadingMode
|
||||||
import com.aryan.reader.shared.reader.ReaderSettings
|
import org.dueattendant149.bookreader.shared.reader.ReaderSettings
|
||||||
import com.aryan.reader.shared.reader.SharedReaderTextAlign
|
import org.dueattendant149.bookreader.shared.reader.SharedReaderTextAlign
|
||||||
import com.aryan.reader.shared.readerThemeById
|
import org.dueattendant149.bookreader.shared.readerThemeById
|
||||||
import com.aryan.reader.shared.sharedSettingsHubModel
|
import org.dueattendant149.bookreader.shared.sharedSettingsHubModel
|
||||||
import com.aryan.reader.shared.toReaderSettings
|
import org.dueattendant149.bookreader.shared.toReaderSettings
|
||||||
import com.aryan.reader.shared.ui.SharedSettingsHub
|
import org.dueattendant149.bookreader.shared.ui.SharedSettingsHub
|
||||||
import com.aryan.reader.tts.loadTtsMode
|
import org.dueattendant149.bookreader.tts.loadTtsMode
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
// SharedComposables.kt
|
// SharedComposables.kt
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
|
@ -43,7 +43,7 @@ import androidx.compose.foundation.lazy.items
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.ModalBottomSheet
|
import androidx.compose.material3.ModalBottomSheet
|
||||||
import androidx.compose.material3.rememberModalBottomSheetState
|
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.material.icons.filled.Search
|
||||||
import androidx.compose.foundation.BorderStroke
|
import androidx.compose.foundation.BorderStroke
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
|
@ -143,14 +143,14 @@ import androidx.compose.ui.window.DialogProperties
|
||||||
import androidx.compose.ui.viewinterop.AndroidView
|
import androidx.compose.ui.viewinterop.AndroidView
|
||||||
import androidx.core.net.toUri
|
import androidx.core.net.toUri
|
||||||
import androidx.core.text.HtmlCompat
|
import androidx.core.text.HtmlCompat
|
||||||
import com.aryan.reader.shared.SharedFileCapabilities
|
import org.dueattendant149.bookreader.shared.SharedFileCapabilities
|
||||||
import com.aryan.reader.shared.SharedLegalLinks
|
import org.dueattendant149.bookreader.shared.SharedLegalLinks
|
||||||
import com.aryan.reader.shared.SharedLegalProfile
|
import org.dueattendant149.bookreader.shared.SharedLegalProfile
|
||||||
import com.aryan.reader.data.BookMetadataEdit
|
import org.dueattendant149.bookreader.data.BookMetadataEdit
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import com.aryan.reader.shared.SharedText
|
import org.dueattendant149.bookreader.shared.SharedText
|
||||||
import com.aryan.reader.shared.sharedLegalLinksForProfile
|
import org.dueattendant149.bookreader.shared.sharedLegalLinksForProfile
|
||||||
import com.aryan.reader.shared.ui.SharedMarkdownText
|
import org.dueattendant149.bookreader.shared.ui.SharedMarkdownText
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
@ -1,22 +1,22 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import com.aryan.reader.data.BookShelfCrossRef
|
import org.dueattendant149.bookreader.data.BookShelfCrossRef
|
||||||
import com.aryan.reader.data.BookTagCrossRef
|
import org.dueattendant149.bookreader.data.BookTagCrossRef
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import com.aryan.reader.data.ShelfEntity
|
import org.dueattendant149.bookreader.data.ShelfEntity
|
||||||
import com.aryan.reader.data.TagEntity
|
import org.dueattendant149.bookreader.data.TagEntity
|
||||||
import com.aryan.reader.shared.BookItem as SharedBookItem
|
import org.dueattendant149.bookreader.shared.BookItem as SharedBookItem
|
||||||
import com.aryan.reader.shared.BookShelfRef as SharedBookShelfRef
|
import org.dueattendant149.bookreader.shared.BookShelfRef as SharedBookShelfRef
|
||||||
import com.aryan.reader.shared.EpubAnnotationSerializer
|
import org.dueattendant149.bookreader.shared.EpubAnnotationSerializer
|
||||||
import com.aryan.reader.shared.FileType as SharedFileType
|
import org.dueattendant149.bookreader.shared.FileType as SharedFileType
|
||||||
import com.aryan.reader.shared.LibraryFilters as SharedLibraryFilters
|
import org.dueattendant149.bookreader.shared.LibraryFilters as SharedLibraryFilters
|
||||||
import com.aryan.reader.shared.ReaderLocator as SharedReaderLocator
|
import org.dueattendant149.bookreader.shared.ReaderLocator as SharedReaderLocator
|
||||||
import com.aryan.reader.shared.SharedReaderScreenState
|
import org.dueattendant149.bookreader.shared.SharedReaderScreenState
|
||||||
import com.aryan.reader.shared.Shelf as SharedShelf
|
import org.dueattendant149.bookreader.shared.Shelf as SharedShelf
|
||||||
import com.aryan.reader.shared.ShelfRecord
|
import org.dueattendant149.bookreader.shared.ShelfRecord
|
||||||
import com.aryan.reader.shared.SyncedFolder as SharedSyncedFolder
|
import org.dueattendant149.bookreader.shared.SyncedFolder as SharedSyncedFolder
|
||||||
import com.aryan.reader.shared.Tag as SharedTag
|
import org.dueattendant149.bookreader.shared.Tag as SharedTag
|
||||||
import com.aryan.reader.shared.toStablePositionCfi
|
import org.dueattendant149.bookreader.shared.toStablePositionCfi
|
||||||
|
|
||||||
fun FileType.toSharedFileType(): SharedFileType = this
|
fun FileType.toSharedFileType(): SharedFileType = this
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// StorageTracker.kt
|
// StorageTracker.kt
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import org.json.JSONArray
|
import org.json.JSONArray
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
|
|
@ -31,7 +31,7 @@ import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import coil.compose.AsyncImage
|
import coil.compose.AsyncImage
|
||||||
import coil.request.ImageRequest
|
import coil.request.ImageRequest
|
||||||
import com.aryan.reader.data.RecentFileItem
|
import org.dueattendant149.bookreader.data.RecentFileItem
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import kotlin.math.absoluteValue
|
import kotlin.math.absoluteValue
|
||||||
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.core.content.edit
|
import androidx.core.content.edit
|
||||||
import com.aryan.reader.paginatedreader.TtsChunk
|
import org.dueattendant149.bookreader.paginatedreader.TtsChunk
|
||||||
import com.aryan.reader.shared.ReaderTtsReplacementEngine
|
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementEngine
|
||||||
import com.aryan.reader.shared.ReaderTtsReplacementPreferences
|
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementPreferences
|
||||||
import com.aryan.reader.shared.ReaderTtsReplacementPreferencesJson
|
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementPreferencesJson
|
||||||
|
|
||||||
private const val READER_PREFS_NAME = "reader_prefs"
|
private const val READER_PREFS_NAME = "reader_prefs"
|
||||||
private const val TTS_REPLACEMENTS_KEY = "tts_word_replacements_json"
|
private const val TTS_REPLACEMENTS_KEY = "tts_word_replacements_json"
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
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.input.KeyboardType
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.aryan.reader.shared.ReaderTtsReplacementBookSettings
|
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementBookSettings
|
||||||
import com.aryan.reader.shared.ReaderTtsReplacementEngine
|
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementEngine
|
||||||
import com.aryan.reader.shared.ReaderTtsReplacementPreferences
|
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementPreferences
|
||||||
import com.aryan.reader.shared.ReaderTtsReplacementRule
|
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementRule
|
||||||
import com.aryan.reader.shared.ReaderTtsReplacementSuggestions
|
import org.dueattendant149.bookreader.shared.ReaderTtsReplacementSuggestions
|
||||||
|
|
||||||
private enum class TtsReplacementScope {
|
private enum class TtsReplacementScope {
|
||||||
Global,
|
Global,
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader
|
package org.dueattendant149.bookreader
|
||||||
|
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import java.text.Normalizer
|
import java.text.Normalizer
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
*
|
*
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
package com.aryan.reader.data
|
package org.dueattendant149.bookreader.data
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.room.Database
|
import androidx.room.Database
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader.data
|
package org.dueattendant149.bookreader.data
|
||||||
|
|
||||||
data class BookMetadataEdit(
|
data class BookMetadataEdit(
|
||||||
val title: String?,
|
val title: String?,
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
*
|
*
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
package com.aryan.reader.data
|
package org.dueattendant149.bookreader.data
|
||||||
|
|
||||||
import androidx.room.Dao
|
import androidx.room.Dao
|
||||||
import androidx.room.Insert
|
import androidx.room.Insert
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
*
|
*
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
package com.aryan.reader.data
|
package org.dueattendant149.bookreader.data
|
||||||
|
|
||||||
import androidx.room.ColumnInfo
|
import androidx.room.ColumnInfo
|
||||||
import androidx.room.Entity
|
import androidx.room.Entity
|
||||||
|
|
@ -17,10 +17,10 @@
|
||||||
*
|
*
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
package com.aryan.reader.data
|
package org.dueattendant149.bookreader.data
|
||||||
|
|
||||||
import androidx.room.TypeConverter
|
import androidx.room.TypeConverter
|
||||||
import com.aryan.reader.FileType
|
import org.dueattendant149.bookreader.FileType
|
||||||
|
|
||||||
class FileTypeConverter {
|
class FileTypeConverter {
|
||||||
@TypeConverter
|
@TypeConverter
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
// FolderBookMetadata.kt
|
// FolderBookMetadata.kt
|
||||||
package com.aryan.reader.data
|
package org.dueattendant149.bookreader.data
|
||||||
|
|
||||||
import com.aryan.reader.FileType
|
import org.dueattendant149.bookreader.FileType
|
||||||
import com.aryan.reader.shared.SharedFolderBookMetadata
|
import org.dueattendant149.bookreader.shared.SharedFolderBookMetadata
|
||||||
|
|
||||||
data class FolderBookMetadata(
|
data class FolderBookMetadata(
|
||||||
val bookId: String,
|
val bookId: String,
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
*
|
*
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
package com.aryan.reader.data
|
package org.dueattendant149.bookreader.data
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
|
@ -25,8 +25,8 @@ import android.provider.OpenableColumns
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import com.aryan.reader.ReaderFontDiagnosticsTag
|
import org.dueattendant149.bookreader.ReaderFontDiagnosticsTag
|
||||||
import com.aryan.reader.readerFontDiagnosticSummary
|
import org.dueattendant149.bookreader.readerFontDiagnosticSummary
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.FileOutputStream
|
import java.io.FileOutputStream
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader.data
|
package org.dueattendant149.bookreader.data
|
||||||
|
|
||||||
import androidx.room.Dao
|
import androidx.room.Dao
|
||||||
import androidx.room.Insert
|
import androidx.room.Insert
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.aryan.reader.data
|
package org.dueattendant149.bookreader.data
|
||||||
|
|
||||||
import androidx.room.Entity
|
import androidx.room.Entity
|
||||||
import androidx.room.ForeignKey
|
import androidx.room.ForeignKey
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
// LocalSyncUtils.kt
|
// LocalSyncUtils.kt
|
||||||
package com.aryan.reader.data
|
package org.dueattendant149.bookreader.data
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Environment
|
import android.os.Environment
|
||||||
import android.provider.DocumentsContract
|
import android.provider.DocumentsContract
|
||||||
import androidx.documentfile.provider.DocumentFile
|
import androidx.documentfile.provider.DocumentFile
|
||||||
import com.aryan.reader.ReaderPerfLog
|
import org.dueattendant149.bookreader.ReaderPerfLog
|
||||||
import com.aryan.reader.shared.LOCAL_FOLDER_SIDECAR_HASH_PREFIX
|
import org.dueattendant149.bookreader.shared.LOCAL_FOLDER_SIDECAR_HASH_PREFIX
|
||||||
import com.aryan.reader.shared.LOCAL_FOLDER_SYNC_DATA_DIR
|
import org.dueattendant149.bookreader.shared.LOCAL_FOLDER_SYNC_DATA_DIR
|
||||||
import com.aryan.reader.shared.localFolderSyncAnnotationFileName
|
import org.dueattendant149.bookreader.shared.localFolderSyncAnnotationFileName
|
||||||
import com.aryan.reader.shared.localFolderSyncAnnotationTempFileName
|
import org.dueattendant149.bookreader.shared.localFolderSyncAnnotationTempFileName
|
||||||
import com.aryan.reader.shared.localFolderSyncMetadataFileName
|
import org.dueattendant149.bookreader.shared.localFolderSyncMetadataFileName
|
||||||
import com.aryan.reader.shared.localFolderSyncMetadataTempFileName
|
import org.dueattendant149.bookreader.shared.localFolderSyncMetadataTempFileName
|
||||||
import com.aryan.reader.shared.localFolderSyncSidecarStem
|
import org.dueattendant149.bookreader.shared.localFolderSyncSidecarStem
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
*
|
*
|
||||||
* mail: epistemereader@gmail.com
|
* 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.
|
* Agnostic representation of a purchase to decouple MainViewModel from Billing Library.
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
// RecentFileDao.kt
|
// RecentFileDao.kt
|
||||||
package com.aryan.reader.data
|
package org.dueattendant149.bookreader.data
|
||||||
|
|
||||||
import androidx.room.Dao
|
import androidx.room.Dao
|
||||||
import androidx.room.Query
|
import androidx.room.Query
|
||||||
|
|
@ -17,13 +17,13 @@
|
||||||
*
|
*
|
||||||
* mail: epistemereader@gmail.com
|
* mail: epistemereader@gmail.com
|
||||||
*/
|
*/
|
||||||
package com.aryan.reader.data
|
package org.dueattendant149.bookreader.data
|
||||||
|
|
||||||
import androidx.room.ColumnInfo
|
import androidx.room.ColumnInfo
|
||||||
import androidx.room.Entity
|
import androidx.room.Entity
|
||||||
import androidx.room.PrimaryKey
|
import androidx.room.PrimaryKey
|
||||||
import androidx.room.TypeConverters
|
import androidx.room.TypeConverters
|
||||||
import com.aryan.reader.FileType
|
import org.dueattendant149.bookreader.FileType
|
||||||
|
|
||||||
@Entity(tableName = "recent_files")
|
@Entity(tableName = "recent_files")
|
||||||
@TypeConverters(FileTypeConverter::class)
|
@TypeConverters(FileTypeConverter::class)
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue