aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/res/values/attrs.xml4
-rw-r--r--java/res/values/themes-ics.xml2
-rw-r--r--java/res/values/themes-klp.xml2
-rw-r--r--java/res/values/themes-lxx-dark.xml1
-rw-r--r--java/res/values/themes-lxx-light.xml1
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardView.java13
6 files changed, 18 insertions, 5 deletions
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 003b011f3..9a2227321 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -52,7 +52,9 @@
<attr name="spacebarIconWidthRatio" format="float" />
<!-- Right padding of hint letter to the edge of the key.-->
<attr name="keyHintLetterPadding" format="dimension" />
- <!-- Bottom padding of popup hint letter "..." to the edge of the key.-->
+ <!-- Popup hint letter string-->
+ <attr name="keyPopupHintLetter" format="string" />
+ <!-- Bottom padding of popup hint letter to the edge of the key.-->
<attr name="keyPopupHintLetterPadding" format="dimension" />
<!-- Right padding of shifted letter hint to the edge of the key.-->
<attr name="keyShiftedLetterHintPadding" format="dimension" />
diff --git a/java/res/values/themes-ics.xml b/java/res/values/themes-ics.xml
index 6118ce177..a6f390cbb 100644
--- a/java/res/values/themes-ics.xml
+++ b/java/res/values/themes-ics.xml
@@ -60,6 +60,8 @@
<item name="keyPreviewTextColor">@color/key_text_color_holo</item>
<!-- A negative value to disable key text shadow layer. -->
<item name="keyTextShadowRadius">-1.0</item>
+ <!-- U+2026: "…" HORIZONTAL ELLIPSIS -->
+ <item name="keyPopupHintLetter">&#x2026;</item>
</style>
<style
name="MainKeyboardView.ICS"
diff --git a/java/res/values/themes-klp.xml b/java/res/values/themes-klp.xml
index 193386062..8782a76aa 100644
--- a/java/res/values/themes-klp.xml
+++ b/java/res/values/themes-klp.xml
@@ -60,6 +60,8 @@
<item name="keyPreviewTextColor">@color/key_text_color_holo</item>
<!-- A negative value to disable key text shadow layer. -->
<item name="keyTextShadowRadius">-1.0</item>
+ <!-- U+2026: "…" HORIZONTAL ELLIPSIS -->
+ <item name="keyPopupHintLetter">&#x2026;</item>
</style>
<style
name="MainKeyboardView.KLP"
diff --git a/java/res/values/themes-lxx-dark.xml b/java/res/values/themes-lxx-dark.xml
index 0a1315858..fa6aa62e5 100644
--- a/java/res/values/themes-lxx-dark.xml
+++ b/java/res/values/themes-lxx-dark.xml
@@ -61,6 +61,7 @@
<item name="keyPreviewTextColor">@color/key_text_color_lxx_dark</item>
<!-- A negative value to disable key text shadow layer. -->
<item name="keyTextShadowRadius">-1.0</item>
+ <item name="keyPopupHintLetter"></item> <!-- No popup hint letter -->
</style>
<style
name="MainKeyboardView.LXX_Dark"
diff --git a/java/res/values/themes-lxx-light.xml b/java/res/values/themes-lxx-light.xml
index eccecdd87..e7350f924 100644
--- a/java/res/values/themes-lxx-light.xml
+++ b/java/res/values/themes-lxx-light.xml
@@ -61,6 +61,7 @@
<item name="keyPreviewTextColor">@color/key_text_color_lxx_light</item>
<!-- A negative value to disable key text shadow layer. -->
<item name="keyTextShadowRadius">-1.0</item>
+ <item name="keyPopupHintLetter"></item> <!-- No popup hint letter -->
</style>
<style
name="MainKeyboardView.LXX_Light"
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index f967f620a..5af0be649 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -29,6 +29,7 @@ import android.graphics.Region;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.NinePatchDrawable;
+import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
@@ -48,6 +49,7 @@ import java.util.HashSet;
* @attr ref R.styleable#KeyboardView_spacebarBackground
* @attr ref R.styleable#KeyboardView_spacebarIconWidthRatio
* @attr ref R.styleable#KeyboardView_keyHintLetterPadding
+ * @attr ref R.styleable#KeyboardView_keyPopupHintLetter
* @attr ref R.styleable#KeyboardView_keyPopupHintLetterPadding
* @attr ref R.styleable#KeyboardView_keyShiftedLetterHintPadding
* @attr ref R.styleable#KeyboardView_keyTextShadowRadius
@@ -74,6 +76,7 @@ public class KeyboardView extends View {
// XML attributes
private final KeyVisualAttributes mKeyVisualAttributes;
private final float mKeyHintLetterPadding;
+ private final String mKeyPopupHintLetter;
private final float mKeyPopupHintLetterPadding;
private final float mKeyShiftedLetterHintPadding;
private final float mKeyTextShadowRadius;
@@ -85,9 +88,6 @@ public class KeyboardView extends View {
private final Rect mKeyBackgroundPadding = new Rect();
private static final float KET_TEXT_SHADOW_RADIUS_DISABLED = -1.0f;
- // HORIZONTAL ELLIPSIS "...", character for popup hint.
- private static final String POPUP_HINT_CHAR = "\u2026";
-
// The maximum key label width in the proportion to the key width.
private static final float MAX_LABEL_RATIO = 0.90f;
@@ -132,6 +132,8 @@ public class KeyboardView extends View {
R.styleable.KeyboardView_spacebarIconWidthRatio, 1.0f);
mKeyHintLetterPadding = keyboardViewAttr.getDimension(
R.styleable.KeyboardView_keyHintLetterPadding, 0.0f);
+ mKeyPopupHintLetter = keyboardViewAttr.getString(
+ R.styleable.KeyboardView_keyPopupHintLetter);
mKeyPopupHintLetterPadding = keyboardViewAttr.getDimension(
R.styleable.KeyboardView_keyPopupHintLetterPadding, 0.0f);
mKeyShiftedLetterHintPadding = keyboardViewAttr.getDimension(
@@ -468,6 +470,9 @@ public class KeyboardView extends View {
// Draw popup hint "..." at the bottom right corner of the key.
protected void drawKeyPopupHint(final Key key, final Canvas canvas, final Paint paint,
final KeyDrawParams params) {
+ if (TextUtils.isEmpty(mKeyPopupHintLetter)) {
+ return;
+ }
final int keyWidth = key.getDrawWidth();
final int keyHeight = key.getHeight();
@@ -478,7 +483,7 @@ public class KeyboardView extends View {
final float hintX = keyWidth - mKeyHintLetterPadding
- TypefaceUtils.getReferenceCharWidth(paint) / 2.0f;
final float hintY = keyHeight - mKeyPopupHintLetterPadding;
- canvas.drawText(POPUP_HINT_CHAR, hintX, hintY, paint);
+ canvas.drawText(mKeyPopupHintLetter, hintX, hintY, paint);
}
protected static void drawIcon(final Canvas canvas, final Drawable icon, final int x,