From 2be872555c08a66a820695ca6961e18d02dec359 Mon Sep 17 00:00:00 2001
From: "Tadashi G. Takaoka" <takaoka@google.com>
Date: Thu, 8 Sep 2011 10:27:36 +0900
Subject: [PATCH] Use full screen mode on landscape/phone device

Bug: 5262767
Change-Id: I721c18522c972ced9f359f2e5208572d54a4b7a1
---
 java/res/values-land/config.xml               | 23 +++++++++++++++++++
 java/res/values-sw600dp-land/config.xml       | 23 +++++++++++++++++++
 java/res/values-sw768dp-land/config.xml       | 23 +++++++++++++++++++
 java/res/values/config.xml                    |  1 +
 java/res/values/dimens.xml                    |  5 ----
 .../android/inputmethod/latin/LatinIME.java   | 10 +-------
 6 files changed, 71 insertions(+), 14 deletions(-)
 create mode 100644 java/res/values-land/config.xml
 create mode 100644 java/res/values-sw600dp-land/config.xml
 create mode 100644 java/res/values-sw768dp-land/config.xml

diff --git a/java/res/values-land/config.xml b/java/res/values-land/config.xml
new file mode 100644
index 0000000000..7d93cc2ffa
--- /dev/null
+++ b/java/res/values-land/config.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2011, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources>
+    <bool name="config_use_fullscreen_mode">true</bool>
+</resources>
diff --git a/java/res/values-sw600dp-land/config.xml b/java/res/values-sw600dp-land/config.xml
new file mode 100644
index 0000000000..b3cd7278d6
--- /dev/null
+++ b/java/res/values-sw600dp-land/config.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2011, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources>
+    <bool name="config_use_fullscreen_mode">false</bool>
+</resources>
diff --git a/java/res/values-sw768dp-land/config.xml b/java/res/values-sw768dp-land/config.xml
new file mode 100644
index 0000000000..b3cd7278d6
--- /dev/null
+++ b/java/res/values-sw768dp-land/config.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2011, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources>
+    <bool name="config_use_fullscreen_mode">false</bool>
+</resources>
diff --git a/java/res/values/config.xml b/java/res/values/config.xml
index d9ff8d7b9d..194f2ed42a 100644
--- a/java/res/values/config.xml
+++ b/java/res/values/config.xml
@@ -19,6 +19,7 @@
 -->
 
 <resources>
+    <bool name="config_use_fullscreen_mode">false</bool>
     <bool name="config_enable_show_settings_key_option">true</bool>
     <bool name="config_default_show_settings_key">false</bool>
     <bool name="config_enable_show_voice_key_option">true</bool>
diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml
index 4e4993b24b..8488c777b8 100644
--- a/java/res/values/dimens.xml
+++ b/java/res/values/dimens.xml
@@ -95,10 +95,5 @@
     <integer name="suggestions_count_in_strip">3</integer>
     <integer name="center_suggestion_percentile">36</integer>
 
-    <!-- If the screen height in landscape is larger than the below value, then the keyboard
-         will not go into extract (fullscreen) mode.
-         Current value is approximate to 7-inch tablet height - system navigation bar height. -->
-    <dimen name="max_height_for_fullscreen">500dip</dimen>
-
     <dimen name="key_hysteresis_distance">0.05in</dimen>
 </resources>
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 68d93295ca..08af5c5e3b 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1004,15 +1004,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
                 return false;
         }
 
-        final Resources res = mResources;
-        final DisplayMetrics dm = res.getDisplayMetrics();
-        // If the display is more than X DIP high, don't go to fullscreen mode
-        final int threshold = res.getDimensionPixelSize(R.dimen.max_height_for_fullscreen);
-        if (dm.heightPixels >= threshold) {
-            return false;
-        } else {
-            return super.onEvaluateFullscreenMode();
-        }
+        return mResources.getBoolean(R.bool.config_use_fullscreen_mode);
     }
 
     @Override
-- 
GitLab