Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<a><img alt="Jetpack Compose" src="https://img.shields.io/badge/Jetpack%20Compose-4285F4?logo=jetpackcompose&logoColor=white&style=for-the-badge"></a>
<a href="http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=P__gXIArh5UDBsEq7ttd4WhIYnNh3y1t&authKey=GAsRKEZ%2FwHpzRv19hNJsDnknOc86lYzNIHMPy2Jxt3S3U8f90qestOd760IAj%2F3l&noverify=0&group_code=867785526"><img alt="QQ Group" src="https://img.shields.io/badge/QQ讨论群-867785526-brightgreen.svg?logoColor=white&style=for-the-badge"></a>
<a href="https://discord.gg/pnf4ABmDJt"><img alt="Discord" src="https://img.shields.io/badge/Discord-JOIN-4285F4.svg?logo=discord&logoColor=white&style=for-the-badge"></a>
<a href="https://t.me/lightnoble"><img alt="Discord" src="https://img.shields.io/badge/Telegram-JOIN-188FCA.svg?logo=telegram&logoColor=white&style=for-the-badge"></a>
<a href="https://t.me/lightnoble"><img alt="Telegram" src="https://img.shields.io/badge/Telegram-JOIN-188FCA.svg?logo=telegram&logoColor=white&style=for-the-badge"></a>
<a href="https://f-droid.org/packages/indi.dmzz_yyhyy.lightnovelreader/"><img alt="F-droid" src="https://img.shields.io/f-droid/v/indi.dmzz_yyhyy.lightnovelreader?style=for-the-badge&logo=fdroid&logoColor=white"></a>
<p>轻小说阅读软件,使用 Jetpack Compose 框架编写</p>
<img src="assets/header.png" alt="drawing" width="80%"/>
</div>
Expand Down Expand Up @@ -57,7 +58,7 @@ LightNovelReader <sup>*重构版*</sup> 是一款开源的轻小说阅读软件
## 软件截图

| |
|-----------------------------|
| --------------------------- |
| ![image](assets/light1.png) |
| ![image](assets/light2.png) |
| ![image](assets/light3.png) |
Expand Down
13 changes: 7 additions & 6 deletions README_TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<a><img alt="Jetpack Compose" src="https://img.shields.io/badge/Jetpack%20Compose-4285F4?logo=jetpackcompose&logoColor=white&style=for-the-badge"></a>
<a href="http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=P__gXIArh5UDBsEq7ttd4WhIYnNh3y1t&authKey=GAsRKEZ%2FwHpzRv19hNJsDnknOc86lYzNIHMPy2Jxt3S3U8f90qestOd760IAj%2F3l&noverify=0&group_code=867785526"><img alt="QQ Group" src="https://img.shields.io/badge/QQ讨论群-867785526-brightgreen.svg?logoColor=white&style=for-the-badge"></a>
<a href="https://discord.gg/pnf4ABmDJt"><img alt="Discord" src="https://img.shields.io/badge/Discord-JOIN-4285F4.svg?logo=discord&logoColor=white&style=for-the-badge"></a>
<a href="https://t.me/lightnoble"><img alt="Discord" src="https://img.shields.io/badge/Telegram-JOIN-188FCA.svg?logo=telegram&logoColor=white&style=for-the-badge"></a>
<a href="https://t.me/lightnoble"><img alt="Telegram" src="https://img.shields.io/badge/Telegram-JOIN-188FCA.svg?logo=telegram&logoColor=white&style=for-the-badge"></a>
<a href="https://f-droid.org/packages/indi.dmzz_yyhyy.lightnovelreader/"><img alt="F-droid" src="https://img.shields.io/f-droid/v/indi.dmzz_yyhyy.lightnovelreader?style=for-the-badge&logo=fdroid&logoColor=white"></a>
<p>輕小說閱讀軟體,使用 Jetpack Compose 框架開發</p>
<img src="assets/header.png" alt="drawing" width="80%"/>
</div>
Expand All @@ -29,21 +30,21 @@ LightNovelReader <sup>*重構版*</sup> 是一款開源的輕小說閱讀軟體

## 外掛程式開發與自訂資料來源

您可以為LightNovelReader新增自訂的資料來源與插件
您可以為LightNovelReader新增自訂的資料來源與外掛

