pull/743/head 3.20.121712
gedoor 4 years ago
parent 4491e507c6
commit 591128d9a6
  1. 2
      app/src/main/java/io/legado/app/constant/PreferKey.kt
  2. 4
      app/src/main/java/io/legado/app/help/AppConfig.kt
  3. 2
      app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt
  4. 2
      app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt
  5. 2
      app/src/main/res/xml/pref_config_read.xml

@ -62,7 +62,7 @@ object PreferKey {
const val autoClearExpired = "autoClearExpired"
const val autoChangeSource = "autoChangeSource"
const val importKeepName = "importKeepName"
const val screenDirection = "screenDirection"
const val screenOrientation = "screenOrientation"
const val syncBookProgress = "syncBookProgress"
const val cPrimary = "colorPrimary"

@ -79,8 +79,8 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
val immNavigationBar: Boolean
get() = context.getPrefBoolean(PreferKey.immNavigationBar, true)
val screenDirection: String?
get() = context.getPrefString(PreferKey.screenDirection)
val screenOrientation: String?
get() = context.getPrefString(PreferKey.screenOrientation)
var backupPath: String?
get() = context.getPrefString(PreferKey.backupPath)

@ -77,7 +77,7 @@ abstract class ReadBookBaseActivity :
*/
@SuppressLint("SourceLockedOrientationActivity")
fun setOrientation() {
when (AppConfig.screenDirection) {
when (AppConfig.screenOrientation) {
"0" -> requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
"1" -> requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
"2" -> requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE

@ -107,7 +107,7 @@ class MoreConfigDialog : DialogFragment() {
}
PreferKey.keepLight -> postEvent(key, true)
PreferKey.textSelectAble -> postEvent(key, getPrefBoolean(key))
PreferKey.screenDirection -> {
PreferKey.screenOrientation -> {
(activity as? ReadBookActivity)?.setOrientation()
}
PreferKey.textFullJustify,

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<io.legado.app.ui.widget.prefs.NameListPreference
android:key="screenDirection"
android:key="screenOrientation"
android:defaultValue="0"
android:title="@string/screen_direction"
android:entries="@array/screen_direction_title"

Loading…
Cancel
Save