Skip to content

Commit 6bf3b12

Browse files
authored
Merge pull request #83 from Naveen3Singh/add_languages
Add requested languages
2 parents 9431499 + ca0b0af commit 6bf3b12

File tree

9 files changed

+644
-17
lines changed

9 files changed

+644
-17
lines changed

app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ if (keystorePropertiesFile.exists()) {
1010
}
1111

1212
android {
13-
compileSdk 31
13+
compileSdk 33
1414

1515
defaultConfig {
1616
applicationId "com.simplemobiletools.keyboard"
1717
minSdk 23
18-
targetSdk 31
18+
targetSdk 33
1919
versionCode 11
2020
versionName "5.2.1"
2121
multiDexEnabled true
@@ -65,8 +65,8 @@ android {
6565
}
6666

6767
dependencies {
68-
implementation 'com.github.SimpleMobileTools:Simple-Commons:0c82e5f216'
69-
implementation 'androidx.emoji2:emoji2-bundled:1.1.0'
68+
implementation 'com.github.SimpleMobileTools:Simple-Commons:dfcf3990b0'
69+
implementation 'androidx.emoji2:emoji2-bundled:1.2.0'
7070

7171
kapt 'androidx.room:room-compiler:2.4.3'
7272
implementation 'androidx.room:room-runtime:2.4.3'

app/src/main/kotlin/com/simplemobiletools/keyboard/activities/SettingsActivity.kt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,19 @@ class SettingsActivity : SimpleActivity() {
107107
settings_keyboard_language.text = getKeyboardLanguageText(config.keyboardLanguage)
108108
settings_keyboard_language_holder.setOnClickListener {
109109
val items = arrayListOf(
110+
RadioItem(LANGUAGE_BENGALI, getKeyboardLanguageText(LANGUAGE_BENGALI)),
111+
RadioItem(LANGUAGE_BULGARIAN, getKeyboardLanguageText(LANGUAGE_BULGARIAN)),
110112
RadioItem(LANGUAGE_ENGLISH_QWERTY, getKeyboardLanguageText(LANGUAGE_ENGLISH_QWERTY)),
111113
RadioItem(LANGUAGE_ENGLISH_QWERTZ, getKeyboardLanguageText(LANGUAGE_ENGLISH_QWERTZ)),
112114
RadioItem(LANGUAGE_ENGLISH_DVORAK, getKeyboardLanguageText(LANGUAGE_ENGLISH_DVORAK)),
113115
RadioItem(LANGUAGE_FRENCH, getKeyboardLanguageText(LANGUAGE_FRENCH)),
114116
RadioItem(LANGUAGE_GERMAN, getKeyboardLanguageText(LANGUAGE_GERMAN)),
117+
RadioItem(LANGUAGE_LITHUANIAN, getKeyboardLanguageText(LANGUAGE_LITHUANIAN)),
115118
RadioItem(LANGUAGE_ROMANIAN, getKeyboardLanguageText(LANGUAGE_ROMANIAN)),
116119
RadioItem(LANGUAGE_RUSSIAN, getKeyboardLanguageText(LANGUAGE_RUSSIAN)),
117120
RadioItem(LANGUAGE_SLOVENIAN, getKeyboardLanguageText(LANGUAGE_SLOVENIAN)),
118-
RadioItem(LANGUAGE_SPANISH, getKeyboardLanguageText(LANGUAGE_SPANISH))
121+
RadioItem(LANGUAGE_SPANISH, getKeyboardLanguageText(LANGUAGE_SPANISH)),
122+
RadioItem(LANGUAGE_TURKISH_Q, getKeyboardLanguageText(LANGUAGE_TURKISH_Q)),
119123
)
120124

121125
RadioGroupDialog(this@SettingsActivity, items, config.keyboardLanguage) {
@@ -127,14 +131,18 @@ class SettingsActivity : SimpleActivity() {
127131

128132
private fun getKeyboardLanguageText(language: Int): String {
129133
return when (language) {
134+
LANGUAGE_BENGALI -> getString(R.string.translation_bengali)
135+
LANGUAGE_BULGARIAN -> getString(R.string.translation_bulgarian)
136+
LANGUAGE_ENGLISH_DVORAK -> "${getString(R.string.translation_english)} (DVORAK)"
137+
LANGUAGE_ENGLISH_QWERTZ -> "${getString(R.string.translation_english)} (QWERTZ)"
130138
LANGUAGE_FRENCH -> getString(R.string.translation_french)
131139
LANGUAGE_GERMAN -> getString(R.string.translation_german)
140+
LANGUAGE_LITHUANIAN -> getString(R.string.translation_lithuanian)
141+
LANGUAGE_ROMANIAN -> getString(R.string.translation_romanian)
132142
LANGUAGE_RUSSIAN -> getString(R.string.translation_russian)
133-
LANGUAGE_ENGLISH_QWERTZ -> "${getString(R.string.translation_english)} (QWERTZ)"
134-
LANGUAGE_ENGLISH_DVORAK -> "${getString(R.string.translation_english)} (DVORAK)"
135-
LANGUAGE_SPANISH -> getString(R.string.translation_spanish)
136143
LANGUAGE_SLOVENIAN -> getString(R.string.translation_slovenian)
137-
LANGUAGE_ROMANIAN -> getString(R.string.translation_romanian)
144+
LANGUAGE_SPANISH -> getString(R.string.translation_spanish)
145+
LANGUAGE_TURKISH_Q -> "${getString(R.string.translation_turkish)} (Q)"
138146
else -> "${getString(R.string.translation_english)} (QWERTY)"
139147
}
140148
}

app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/Constants.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ const val LANGUAGE_GERMAN = 5
2727
const val LANGUAGE_ENGLISH_DVORAK = 6
2828
const val LANGUAGE_ROMANIAN = 7
2929
const val LANGUAGE_SLOVENIAN = 8
30+
const val LANGUAGE_BULGARIAN = 9
31+
const val LANGUAGE_TURKISH_Q = 10
32+
const val LANGUAGE_LITHUANIAN = 11
33+
const val LANGUAGE_BENGALI = 12
3034

3135
// keyboard height multiplier options
3236
const val KEYBOARD_HEIGHT_MULTIPLIER_SMALL = 1

app/src/main/kotlin/com/simplemobiletools/keyboard/services/SimpleKeyboardIME.kt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,18 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL
249249

250250
private fun getKeyboardLayoutXML(): Int {
251251
return when (baseContext.config.keyboardLanguage) {
252-
LANGUAGE_FRENCH -> R.xml.keys_letters_french
253-
LANGUAGE_RUSSIAN -> R.xml.keys_letters_russian
254-
LANGUAGE_ENGLISH_QWERTZ -> R.xml.keys_letters_english_qwertz
252+
LANGUAGE_BENGALI -> R.xml.keys_letters_bengali
253+
LANGUAGE_BULGARIAN -> R.xml.keys_letters_bulgarian
255254
LANGUAGE_ENGLISH_DVORAK -> R.xml.keys_letters_english_dvorak
256-
LANGUAGE_SPANISH -> R.xml.keys_letters_spanish_qwerty
255+
LANGUAGE_ENGLISH_QWERTZ -> R.xml.keys_letters_english_qwertz
256+
LANGUAGE_FRENCH -> R.xml.keys_letters_french
257257
LANGUAGE_GERMAN -> R.xml.keys_letters_german
258-
LANGUAGE_SLOVENIAN -> R.xml.keys_letters_slovenian
258+
LANGUAGE_LITHUANIAN -> R.xml.keys_letters_lithuanian
259259
LANGUAGE_ROMANIAN -> R.xml.keys_letters_romanian
260+
LANGUAGE_RUSSIAN -> R.xml.keys_letters_russian
261+
LANGUAGE_SLOVENIAN -> R.xml.keys_letters_slovenian
262+
LANGUAGE_SPANISH -> R.xml.keys_letters_spanish_qwerty
263+
LANGUAGE_TURKISH_Q -> R.xml.keys_letters_turkish_q
260264
else -> R.xml.keys_letters_english_qwerty
261265
}
262266
}

app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,10 +1465,10 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
14651465
}
14661466

14671467
private fun setupEmojiAdapter(emojis: List<String>) {
1468-
val emojiItemWidth = context.resources.getDimensionPixelSize(R.dimen.emoji_item_size)
1469-
val emojiTopBarElevation = context.resources.getDimensionPixelSize(R.dimen.emoji_top_bar_elevation).toFloat()
1470-
14711468
mEmojiPaletteHolder?.emojis_list?.apply {
1469+
val emojiItemWidth = context.resources.getDimensionPixelSize(R.dimen.emoji_item_size)
1470+
val emojiTopBarElevation = context.resources.getDimensionPixelSize(R.dimen.emoji_top_bar_elevation).toFloat()
1471+
14721472
layoutManager = AutoGridLayoutManager(context, emojiItemWidth)
14731473
adapter = EmojisAdapter(context = context, items = emojis) { emoji ->
14741474
mOnKeyboardActionListener!!.onText(emoji)
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Keyboard xmlns:app="http://schemas.android.com/apk/res-auto">
3+
<Row app:keyWidth="9.091%p">
4+
<Key
5+
app:keyEdgeFlags="left"
6+
app:keyLabel=""
7+
app:popupCharacters="ৌ১1"
8+
app:popupKeyboard="@xml/keyboard_popup_template"
9+
app:topSmallNumber="" />
10+
<Key
11+
app:keyLabel=""
12+
app:popupCharacters="ৈ২2"
13+
app:popupKeyboard="@xml/keyboard_popup_template"
14+
app:topSmallNumber="" />
15+
<Key
16+
app:keyLabel=""
17+
app:popupCharacters="া৩3"
18+
app:popupKeyboard="@xml/keyboard_popup_template"
19+
app:topSmallNumber="" />
20+
<Key
21+
app:keyLabel=""
22+
app:popupCharacters="ী৪4"
23+
app:popupKeyboard="@xml/keyboard_popup_template"
24+
app:topSmallNumber="" />
25+
<Key
26+
app:keyLabel=""
27+
app:popupCharacters="ূ৫5"
28+
app:popupKeyboard="@xml/keyboard_popup_template"
29+
app:topSmallNumber="" />
30+
<Key
31+
app:keyLabel=""
32+
app:popupCharacters="৬ভ6"
33+
app:popupKeyboard="@xml/keyboard_popup_template"
34+
app:topSmallNumber="" />
35+
<Key
36+
app:keyLabel=""
37+
app:popupCharacters="৭7"
38+
app:popupKeyboard="@xml/keyboard_popup_template"
39+
app:topSmallNumber="" />
40+
<Key
41+
app:keyLabel=""
42+
app:popupCharacters="৮ঘ8"
43+
app:popupKeyboard="@xml/keyboard_popup_template"
44+
app:topSmallNumber="" />
45+
<Key
46+
app:keyLabel=""
47+
app:popupCharacters="৯ধ9"
48+
app:popupKeyboard="@xml/keyboard_popup_template"
49+
app:topSmallNumber="" />
50+
<Key
51+
app:keyLabel=""
52+
app:popupCharacters="০ঝজ্ঞ0"
53+
app:popupKeyboard="@xml/keyboard_popup_template"
54+
app:topSmallNumber="" />
55+
<Key
56+
app:keyEdgeFlags="right"
57+
app:keyLabel=""
58+
app:popupCharacters="ড়"
59+
app:popupKeyboard="@xml/keyboard_popup_template" />
60+
</Row>
61+
<Row app:keyWidth="9.091%p">
62+
<Key
63+
app:keyEdgeFlags="left"
64+
app:keyLabel=""
65+
app:popupCharacters=""
66+
app:popupKeyboard="@xml/keyboard_popup_template" />
67+
<Key
68+
app:keyLabel=""
69+
app:popupCharacters=""
70+
app:popupKeyboard="@xml/keyboard_popup_template" />
71+
<Key
72+
app:keyLabel=""
73+
app:popupCharacters=""
74+
app:popupKeyboard="@xml/keyboard_popup_template" />
75+
<Key
76+
app:keyLabel=""
77+
app:popupCharacters="ি"
78+
app:popupKeyboard="@xml/keyboard_popup_template" />
79+
<Key
80+
app:keyLabel=""
81+
app:popupCharacters=""
82+
app:popupKeyboard="@xml/keyboard_popup_template" />
83+
<Key
84+
app:keyLabel=""
85+
app:popupCharacters=""
86+
app:popupKeyboard="@xml/keyboard_popup_template" />
87+
<Key
88+
app:keyLabel=""
89+
app:popupCharacters="ৃঋত্র"
90+
app:popupKeyboard="@xml/keyboard_popup_template" />
91+
<Key
92+
app:keyLabel=""
93+
app:popupCharacters=""
94+
app:popupKeyboard="@xml/keyboard_popup_template" />
95+
<Key
96+
app:keyLabel=""
97+
app:popupCharacters="ৎথত্ত"
98+
app:popupKeyboard="@xml/keyboard_popup_template" />
99+
<Key
100+
app:keyLabel=""
101+
app:popupCharacters=""
102+
app:popupKeyboard="@xml/keyboard_popup_template" />
103+
<Key
104+
app:keyEdgeFlags="right"
105+
app:keyLabel=""
106+
app:popupCharacters=""
107+
app:popupKeyboard="@xml/keyboard_popup_template" />
108+
</Row>
109+
<Row app:keyWidth="8.5%p">
110+
<Key
111+
app:keyEdgeFlags="left"
112+
app:keyLabel=""
113+
app:popupCharacters="ঃং"
114+
app:popupKeyboard="@xml/keyboard_popup_template" />
115+
<Key
116+
app:keyLabel=""
117+
app:popupCharacters="ঢ়"
118+
app:popupKeyboard="@xml/keyboard_popup_template" />
119+
<Key app:keyLabel="" />
120+
<Key
121+
app:keyLabel=""
122+
app:popupCharacters=""
123+
app:popupKeyboard="@xml/keyboard_popup_template" />
124+
<Key
125+
app:keyLabel=""
126+
app:popupCharacters="ঙঞ্জ"
127+
app:popupKeyboard="@xml/keyboard_popup_template" />
128+
<Key app:keyLabel="" />
129+
<Key
130+
app:keyLabel=""
131+
app:popupCharacters="ক্ষ"
132+
app:popupKeyboard="@xml/keyboard_popup_template" />
133+
<Key
134+
app:keyLabel=""
135+
app:popupCharacters=""
136+
app:popupKeyboard="@xml/keyboard_popup_template" />
137+
<Key
138+
app:keyLabel=""
139+
app:popupCharacters=""
140+
app:popupKeyboard="@xml/keyboard_popup_template" />
141+
<Key
142+
app:keyLabel=""
143+
app:popupCharacters=""
144+
app:popupKeyboard="@xml/keyboard_popup_template" />
145+
<Key
146+
app:code="-5"
147+
app:isRepeatable="true"
148+
app:keyEdgeFlags="right"
149+
app:keyIcon="@drawable/ic_clear_vector"
150+
app:keyWidth="15%p" />
151+
</Row>
152+
<Row>
153+
<Key
154+
app:code="-2"
155+
app:keyEdgeFlags="left"
156+
app:keyLabel="123"
157+
app:keyWidth="15%p" />
158+
<Key
159+
app:keyLabel=","
160+
app:keyWidth="10%p" />
161+
<Key
162+
app:code="-6"
163+
app:keyEdgeFlags="left"
164+
app:keyIcon="@drawable/ic_emoji_emotions_outline_vector"
165+
app:keyWidth="8%p" />
166+
<Key
167+
app:code="32"
168+
app:isRepeatable="true"
169+
app:keyWidth="40%p" />
170+
<Key
171+
app:keyLabel="."
172+
app:keyWidth="10%p" />
173+
<Key
174+
app:code="-4"
175+
app:keyEdgeFlags="right"
176+
app:keyIcon="@drawable/ic_enter_vector"
177+
app:keyWidth="15%p" />
178+
</Row>
179+
</Keyboard>

0 commit comments

Comments
 (0)