am 67bb9d83: am 3a729d4e: [SD12] Add the last remaining scripts

* commit '67bb9d83ae1e838f6c13d4afe19db3068edafb9b':
  [SD12] Add the last remaining scripts
main
Jean Chalard 2014-07-30 17:11:39 +00:00 committed by Android Git Automerger
commit e715a02f4f
11 changed files with 45 additions and 2 deletions

View File

@ -494,6 +494,11 @@
<enum name="sinhala" value="10" />
<enum name="thai" value="11" />
<enum name="telugu" value="12" />
<enum name="devanagari" value="13" />
<enum name="bengali" value="14" />
<enum name="tamil" value="15" />
<enum name="kannada" value="16" />
<enum name="malayalam" value="17" />
</attr>
</declare-styleable>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -39,6 +39,11 @@ public class ScriptUtils {
public static final int SCRIPT_SINHALA = 10;
public static final int SCRIPT_THAI = 11;
public static final int SCRIPT_TELUGU = 12;
public static final int SCRIPT_DEVANAGARI = 13;
public static final int SCRIPT_BENGALI = 14;
public static final int SCRIPT_TAMIL = 15;
public static final int SCRIPT_KANNADA = 16;
public static final int SCRIPT_MALAYALAM = 17;
public static final TreeMap<String, Integer> mSpellCheckerLanguageToScript;
static {
// List of the supported languages and their associated script. We won't check
@ -102,12 +107,12 @@ public class ScriptUtils {
case SCRIPT_ARABIC:
// Arabic letters can be in any of the following blocks:
// Arabic U+0600..U+06FF
// Arabic Supplement U+0750..U+077F
// Arabic Supplement, Thaana U+0750..U+077F, U+0780..U+07BF
// Arabic Extended-A U+08A0..U+08FF
// Arabic Presentation Forms-A U+FB50..U+FDFF
// Arabic Presentation Forms-B U+FE70..U+FEFF
return (codePoint >= 0x600 && codePoint <= 0x6FF)
|| (codePoint >= 0x750 && codePoint <= 0x77F)
|| (codePoint >= 0x750 && codePoint <= 0x7BF)
|| (codePoint >= 0x8A0 && codePoint <= 0x8FF)
|| (codePoint >= 0xFB50 && codePoint <= 0xFDFF)
|| (codePoint >= 0xFE70 && codePoint <= 0xFEFF);
@ -153,6 +158,21 @@ public class ScriptUtils {
case SCRIPT_TELUGU:
// Telugu unicode block is U+0C00..U+0C7F
return (codePoint >= 0xC00 && codePoint <= 0xC7F);
case SCRIPT_DEVANAGARI:
// Devanagari unicode block is +0900..U+097F
return (codePoint >= 0x900 && codePoint <= 0x97F);
case SCRIPT_BENGALI:
// Bengali unicode block is U+0980..U+09FF
return (codePoint >= 0x980 && codePoint <= 0x9FF);
case SCRIPT_TAMIL:
// Tamil unicode block is U+0B80..U+0BFF
return (codePoint >= 0xB80 && codePoint <= 0xBFF);
case SCRIPT_KANNADA:
// Kannada unicode block is U+0C80..U+0CFF
return (codePoint >= 0xC80 && codePoint <= 0xCFF);
case SCRIPT_MALAYALAM:
// Malayalam unicode block is U+0D00..U+0D7F
return (codePoint >= 0xD00 && codePoint <= 0xD7F);
case SCRIPT_UNKNOWN:
return true;
default: