This commit is contained in:
Horis
2023-10-18 22:05:00 +08:00
parent 297cc92c59
commit 8f49e2d9fb
12 changed files with 28 additions and 0 deletions

View File

@@ -138,6 +138,7 @@ object PreferKey {
const val defaultHomePage = "defaultHomePage"
const val showBookshelfFastScroller = "showBookshelfFastScroller"
const val importKeepEnable = "importKeepEnable"
const val previewImageByClick = "previewImageByClick"
const val cPrimary = "colorPrimary"
const val cAccent = "colorAccent"

View File

@@ -426,6 +426,12 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
appCtx.putPrefBoolean(PreferKey.importKeepEnable, value)
}
var previewImageByClick: Boolean
get() = appCtx.getPrefBoolean(PreferKey.previewImageByClick, false)
set(value) {
appCtx.putPrefBoolean(PreferKey.previewImageByClick, value)
}
var preDownloadNum
get() = appCtx.getPrefInt(PreferKey.preDownloadNum, 10)
set(value) {

View File

@@ -24,6 +24,7 @@ import io.legado.app.ui.book.read.page.entities.TextPos
import io.legado.app.ui.book.read.page.entities.column.*
import io.legado.app.ui.book.read.page.provider.ChapterProvider
import io.legado.app.ui.book.read.page.provider.TextPageFactory
import io.legado.app.ui.widget.dialog.PhotoDialog
import io.legado.app.utils.*
import kotlin.math.min
@@ -348,6 +349,11 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at
context.toastOnUi("Button Pressed!")
handled = true
}
is ImageColumn -> if (AppConfig.previewImageByClick) {
activity?.showDialogFragment(PhotoDialog(column.src))
handled = true
}
}
}
return handled

View File

@@ -1132,4 +1132,5 @@
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
<string name="export_all_use_book_source">导出所有书的书源</string>
<string name="keep_enable">保留启用状态</string>
<string name="preview_image_by_click">点击预览图片</string>
</resources>

View File

@@ -1135,4 +1135,5 @@
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
<string name="export_all_use_book_source">导出所有书的书源</string>
<string name="keep_enable">保留启用状态</string>
<string name="preview_image_by_click">点击预览图片</string>
</resources>

View File

@@ -1135,4 +1135,5 @@
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
<string name="export_all_use_book_source">导出所有书的书源</string>
<string name="keep_enable">保留启用状态</string>
<string name="preview_image_by_click">点击预览图片</string>
</resources>

View File

@@ -1130,4 +1130,5 @@ Còn </string>
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
<string name="export_all_use_book_source">导出所有书的书源</string>
<string name="keep_enable">保留启用状态</string>
<string name="preview_image_by_click">点击预览图片</string>
</resources>

View File

@@ -1131,4 +1131,5 @@
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
<string name="export_all_use_book_source">导出所有书的书源</string>
<string name="keep_enable">保留启用状态</string>
<string name="preview_image_by_click">点击预览图片</string>
</resources>

View File

@@ -1133,4 +1133,5 @@
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
<string name="export_all_use_book_source">导出所有书的书源</string>
<string name="keep_enable">保留启用状态</string>
<string name="preview_image_by_click">点击预览图片</string>
</resources>

View File

@@ -1133,4 +1133,5 @@
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
<string name="export_all_use_book_source">导出所有书的书源</string>
<string name="keep_enable">保留启用状态</string>
<string name="preview_image_by_click">点击预览图片</string>
</resources>

View File

@@ -1135,4 +1135,5 @@
<string name="show_bookshelf_fast_scroller">显示快速滚动条</string>
<string name="export_all_use_book_source">导出所有书的书源</string>
<string name="keep_enable">保留启用状态</string>
<string name="preview_image_by_click">点击预览图片</string>
</resources>

View File

@@ -143,6 +143,13 @@
app:iconSpaceReserved="false"
app:isBottomBackground="true" />
<io.legado.app.lib.prefs.SwitchPreference
android:defaultValue="false"
android:key="previewImageByClick"
android:title="@string/preview_image_by_click"
app:iconSpaceReserved="false"
app:isBottomBackground="true" />
<io.legado.app.lib.prefs.Preference
android:key="clickRegionalConfig"
android:title="@string/click_regional_config"