mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
feat: 更详细的横竖屏单双页设置
This commit is contained in:
@@ -312,8 +312,8 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
|
||||
val loadCoverOnlyWifi = appCtx.getPrefBoolean(PreferKey.loadCoverOnlyWifi, false)
|
||||
|
||||
val doublePageHorizontal: Boolean
|
||||
get() = appCtx.getPrefBoolean(PreferKey.doublePageHorizontal, true)
|
||||
val doublePageHorizontal: String?
|
||||
get() = appCtx.getPrefString(PreferKey.doublePageHorizontal)
|
||||
|
||||
var searchGroup: String
|
||||
get() = appCtx.getPrefString("searchGroup") ?: ""
|
||||
|
||||
@@ -612,9 +612,15 @@ object ChapterProvider {
|
||||
* 更新绘制尺寸
|
||||
*/
|
||||
fun upLayout() {
|
||||
doublePage = (viewWidth > viewHeight || appCtx.isPad)
|
||||
&& ReadBook.pageAnim() != 3
|
||||
&& AppConfig.doublePageHorizontal
|
||||
when(AppConfig.doublePageHorizontal){
|
||||
"0" -> doublePage = false
|
||||
"1" -> doublePage = true
|
||||
"2" -> {
|
||||
doublePage = (viewWidth > viewHeight)
|
||||
&& ReadBook.pageAnim() != 3
|
||||
}
|
||||
}
|
||||
|
||||
if (viewWidth > 0 && viewHeight > 0) {
|
||||
paddingLeft = ReadBookConfig.paddingLeft.dpToPx()
|
||||
paddingTop = ReadBookConfig.paddingTop.dpToPx()
|
||||
|
||||
@@ -25,6 +25,12 @@
|
||||
<item>E-Ink(墨水屏)</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="double_page_title">
|
||||
<item>全局单页</item>
|
||||
<item>全局双页</item>
|
||||
<item>横屏双页/竖屏单页</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="NavBarColors">
|
||||
<item>自动</item>
|
||||
<item>黑色</item>
|
||||
|
||||
@@ -33,6 +33,12 @@
|
||||
<item>3</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="double_page_value">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="language_value">
|
||||
<item>auto</item>
|
||||
<item>zh</item>
|
||||
|
||||
@@ -61,6 +61,12 @@
|
||||
<item>@string/screen_sensor</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="double_page_title">
|
||||
<item>全局单页</item>
|
||||
<item>全局双页</item>
|
||||
<item>横屏双页 竖屏单页</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="icon_names" tools:ignore="Typos">
|
||||
<item>iconMain</item>
|
||||
<item>icon1</item>
|
||||
|
||||
@@ -41,13 +41,16 @@
|
||||
app:iconSpaceReserved="false"
|
||||
app:isBottomBackground="true" />
|
||||
|
||||
<io.legado.app.lib.prefs.SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:title="@string/double_page_horizontal"
|
||||
<io.legado.app.lib.prefs.NameListPreference
|
||||
android:key="doublePageHorizontal"
|
||||
android:defaultValue="0"
|
||||
android:title="@string/double_page_horizontal"
|
||||
android:entries="@array/double_page_title"
|
||||
android:entryValues="@array/double_page_value"
|
||||
app:iconSpaceReserved="false"
|
||||
app:isBottomBackground="true" />
|
||||
|
||||
|
||||
<io.legado.app.lib.prefs.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:title="@string/use_zh_layout"
|
||||
|
||||
Reference in New Issue
Block a user