aboutsummaryrefslogtreecommitdiffstats
path: root/java/res
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-10-12 18:50:04 +0900
committerTadashi G. Takaoka <takaoka@google.com>2011-10-14 17:49:48 +0900
commita0e4f40994f779ad98268921c63d6535ad04224f (patch)
treefa5282d0d50dc697a5338fc7bb1088bdbde3a38a /java/res
parented6bc82d9785372c407e1a4f563ae7d30c479b8a (diff)
downloadlatinime-a0e4f40994f779ad98268921c63d6535ad04224f.tar.gz
latinime-a0e4f40994f779ad98268921c63d6535ad04224f.tar.xz
latinime-a0e4f40994f779ad98268921c63d6535ad04224f.zip
Special handling of one key mini-keyboard to mitigate visual flicker
Use pre-computed width and height of mini keyboard if * Popup key preview is enabled * The mini keyboard has only one key * Pre-computed width and height are specified Bug: 5248783 Change-Id: I53475698e87d5bd67d36e63323c25a9e9f18fbb1
Diffstat (limited to 'java/res')
-rw-r--r--java/res/values-hdpi/keyboard_key_feedback_background_holo.xml24
-rw-r--r--java/res/values-mdpi/keyboard_key_feedback_background_holo.xml24
-rw-r--r--java/res/values-xhdpi/keyboard_key_feedback_background_holo.xml24
-rw-r--r--java/res/values/attrs.xml4
-rw-r--r--java/res/values/styles.xml2
5 files changed, 78 insertions, 0 deletions
diff --git a/java/res/values-hdpi/keyboard_key_feedback_background_holo.xml b/java/res/values-hdpi/keyboard_key_feedback_background_holo.xml
new file mode 100644
index 000000000..8ab32269d
--- /dev/null
+++ b/java/res/values-hdpi/keyboard_key_feedback_background_holo.xml
@@ -0,0 +1,24 @@
+<?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>
+ <dimen name="keyboard_key_feedback_background_holo_width">46.67dp</dimen>
+ <dimen name="keyboard_key_feedback_background_holo_height">58.67dp</dimen>
+</resources>
diff --git a/java/res/values-mdpi/keyboard_key_feedback_background_holo.xml b/java/res/values-mdpi/keyboard_key_feedback_background_holo.xml
new file mode 100644
index 000000000..10fef3d48
--- /dev/null
+++ b/java/res/values-mdpi/keyboard_key_feedback_background_holo.xml
@@ -0,0 +1,24 @@
+<?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>
+ <dimen name="keyboard_key_feedback_background_holo_width">46dp</dimen>
+ <dimen name="keyboard_key_feedback_background_holo_height">58dp</dimen>
+</resources>
diff --git a/java/res/values-xhdpi/keyboard_key_feedback_background_holo.xml b/java/res/values-xhdpi/keyboard_key_feedback_background_holo.xml
new file mode 100644
index 000000000..fba602626
--- /dev/null
+++ b/java/res/values-xhdpi/keyboard_key_feedback_background_holo.xml
@@ -0,0 +1,24 @@
+<?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>
+ <dimen name="keyboard_key_feedback_background_holo_width">47dp</dimen>
+ <dimen name="keyboard_key_feedback_background_holo_height">57dp</dimen>
+</resources>
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 4dfa5ab97..e569e83b1 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -88,6 +88,10 @@
<attr name="keyPreviewLeftBackground" format="reference" />
<!-- The background for the right edge key press feedback. -->
<attr name="keyPreviewRightBackground" format="reference" />
+ <!-- The width of rectangle part of the key press feedback background. -->
+ <attr name="keyPreviewBackgroundWidth" format="dimension" />
+ <!-- The height of rectangle part of the key press feedback background. -->
+ <attr name="keyPreviewBackgroundHeight" format="dimension" />
<!-- The text color for key press feedback. -->
<attr name="keyPreviewTextColor" format="color" />
<!-- Vertical offset of the key press feedback from the key. -->
diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml
index 30c0e5a38..43aa58388 100644
--- a/java/res/values/styles.xml
+++ b/java/res/values/styles.xml
@@ -259,6 +259,8 @@
<item name="keyPreviewBackground">@drawable/keyboard_key_feedback_ics</item>
<item name="keyPreviewLeftBackground">@drawable/keyboard_key_feedback_left_ics</item>
<item name="keyPreviewRightBackground">@drawable/keyboard_key_feedback_right_ics</item>
+ <item name="keyPreviewBackgroundWidth">@dimen/keyboard_key_feedback_background_holo_width</item>
+ <item name="keyPreviewBackgroundHeight">@dimen/keyboard_key_feedback_background_holo_height</item>
<item name="keyPreviewTextColor">#FFFFFFFF</item>
<item name="keyPreviewHeight">@dimen/key_preview_height_ics</item>
<item name="keyPreviewOffset">@dimen/key_preview_offset_ics</item>