Revise language string size on spacebar

bug: 3290290
Change-Id: I09694392d7fa447796c56a1f74b5b719ca28e466
main
Ken Wakasa 2010-12-16 16:52:00 +09:00
parent dcfbab91e6
commit 183fbbb0db
4 changed files with 59 additions and 20 deletions

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2010, 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>
<string name="config_text_size_of_language_on_spacebar">medium</string>
</resources>

View File

@ -32,6 +32,7 @@
<integer name="config_long_press_key_timeout">400</integer>
<integer name="config_long_press_shift_key_timeout">1200</integer>
<integer name="config_multi_tap_key_timeout">800</integer>
<string name="config_text_size_of_language_on_spacebar">small</string>
<string-array name="auto_correction_threshold_values">
<!-- Off, When auto correction setting is Off, this value is not used. -->
<item></item>

View File

@ -153,8 +153,7 @@
<!-- Short message shown when the server couldn't parse any speech. -->
<string name="voice_no_match">No matches found</string>
<!-- Short message shown when the user initiates voice and voice
search is not installed. -->
<!-- Short message shown when the user initiates voice and voice search is not installed. -->
<string name="voice_not_installed">Voice search not installed</string>
<!-- Short hint shown in candidate view to explain voice input. -->
@ -210,10 +209,10 @@
<string name="subtype_mode_cs_keyboard">Czech Keyboard</string>
<string name="subtype_mode_da_keyboard">Danish Keyboard</string>
<string name="subtype_mode_de_keyboard">German Keyboard</string>
<string name="subtype_mode_en_GB_keyboard">English (United Kingdom) Keyboard</string>
<string name="subtype_mode_en_US_keyboard">English (United States) Keyboard</string>
<string name="subtype_mode_en_GB_keyboard">English (UK) Keyboard</string>
<string name="subtype_mode_en_US_keyboard">English (US) Keyboard</string>
<string name="subtype_mode_es_keyboard">Spanish Keyboard</string>
<string name="subtype_mode_es_US_keyboard">Spanish (United States) Keyboard</string>
<string name="subtype_mode_es_US_keyboard">Spanish (US) Keyboard</string>
<string name="subtype_mode_fr_keyboard">French Keyboard</string>
<string name="subtype_mode_fr_CA_keyboard">French (Canada) Keyboard</string>
<string name="subtype_mode_fr_CH_keyboard">French (Switzerland) Keyboard</string>
@ -227,10 +226,10 @@
<string name="subtype_mode_cs_voice">Czech Voice</string>
<string name="subtype_mode_de_voice">German Voice</string>
<string name="subtype_mode_en_AU_voice">English (Australia) Voice</string>
<string name="subtype_mode_en_GB_voice">English (United Kingdom) Voice</string>
<string name="subtype_mode_en_GB_voice">English (UK) Voice</string>
<string name="subtype_mode_en_IN_voice">English (India) Voice</string>
<string name="subtype_mode_en_NZ_voice">English (New Zealand) Voice</string>
<string name="subtype_mode_en_US_voice">English (United States) Voice</string>
<string name="subtype_mode_en_US_voice">English (US) Voice</string>
<string name="subtype_mode_es_voice">Spanish Voice</string>
<string name="subtype_mode_fr_voice">French Voice</string>
<string name="subtype_mode_ja_voice">Japanese Voice</string>
@ -239,8 +238,8 @@
<string name="subtype_mode_pt_voice">Portuguese Voice</string>
<string name="subtype_mode_ru_voice">Russian Voice</string>
<string name="subtype_mode_tr_voice">Turkish Voice</string>
<string name="subtype_mode_zh_CN_voice">Chinese (China) Voice</string>
<string name="subtype_mode_zh_TW_voice">Chinese (Taiwan) Voice</string>
<string name="subtype_mode_zh_CN_voice">Chinese (China, Simplified) Voice</string>
<string name="subtype_mode_zh_TW_voice">Chinese (Taiwan, Traditional) Voice</string>
<!-- Title of an option for usability study mode -->
<string name="prefs_usability_study_mode">Usability Study Mode</string>

View File

@ -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