From 183fbbb0dbf786e10dc3bf17b9377ed6598d4605 Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Thu, 16 Dec 2010 16:52:00 +0900 Subject: Revise language string size on spacebar bug: 3290290 Change-Id: I09694392d7fa447796c56a1f74b5b719ca28e466 --- .../android/inputmethod/keyboard/LatinKeyboard.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java index 0a42857ff..7cae4f1df 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java @@ -75,6 +75,9 @@ public class LatinKeyboard extends Keyboard { private static int sSpacebarVerticalCorrection; + private static final String SMALL_TEXT_SIZE_OF_LANGUAGE_ON_SPACEBAR = "small"; + private static final String MEDIUM_TEXT_SIZE_OF_LANGUAGE_ON_SPACEBAR = "medium"; + public LatinKeyboard(Context context, KeyboardId id) { super(context, id); final Resources res = context.getResources(); @@ -189,10 +192,23 @@ public class LatinKeyboard extends Keyboard { paint.setAntiAlias(true); paint.setTextAlign(Align.CENTER); + final String textSizeOfLanguageOnSpacebar = res.getString( + R.string.config_text_size_of_language_on_spacebar, + SMALL_TEXT_SIZE_OF_LANGUAGE_ON_SPACEBAR); + final int textStyle; + final int defaultTextSize; + if (MEDIUM_TEXT_SIZE_OF_LANGUAGE_ON_SPACEBAR.equals(textSizeOfLanguageOnSpacebar)) { + textStyle = android.R.style.TextAppearance_Medium; + defaultTextSize = 18; + } else { + textStyle = android.R.style.TextAppearance_Small; + defaultTextSize = 14; + } + final boolean allowVariableTextSize = true; final String language = layoutSpaceBar(paint, subtypeSwitcher.getInputLocale(), mButtonArrowLeftIcon, mButtonArrowRightIcon, width, height, - getTextSizeFromTheme(android.R.style.TextAppearance_Small, 14), + getTextSizeFromTheme(textStyle, defaultTextSize), allowVariableTextSize); // Draw language text with shadow -- cgit v1.2.3-83-g751a