Add bengali keyboard

This commit is contained in:
Naveen
2022-08-19 15:28:00 +05:30
parent 98469ed788
commit 431ce7050c
4 changed files with 183 additions and 0 deletions

View File

@@ -106,6 +106,7 @@ class SettingsActivity : SimpleActivity() {
settings_keyboard_language.text = getKeyboardLanguageText(config.keyboardLanguage)
settings_keyboard_language_holder.setOnClickListener {
val items = arrayListOf(
RadioItem(LANGUAGE_BENGALI, getKeyboardLanguageText(LANGUAGE_BENGALI)),
RadioItem(LANGUAGE_BULGARIAN, getKeyboardLanguageText(LANGUAGE_BULGARIAN)),
RadioItem(LANGUAGE_ENGLISH_QWERTY, getKeyboardLanguageText(LANGUAGE_ENGLISH_QWERTY)),
RadioItem(LANGUAGE_ENGLISH_QWERTZ, getKeyboardLanguageText(LANGUAGE_ENGLISH_QWERTZ)),
@@ -129,6 +130,7 @@ class SettingsActivity : SimpleActivity() {
private fun getKeyboardLanguageText(language: Int): String {
return when (language) {
LANGUAGE_BENGALI -> getString(R.string.translation_bengali)
LANGUAGE_BULGARIAN -> getString(R.string.translation_bulgarian)
LANGUAGE_ENGLISH_DVORAK -> "${getString(R.string.translation_english)} (DVORAK)"
LANGUAGE_ENGLISH_QWERTZ -> "${getString(R.string.translation_english)} (QWERTZ)"

View File

@@ -29,6 +29,7 @@ const val LANGUAGE_SLOVENIAN = 8
const val LANGUAGE_BULGARIAN = 9
const val LANGUAGE_TURKISH_Q = 10
const val LANGUAGE_LITHUANIAN = 11
const val LANGUAGE_BENGALI = 12
const val EMOJI_SPEC_FILE_PATH = "media/emoji_spec.txt"

View File

@@ -249,6 +249,7 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL
private fun getKeyboardLayoutXML(): Int {
return when (baseContext.config.keyboardLanguage) {
LANGUAGE_BENGALI -> R.xml.keys_letters_bengali
LANGUAGE_BULGARIAN -> R.xml.keys_letters_bulgarian
LANGUAGE_ENGLISH_DVORAK -> R.xml.keys_letters_english_dvorak
LANGUAGE_ENGLISH_QWERTZ -> R.xml.keys_letters_english_qwertz

View File

@@ -0,0 +1,179 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:app="http://schemas.android.com/apk/res-auto">
<Row app:keyWidth="9.091%p">
<Key
app:keyEdgeFlags="left"
app:keyLabel="ঔ"
app:popupCharacters="ৌ১1"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="১" />
<Key
app:keyLabel="ঐ"
app:popupCharacters="ৈ২2"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="২" />
<Key
app:keyLabel="আ"
app:popupCharacters="া৩3"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="৩" />
<Key
app:keyLabel="ঈ"
app:popupCharacters="ী4"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="" />
<Key
app:keyLabel="ঊ"
app:popupCharacters="ূ৫5"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="৫" />
<Key
app:keyLabel="ব"
app:popupCharacters="৬ভ6"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="৬" />
<Key
app:keyLabel="হ"
app:popupCharacters="7"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="" />
<Key
app:keyLabel="গ"
app:popupCharacters="৮ঘ8"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="৮" />
<Key
app:keyLabel="দ"
app:popupCharacters="৯ধ9"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="৯" />
<Key
app:keyLabel="জ"
app:popupCharacters="ঝজ্ঞ0"
app:popupKeyboard="@xml/keyboard_popup_template"
app:topSmallNumber="" />
<Key
app:keyEdgeFlags="right"
app:keyLabel="ড"
app:popupCharacters="ড়"
app:popupKeyboard="@xml/keyboard_popup_template" />
</Row>
<Row app:keyWidth="9.091%p">
<Key
app:keyEdgeFlags="left"
app:keyLabel="ও"
app:popupCharacters="ো"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyLabel="এ"
app:popupCharacters="ে"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyLabel="অ"
app:popupCharacters="্"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyLabel="ই"
app:popupCharacters="ি"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyLabel="উ"
app:popupCharacters="ু"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyLabel="প"
app:popupCharacters="ফ"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyLabel="র"
app:popupCharacters="ৃঋত্র"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyLabel="ক"
app:popupCharacters="খ"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyLabel="ত"
app:popupCharacters="ৎথত্ত"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyLabel="চ"
app:popupCharacters="ছ"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyEdgeFlags="right"
app:keyLabel="ট"
app:popupCharacters="ঠ"
app:popupKeyboard="@xml/keyboard_popup_template" />
</Row>
<Row app:keyWidth="8.5%p">
<Key
app:keyEdgeFlags="left"
app:keyLabel="ঁ"
app:popupCharacters="ঃং"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyLabel="ঢ"
app:popupCharacters="ঢ়"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key app:keyLabel="ম" />
<Key
app:keyLabel="ন"
app:popupCharacters="ণ"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyLabel="ঞ"
app:popupCharacters="ঙঞ্জ"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key app:keyLabel="ল" />
<Key
app:keyLabel="ষ"
app:popupCharacters="ক্ষ"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyLabel="স"
app:popupCharacters="শ"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyLabel="য়"
app:popupCharacters="য"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:keyLabel="।"
app:popupCharacters="॥"
app:popupKeyboard="@xml/keyboard_popup_template" />
<Key
app:code="-5"
app:isRepeatable="true"
app:keyEdgeFlags="right"
app:keyIcon="@drawable/ic_clear_vector"
app:keyWidth="15%p" />
</Row>
<Row>
<Key
app:code="-2"
app:keyEdgeFlags="left"
app:keyLabel="123"
app:keyWidth="15%p" />
<Key
app:keyLabel=","
app:keyWidth="10%p" />
<Key
app:code="-6"
app:keyEdgeFlags="left"
app:keyIcon="@drawable/ic_emoji_emotions_outline_vector"
app:keyWidth="8%p" />
<Key
app:code="32"
app:isRepeatable="true"
app:keyWidth="40%p" />
<Key
app:keyLabel="."
app:keyWidth="10%p" />
<Key
app:code="-4"
app:keyEdgeFlags="right"
app:keyIcon="@drawable/ic_enter_vector"
app:keyWidth="15%p" />
</Row>
</Keyboard>