am 1d1ba8ec: am 0304c777: Merge "[SD10] Add script checks for Lao and Khmer" into lmp-dev

* commit '1d1ba8ec2c5b1eebb3b3e946c97bc9166f9a155c':
  [SD10] Add script checks for Lao and Khmer
main
Jean Chalard 2014-07-30 17:11:37 +00:00 committed by Android Git Automerger
commit d5228f9c4a
4 changed files with 16 additions and 0 deletions

View File

@ -488,6 +488,8 @@
<enum name="hebrew" value="4" /> <enum name="hebrew" value="4" />
<enum name="armenian" value="5" /> <enum name="armenian" value="5" />
<enum name="georgian" value="6" /> <enum name="georgian" value="6" />
<enum name="khmer" value="7" />
<enum name="lao" value="8" />
</attr> </attr>
</declare-styleable> </declare-styleable>

View File

@ -20,6 +20,8 @@
<KeyboardLayoutSet <KeyboardLayoutSet
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"> xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
<Feature
latin:supportedScript="khmer" />
<Element <Element
latin:elementName="alphabet" latin:elementName="alphabet"
latin:elementKeyboard="@xml/kbd_khmer" latin:elementKeyboard="@xml/kbd_khmer"

View File

@ -20,6 +20,8 @@
<KeyboardLayoutSet <KeyboardLayoutSet
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"> xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin">
<Feature
latin:supportedScript="lao" />
<Element <Element
latin:elementName="alphabet" latin:elementName="alphabet"
latin:elementKeyboard="@xml/kbd_lao" latin:elementKeyboard="@xml/kbd_lao"

View File

@ -33,6 +33,8 @@ public class ScriptUtils {
public static final int SCRIPT_HEBREW = 4; public static final int SCRIPT_HEBREW = 4;
public static final int SCRIPT_ARMENIAN = 5; public static final int SCRIPT_ARMENIAN = 5;
public static final int SCRIPT_GEORGIAN = 6; public static final int SCRIPT_GEORGIAN = 6;
public static final int SCRIPT_KHMER = 7;
public static final int SCRIPT_LAO = 8;
public static final TreeMap<String, Integer> mSpellCheckerLanguageToScript; public static final TreeMap<String, Integer> mSpellCheckerLanguageToScript;
static { static {
// List of the supported languages and their associated script. We won't check // List of the supported languages and their associated script. We won't check
@ -122,6 +124,14 @@ public class ScriptUtils {
// or Georgian supplement block, U+2D00..U+2D2F // or Georgian supplement block, U+2D00..U+2D2F
return (codePoint >= 0x10A0 && codePoint <= 0x10FF return (codePoint >= 0x10A0 && codePoint <= 0x10FF
|| codePoint >= 0x2D00 && codePoint <= 0x2D2F); || codePoint >= 0x2D00 && codePoint <= 0x2D2F);
case SCRIPT_KHMER:
// Khmer letters are in unicode block U+1780..U+17FF, and the Khmer symbols block
// is U+19E0..U+19FF
return (codePoint >= 0x1780 && codePoint <= 0x17FF
|| codePoint >= 0x19E0 && codePoint <= 0x19FF);
case SCRIPT_LAO:
// The Lao block is U+0E80..U+0EFF
return (codePoint >= 0xE80 && codePoint <= 0xEFF);
case SCRIPT_UNKNOWN: case SCRIPT_UNKNOWN:
return true; return true;
default: default: