summaryrefslogtreecommitdiff
path: root/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2012-04-05 14:59:55 +0900
committerTadashi G. Takaoka <takaoka@google.com>2012-04-11 11:23:47 +0900
commit2be51f4fd0c5cd70c7a2757558ffe45e703700cf (patch)
tree8f4d038afe8ecb55a1dc934e5f7cef2228a0d371 /java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java
parent7be6ce0fd7f87d0e8e53fbbbb872d8a88a9bb32c (diff)
Generate KeyboardLabelsSet from donottranslate-more-keys.xml
This change introduces makelabel tool that reads all languages' donottranslate-more-keys and generate KeyboardLabelsSet.java source file. The makelabel command must be invoked prior to compile LatinIME. Change-Id: I7515c7919c535e30f9c80a37bdc831d0f682cd43
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java b/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java
index 51cd90549..c8ec3a4dd 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java
@@ -65,9 +65,7 @@ public class KeyboardLayoutSet {
private static final String DEFAULT_KEYBOARD_LAYOUT_SET = "qwerty";
private static final char KEYBOARD_LAYOUT_SET_LOCALE_DELIMITER = ':';
- private static final String KEYBOARD_LAYOUT_SET_RESOURCE_PREFIX = "xml/keyboard_layout_set_";
- private static final int DEFAULT_KEYBOARD_LAYOUT_SET_RESOURCE_ID =
- R.xml.keyboard_layout_set_qwerty;
+ private static final String KEYBOARD_LAYOUT_SET_RESOURCE_PREFIX = "keyboard_layout_set_";
private final Context mContext;
private final Params mParams;
@@ -319,9 +317,10 @@ public class KeyboardLayoutSet {
throw new RuntimeException("Screen geometry is not specified");
if (mParams.mLocale == null)
throw new RuntimeException("KeyboardLayoutSet subtype is not specified");
+ final String packageName = mResources.getResourcePackageName(
+ R.xml.keyboard_layout_set_qwerty);
final String keyboardLayoutSetName = mParams.mKeyboardLayoutSetName;
- final int xmlId = KeySpecParser.getResourceId(
- mResources, keyboardLayoutSetName, DEFAULT_KEYBOARD_LAYOUT_SET_RESOURCE_ID);
+ final int xmlId = mResources.getIdentifier(keyboardLayoutSetName, "xml", packageName);
final RunInLocale<Void> job = new RunInLocale<Void>() {
@Override
protected Void job(Resources res) {