Horis 3 лет назад
Родитель
Сommit
d75059de09

+ 1 - 0
app/src/main/java/io/legado/app/constant/PreferKey.kt

@@ -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"

+ 6 - 0
app/src/main/java/io/legado/app/help/config/AppConfig.kt

@@ -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) {

+ 6 - 0
app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt

@@ -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

+ 1 - 0
app/src/main/res/values-es-rES/strings.xml

@@ -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>

+ 1 - 0
app/src/main/res/values-ja-rJP/strings.xml

@@ -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>

+ 1 - 0
app/src/main/res/values-pt-rBR/strings.xml

@@ -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>

+ 1 - 0
app/src/main/res/values-vi/strings.xml

@@ -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>

+ 1 - 0
app/src/main/res/values-zh-rHK/strings.xml

@@ -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>

+ 1 - 0
app/src/main/res/values-zh-rTW/strings.xml

@@ -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>

+ 1 - 0
app/src/main/res/values-zh/strings.xml

@@ -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>

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -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>

+ 7 - 0
app/src/main/res/xml/pref_config_read.xml

@@ -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"