docs: Revamp README and add APK naming convention This commit introduces a complete overhaul of the `README.md` to improve project presentation. Key changes include: * Adds a new header with the app icon and a Google Play badge. * Updates the feature graphic and includes a note distinguishing the OSS version from the Play Store version. * Refines the "Open Source Libraries" section to be more structured. * Moves the main preview image into the `docs` directory. Additionally, the `app/build.gradle.kts` file is updated to configure a standardized naming convention for output APK files, including flavor, version, and build type. * refactor copyright headers and fix README icon alignment This commit introduces two main changes across the codebase: The `spotless/copyright.kt` template have been updated for consistency: * The author name is simplified from "Episteme Authors" to "Episteme". * The contact email prefix is shortened from "Electronic mail:" to "mail:". Second, the `README.md` file is adjusted to correct the vertical alignment of the app icon with the project title.
77 lines
No EOL
3.7 KiB
Kotlin
77 lines
No EOL
3.7 KiB
Kotlin
/*
|
|
* Episteme Reader - A native Android document reader.
|
|
* Copyright (C) 2026 Episteme
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Affero General Public License as
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
* License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Affero General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
*
|
|
* mail: epistemereader@gmail.com
|
|
*/
|
|
package com.aryan.reader.data
|
|
|
|
import androidx.room.Dao
|
|
import androidx.room.Insert
|
|
import androidx.room.OnConflictStrategy
|
|
import androidx.room.Query
|
|
import kotlinx.coroutines.flow.Flow
|
|
|
|
@Dao
|
|
interface RecentFileDao {
|
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
suspend fun insertOrUpdateFile(file: RecentFileEntity)
|
|
|
|
@Query("SELECT * FROM recent_files WHERE isDeleted = 0 ORDER BY timestamp DESC")
|
|
fun getRecentFiles(): Flow<List<RecentFileEntity>>
|
|
|
|
@Query("SELECT * FROM recent_files")
|
|
suspend fun getAllFiles(): List<RecentFileEntity>
|
|
|
|
@Query("SELECT * FROM recent_files WHERE isDeleted = 0 ORDER BY timestamp DESC LIMIT :limit")
|
|
fun getRecentFilesList(limit: Int): List<RecentFileEntity>
|
|
|
|
@Query("DELETE FROM recent_files WHERE bookId IN (:bookIds)")
|
|
suspend fun deleteFilePermanently(bookIds: List<String>)
|
|
|
|
@Query("UPDATE recent_files SET isDeleted = 1, isAvailable = 0, lastModifiedTimestamp = :timestamp WHERE bookId IN (:bookIds)")
|
|
suspend fun markAsDeleted(bookIds: List<String>, timestamp: Long)
|
|
|
|
@Query("SELECT * FROM recent_files WHERE lastModifiedTimestamp > :sinceTimestamp")
|
|
suspend fun getModifiedSince(sinceTimestamp: Long): List<RecentFileEntity>
|
|
|
|
@Query("SELECT COUNT(*) FROM recent_files")
|
|
suspend fun count(): Int
|
|
|
|
@Query("SELECT * FROM recent_files WHERE bookId = :bookId")
|
|
suspend fun getFileByBookId(bookId: String): RecentFileEntity?
|
|
|
|
@Query("SELECT * FROM recent_files WHERE uriString = :uriString")
|
|
suspend fun getFileByUri(uriString: String): RecentFileEntity?
|
|
|
|
@Query("DELETE FROM recent_files")
|
|
suspend fun clearAll()
|
|
|
|
@Query("UPDATE recent_files SET lastPositionCfi = :cfi, lastChapterIndex = :chapterIndex, locatorBlockIndex = :blockIndex, locatorCharOffset = :charOffset, progressPercentage = :progress, timestamp = :timestamp, lastModifiedTimestamp = :timestamp WHERE bookId = :bookId")
|
|
suspend fun updateEpubReadingPosition(bookId: String, cfi: String?, chapterIndex: Int, blockIndex: Int, charOffset: Int, progress: Float, timestamp: Long)
|
|
|
|
@Query("UPDATE recent_files SET lastPage = :page, progressPercentage = :progress, timestamp = :timestamp, lastModifiedTimestamp = :timestamp WHERE bookId = :bookId")
|
|
suspend fun updatePdfReadingPosition(bookId: String, page: Int, progress: Float, timestamp: Long)
|
|
|
|
@Query("UPDATE recent_files SET bookmarks = :bookmarksJson, lastModifiedTimestamp = :timestamp WHERE bookId = :bookId")
|
|
suspend fun updateBookmarks(bookId: String, bookmarksJson: String, timestamp: Long)
|
|
|
|
@Query("UPDATE recent_files SET isAvailable = 1, uriString = :uriString, timestamp = :timestamp, lastModifiedTimestamp = :timestamp WHERE bookId = :bookId")
|
|
suspend fun updateBookAvailability(bookId: String, uriString: String, timestamp: Long)
|
|
|
|
@Query("UPDATE recent_files SET isRecent = 0, lastModifiedTimestamp = :timestamp WHERE bookId IN (:bookIds)")
|
|
suspend fun markAsNotRecent(bookIds: List<String>, timestamp: Long)
|
|
} |