From 2c43589c1cba5048963ee5644ca32206e6c30322 Mon Sep 17 00:00:00 2001 From: liqichang Date: Sat, 8 Jun 2019 11:06:47 +0800 Subject: [PATCH] Add auto screen rotation support. --- .../main/java/com/hippo/ehviewer/ui/GalleryActivity.java | 6 ++++++ app/src/main/res/values-zh-rCN/strings.xml | 1 + app/src/main/res/values/arrays.xml | 2 ++ app/src/main/res/values/strings.xml | 1 + 4 files changed, 10 insertions(+) diff --git a/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.java b/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.java index 4d2d7b745..587555f06 100644 --- a/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.java +++ b/app/src/main/java/com/hippo/ehviewer/ui/GalleryActivity.java @@ -370,6 +370,9 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { case 2: orientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE; break; + case 3: + orientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR; + break; } setRequestedOrientation(orientation); @@ -841,6 +844,9 @@ public void onClick(DialogInterface dialog, int which) { case 2: orientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE; break; + case 3: + orientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR; + break; } setRequestedOrientation(orientation); mGalleryView.setLayoutMode(layoutMode); diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 4098210d8..53cca4265 100755 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -465,6 +465,7 @@ 系统默认 竖屏 横屏 + 自动旋转 阅读方向 从左至右 从右至左 diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index c37adb1a9..29f5eaded 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -156,12 +156,14 @@ @string/settings_read_screen_rotation_default @string/settings_read_screen_rotation_portrait @string/settings_read_screen_rotation_landscape + @string/settings_read_screen_rotation_sensor 0 1 2 + 3 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f97fd72ff..cc5e9d235 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -510,6 +510,7 @@ Default Portrait Landscape + Auto rotate Reading direction Left to right Right to left