Permalink
Browse files

Add TransliterationEngine

  • Loading branch information...
malayaleecoder committed Aug 21, 2016
1 parent c73f487 commit 67ed0f22db47d1524b3f22a42efca622de9e6a87
@@ -194,7 +194,7 @@
android:label="@string/keyboard_name_ml_varnam"
android:imeSubtypeLocale="ml_IN"
android:imeSubtypeMode="keyboard"
android:imeSubtypeExtraValue="KeyboardLayoutSet=qwerty,EmojiCapable" />
android:imeSubtypeExtraValue="KeyboardLayoutSet=qwerty,TransliterationEngine=ml-varnam" />

<!-- Manipuri/Meithei -->
<subtype android:icon="@drawable/ic_ime_switcher_dark"
@@ -126,6 +126,12 @@ private ImeOption() {
*/
public static final String COMBINING_RULES = "CombiningRules";

/**
*The subtype extra value used to indicate that the subtype uses a Trasnliteration
* Engine to do it's work
*/
public static final String TRANSLITERATION_ENGINE = "TransliterationEngine";

private ExtraValue() {
// This utility class is not publicly instantiable.
}
@@ -597,6 +597,16 @@ private boolean checkForTransliteration() {
throw new RuntimeException(e);
}
}
else if(currentSubtype.containsExtraValueKey(Constants.Subtype.ExtraValue.TRANSLITERATION_ENGINE)) {
try {
String transliterationEngine = currentSubtype.getExtraValueOf(Constants.Subtype.ExtraValue.TRANSLITERATION_ENGINE);
mInputLogic.enableTransliterationByEngine(transliterationEngine, getApplicationContext());
return true;
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
mInputLogic.disableTransliteration();
return false;
}
@@ -2308,6 +2308,17 @@ public void enableTransliteration(String transliterationMethod, Context context)
}
}

public void enableTransliterationByEngine(String transliterationEngine, Context context) {
InputMethod im;
try {

isTransliteration = true;
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}

public void disableTransliteration() {
mWordComposer.setTransliterationMethod(null);
mConnection.setTransliterationMethod(null);

0 comments on commit 67ed0f2

Please sign in to comment.