横屏双页

pull/1352/head
gedoor 3 years ago
parent 35196168ba
commit 7f56b019e3
  1. 1
      app/src/main/java/io/legado/app/constant/PreferKey.kt
  2. 3
      app/src/main/java/io/legado/app/help/AppConfig.kt
  3. 6
      app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt
  4. 4
      app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt
  5. 1
      app/src/main/res/values-es-rES/strings.xml
  6. 1
      app/src/main/res/values-ja-rJP/strings.xml
  7. 1
      app/src/main/res/values-pt-rBR/strings.xml
  8. 1
      app/src/main/res/values-zh-rHK/strings.xml
  9. 1
      app/src/main/res/values-zh-rTW/strings.xml
  10. 1
      app/src/main/res/values-zh/strings.xml
  11. 1
      app/src/main/res/values/strings.xml
  12. 7
      app/src/main/res/xml/pref_config_read.xml

@ -88,6 +88,7 @@ object PreferKey {
const val brightness = "brightness" const val brightness = "brightness"
const val nightBrightness = "nightBrightness" const val nightBrightness = "nightBrightness"
const val expandTextMenu = "expandTextMenu" const val expandTextMenu = "expandTextMenu"
const val doublePageHorizontal = "doublePageHorizontal"
const val cPrimary = "colorPrimary" const val cPrimary = "colorPrimary"
const val cAccent = "colorAccent" const val cAccent = "colorAccent"

@ -252,6 +252,9 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
val fullScreenGesturesSupport: Boolean val fullScreenGesturesSupport: Boolean
get() = appCtx.getPrefBoolean(PreferKey.fullScreenGesturesSupport, false) get() = appCtx.getPrefBoolean(PreferKey.fullScreenGesturesSupport, false)
val doublePageHorizontal: Boolean
get() = appCtx.getPrefBoolean(PreferKey.doublePageHorizontal, true)
private fun getPrefUserAgent(): String { private fun getPrefUserAgent(): String {
val ua = appCtx.getPrefString(PreferKey.userAgent) val ua = appCtx.getPrefString(PreferKey.userAgent)
if (ua.isNullOrBlank()) { if (ua.isNullOrBlank()) {

@ -15,8 +15,10 @@ import io.legado.app.constant.PreferKey
import io.legado.app.help.ReadBookConfig import io.legado.app.help.ReadBookConfig
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.bottomBackground import io.legado.app.lib.theme.bottomBackground
import io.legado.app.model.ReadBook
import io.legado.app.ui.book.read.ReadBookActivity import io.legado.app.ui.book.read.ReadBookActivity
import io.legado.app.ui.book.read.page.ReadView import io.legado.app.ui.book.read.page.ReadView
import io.legado.app.ui.book.read.page.provider.ChapterProvider
import io.legado.app.utils.dp import io.legado.app.utils.dp
import io.legado.app.utils.getPrefBoolean import io.legado.app.utils.getPrefBoolean
import io.legado.app.utils.postEvent import io.legado.app.utils.postEvent
@ -122,6 +124,10 @@ class MoreConfigDialog : DialogFragment() {
PreferKey.expandTextMenu -> { PreferKey.expandTextMenu -> {
(activity as? ReadBookActivity)?.textActionMenu?.upMenu() (activity as? ReadBookActivity)?.textActionMenu?.upMenu()
} }
PreferKey.doublePageHorizontal -> {
ChapterProvider.upLayout()
ReadBook.loadContent(false)
}
} }
} }

@ -585,7 +585,9 @@ object ChapterProvider {
* 更新绘制尺寸 * 更新绘制尺寸
*/ */
fun upLayout() { fun upLayout() {
doublePage = viewWidth > viewHeight && ReadBook.pageAnim() != 3 doublePage = viewWidth > viewHeight
&& ReadBook.pageAnim() != 3
&& AppConfig.doublePageHorizontal
if (viewWidth > 0 && viewHeight > 0) { if (viewWidth > 0 && viewHeight > 0) {
paddingLeft = ReadBookConfig.paddingLeft.dp paddingLeft = ReadBookConfig.paddingLeft.dp
paddingTop = ReadBookConfig.paddingTop.dp paddingTop = ReadBookConfig.paddingTop.dp

@ -890,5 +890,6 @@
<string name="disable_source">禁用源</string> <string name="disable_source">禁用源</string>
<string name="delete_source">删除源</string> <string name="delete_source">删除源</string>
<string name="chapter_pay">购买</string> <string name="chapter_pay">购买</string>
<string name="double_page_horizontal">横屏双页</string>
</resources> </resources>

@ -894,5 +894,6 @@
<string name="disable_source">禁用源</string> <string name="disable_source">禁用源</string>
<string name="delete_source">删除源</string> <string name="delete_source">删除源</string>
<string name="chapter_pay">购买</string> <string name="chapter_pay">购买</string>
<string name="double_page_horizontal">横屏双页</string>
</resources> </resources>

@ -894,5 +894,6 @@
<string name="disable_source">禁用源</string> <string name="disable_source">禁用源</string>
<string name="delete_source">删除源</string> <string name="delete_source">删除源</string>
<string name="chapter_pay">购买</string> <string name="chapter_pay">购买</string>
<string name="double_page_horizontal">横屏双页</string>
</resources> </resources>

@ -891,5 +891,6 @@
<string name="disable_source">禁用源</string> <string name="disable_source">禁用源</string>
<string name="delete_source">删除源</string> <string name="delete_source">删除源</string>
<string name="chapter_pay">购买</string> <string name="chapter_pay">购买</string>
<string name="double_page_horizontal">横屏双页</string>
</resources> </resources>

@ -893,5 +893,6 @@
<string name="disable_source">禁用源</string> <string name="disable_source">禁用源</string>
<string name="delete_source">删除源</string> <string name="delete_source">删除源</string>
<string name="chapter_pay">购买</string> <string name="chapter_pay">购买</string>
<string name="double_page_horizontal">横屏双页</string>
</resources> </resources>

@ -893,5 +893,6 @@
<string name="disable_source">禁用源</string> <string name="disable_source">禁用源</string>
<string name="delete_source">删除源</string> <string name="delete_source">删除源</string>
<string name="chapter_pay">购买</string> <string name="chapter_pay">购买</string>
<string name="double_page_horizontal">横屏双页</string>
</resources> </resources>

@ -894,5 +894,6 @@
<string name="disable_source">禁用源</string> <string name="disable_source">禁用源</string>
<string name="delete_source">删除源</string> <string name="delete_source">删除源</string>
<string name="chapter_pay">购买</string> <string name="chapter_pay">购买</string>
<string name="double_page_horizontal">横屏双页</string>
</resources> </resources>

@ -41,6 +41,13 @@
app:iconSpaceReserved="false" app:iconSpaceReserved="false"
app:isBottomBackground="true" /> app:isBottomBackground="true" />
<io.legado.app.ui.widget.prefs.SwitchPreference
android:defaultValue="true"
android:title="@string/double_page_horizontal"
android:key="doublePageHorizontal"
app:iconSpaceReserved="false"
app:isBottomBackground="true" />
<io.legado.app.ui.widget.prefs.SwitchPreference <io.legado.app.ui.widget.prefs.SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:title="@string/use_zh_layout" android:title="@string/use_zh_layout"

Loading…
Cancel
Save