From a90a4bf80c0c0ace1e26a802e6e30062c682ad93 Mon Sep 17 00:00:00 2001 From: inorichi Date: Fri, 12 Feb 2016 21:22:54 +0100 Subject: [PATCH] Remove old orientation lock. Add orientation types to preferences --- .../tachiyomi/data/preference/PreferencesHelper.java | 4 ---- .../eu/kanade/tachiyomi/ui/reader/ReaderMenu.java | 6 +++--- app/src/main/res/values/keys.xml | 1 - app/src/main/res/xml/pref_reader.xml | 12 ++++++++---- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.java b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.java index 512910d6c..43a9f990d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.java +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.java @@ -56,10 +56,6 @@ public class PreferencesHelper { prefs.edit().clear().apply(); } - public Preference lockOrientation() { - return rxPrefs.getBoolean(getKey(R.string.pref_lock_orientation_key), true); - } - public Preference rotation() { return rxPrefs.getInteger(getKey(R.string.pref_rotation_type_key), 1); } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderMenu.java b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderMenu.java index d1274dfe6..424b908dd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderMenu.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderMenu.java @@ -182,11 +182,11 @@ public class ReaderMenu { @SuppressWarnings("ConstantConditions") private void initializeMenu() { // Orientation selector - add(preferences.lockOrientation().asObservable() - .subscribe(locked -> { + add(preferences.rotation().asObservable() + .subscribe(value -> { boolean isPortrait = activity.getResources().getConfiguration() .orientation == Configuration.ORIENTATION_PORTRAIT; - int resourceId = !locked ? R.drawable.ic_screen_rotation : isPortrait ? + int resourceId = value == 1 ? R.drawable.ic_screen_rotation : isPortrait ? R.drawable.ic_screen_lock_portrait : R.drawable.ic_screen_lock_landscape; diff --git a/app/src/main/res/values/keys.xml b/app/src/main/res/values/keys.xml index 1eb4696b6..c89ef298a 100644 --- a/app/src/main/res/values/keys.xml +++ b/app/src/main/res/values/keys.xml @@ -19,7 +19,6 @@ pref_image_scale_type_key pref_zoom_start_key pref_hide_status_bar_key - pref_lock_orientation_key pref_rotation_type_key pref_enable_transitions_key pref_show_page_number_key diff --git a/app/src/main/res/xml/pref_reader.xml b/app/src/main/res/xml/pref_reader.xml index 9c33747e5..1860478cf 100644 --- a/app/src/main/res/xml/pref_reader.xml +++ b/app/src/main/res/xml/pref_reader.xml @@ -5,10 +5,6 @@ android:key="@string/pref_hide_status_bar_key" android:defaultValue="true" /> - - @@ -49,6 +45,14 @@ android:defaultValue="1" android:summary="%s"/> + +