以下為相關資源鏈接
- [範例外掛程式](https://github.com/dmzz-yyhyy/LightNovelReaderPlguin-Template)
- [開髮指南](https://lnr.nariko.org/plugin-dev/)
- [開發指南](https://lnr.nariko.org/plugin-dev/)
- [LNR Api KDoc](https://api-doc.lnr.nariko.org/)

歡迎各位開發者進行開發!

## 下載

從 [GitHub Releases](https://github.com/dmzz-yyhyy/LightNovelReader/releases/latest) 下載最新發布版。要體驗最新的功能與錯誤修復,請從 [Actions](https://github.com/dmzz-yyhyy/LightNovelReader/actions) 下載最新建置
從 [GitHub Releases](https://github.com/dmzz-yyhyy/LightNovelReader/releases/latest) 下載最新發布版。要體驗最新的功能與錯誤修復,請從 [Actions](https://github.com/dmzz-yyhyy/LightNovelReader/actions) 下載最新Alpha開發版

[<img src="https://f-droid.org/badge/get-it-on-zh-tw.png"
alt="取得於 F-Droid 立即下載"
alt="立即在F-droid下載"
height="80">](https://f-droid.org/packages/indi.dmzz_yyhyy.lightnovelreader)

## 支援
Expand All @@ -56,7 +57,7 @@ LightNovelReader <sup>*重構版*</sup> 是一款開源的輕小說閱讀軟體
## 軟體截圖

| |
|-----------------------------|
| --------------------------- |
| ![image](assets/light1.png) |
| ![image](assets/light2.png) |
| ![image](assets/light3.png) |
Expand Down
3 changes: 2 additions & 1 deletion README_US.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<a href="http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=P__gXIArh5UDBsEq7ttd4WhIYnNh3y1t&authKey=GAsRKEZ%2FwHpzRv19hNJsDnknOc86lYzNIHMPy2Jxt3S3U8f90qestOd760IAj%2F3l&noverify=0&group_code=867785526"><img alt="QQ Group" src="https://img.shields.io/badge/QQ讨论群-867785526-brightgreen.svg?logoColor=white&style=for-the-badge"></a>
<a href="https://discord.gg/pnf4ABmDJt"><img alt="Discord" src="https://img.shields.io/badge/Discord-JOIN-4285F4.svg?logo=discord&logoColor=white&style=for-the-badge"></a>
<a href="https://t.me/lightnoble"><img alt="Discord" src="https://img.shields.io/badge/Telegram-JOIN-188FCA.svg?logo=telegram&logoColor=white&style=for-the-badge"></a>
<a href="https://f-droid.org/packages/indi.dmzz_yyhyy.lightnovelreader/"><img alt="F-droid" src="https://img.shields.io/f-droid/v/indi.dmzz_yyhyy.lightnovelreader?style=for-the-badge&logo=fdroid&logoColor=white"></a>
<p>Light novel reading application built with Jetpack Compose</p>
<img src="assets/header.png" alt="drawing" width="80%"/>
</div>
Expand Down Expand Up @@ -56,7 +57,7 @@ Download the latest release from [GitHub Releases](https://github.com/dmzz-yyhyy
## Screenshots

| |
|-----------------------------|
| --------------------------- |
| ![image](assets/light1.png) |
| ![image](assets/light2.png) |
| ![image](assets/light3.png) |
Expand Down
2 changes: 1 addition & 1 deletion api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ dokka {
moduleName.set("Light Novel Reader Api")
dokkaPublications.html {
suppressInheritedMembers.set(true)
failOnWarning.set(true)
//failOnWarning.set(true)
}
dokkaSourceSets.configureEach {
reportUndocumented.set(true)
Expand Down
47 changes: 46 additions & 1 deletion api/src/main/kotlin/io/nightfish/lightnovelreader/api/Route.kt
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ object Route {
object Debug
/** 主题设置界面路由 */
@Serializable
object Theme
object Theme {
@Serializable
object Main
@Serializable
object CostumeThemeScheme
}
/** 开源许可证界面路由 */
@Serializable
object Licenses
Expand Down Expand Up @@ -233,6 +238,46 @@ object Route {
return result
}
}
/**
* 自定义颜色选择器对话框路由
*
* @param colorUserDataPath 颜色用户数据的路径字符串
* @param colors 可选颜色的ARGB值列表
*/
@Serializable
data class CostumeColorPickerDialog(
val colorUserDataPath: String,
val colors: LongArray
) {
/**
* 判断两个[CostumeColorPickerDialog]是否相等
*
* @param other 另一个对象
* @return 属性完全相同则返回true
*/
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false

other as CostumeColorPickerDialog

if (colorUserDataPath != other.colorUserDataPath) return false
if (!colors.contentEquals(other.colors)) return false

return true
}

/**
* 基于[colorUserDataPath]和[colors]计算哈希值
*
* @return 哈希值
*/
override fun hashCode(): Int {
var result = colorUserDataPath.hashCode()
result = 31 * result + colors.contentHashCode()
return result
}
}
/**
* 图片查看器对话框路由
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.nightfish.lightnovelreader.api.userdata

import android.util.Log
import androidx.compose.ui.graphics.Color
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
Expand All @@ -21,10 +22,22 @@ class ColorUserData (
}

override fun get(): Color? {
return userDataDao.get(path)?.toULong().let { Color(it?: return null) }
return try {
userDataDao.get(path)?.toULong().let { Color(it?: return null) }
} catch (e: NumberFormatException) {
Log.e("ColorUserData", "Failed to parse color value at path: $path", e)
null
}
}

override fun getFlow(): Flow<Color?> {
return userDataDao.getFlow(path).map { it?.toULong() }.map { Color(it?: return@map null) }
return userDataDao.getFlow(path).map { rawValue ->
try {
rawValue?.toULong().let { Color(it?: return@map null) }
} catch (e: NumberFormatException) {
Log.e("ColorUserData", "Failed to parse color value at path: $path", e)
null
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,26 @@ sealed class UserDataPath(
data object DynamicColors : UserDataPath("dynamic_color", Display)
/** 启用 Material 3 Expressive @since Api 2 */
data object EnableM3E : UserDataPath("enable_m3_expressive", Display)
/* 自定義調色盤 */
data object EnableCostumeThemeScheme : UserDataPath("enable_costume_theme_scheme", Display)
data object CostumeThemeSchemePrimary : UserDataPath("costume_theme_scheme_primary", Display)
data object CostumeThemeSchemeOnPrimary : UserDataPath("costume_theme_scheme_on_primary", Display)
data object CostumeThemeSchemePrimaryContainer : UserDataPath("costume_theme_scheme_primary_container", Display)
data object CostumeThemeSchemeOnPrimaryContainer : UserDataPath("costume_theme_scheme_on_primary_container", Display)
data object CostumeThemeSchemeSecondary : UserDataPath("costume_theme_scheme_secondary", Display)
data object CostumeThemeSchemeOnSecondary : UserDataPath("costume_theme_scheme_on_secondary", Display)
data object CostumeThemeSchemeSecondaryContainer : UserDataPath("costume_theme_scheme_secondary_container", Display)
data object CostumeThemeSchemeOnSecondaryContainer : UserDataPath("costume_theme_scheme_on_secondary_container", Display)
data object CostumeThemeSchemeTertiary : UserDataPath("costume_theme_scheme_tertiary", Display)
data object CostumeThemeSchemeOnTertiary : UserDataPath("costume_theme_scheme_on_tertiary", Display)
data object CostumeThemeSchemeTertiaryContainer : UserDataPath("costume_theme_scheme_tertiary_container", Display)
data object CostumeThemeSchemeOnTertiaryContainer : UserDataPath("costume_theme_scheme_on_tertiary_container", Display)
data object CostumeThemeSchemeBackground : UserDataPath("costume_theme_scheme_background", Display)
data object CostumeThemeSchemeOnBackground : UserDataPath("costume_theme_scheme_on_background", Display)
data object CostumeThemeSchemeSurface : UserDataPath("costume_theme_scheme_surface", Display)
data object CostumeThemeSchemeOnSurface : UserDataPath("costume_theme_scheme_on_surface", Display)
data object CostumeThemeSchemeError : UserDataPath("costume_theme_scheme_error", Display)
data object CostumeThemeSchemeOnError : UserDataPath("costume_theme_scheme_on_error", Display)
/** 应用语言设置 @since Api 2 */
data object AppLocale : UserDataPath("app_locale", Display)
/** 浅色主题名称 @since Api 2 */
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ android {
minSdk = 24
targetSdk = 36
// 版本号为x.y.z则versionCode为x*1000000+y*10000+z*1000+debug版本号(开发需要时迭代, 三位数)
versionCode = 1_02_01_003
versionCode = 1_02_01_004
versionName = "1.2.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -223,4 +223,4 @@ tasks.register("printVersionCode") {
doFirst {
println(android.defaultConfig.versionCode)
}
}
}
Loading
Loading