Skip to content

Commit 7006bf3

Browse files
authored
Merge pull request #174 from Merkost/scandinavian_language_layouts
Scandinavian language layouts
2 parents 8008f9c + f9cdecd commit 7006bf3

File tree

8 files changed

+663
-16
lines changed

8 files changed

+663
-16
lines changed

app/src/main/kotlin/com/simplemobiletools/keyboard/extensions/Context.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ import android.content.ClipboardManager
44
import android.content.Context
55
import android.graphics.Color
66
import android.os.IBinder
7-
import android.view.LayoutInflater
8-
import android.view.View
9-
import android.view.ViewGroup
10-
import android.view.Window
11-
import android.view.WindowManager
7+
import android.view.*
128
import android.widget.TextView
139
import androidx.appcompat.app.AlertDialog
1410
import androidx.core.content.res.ResourcesCompat
@@ -152,17 +148,20 @@ fun Context.getKeyboardLanguages(): ArrayList<RadioItem> {
152148
return arrayListOf(
153149
RadioItem(LANGUAGE_BENGALI, getKeyboardLanguageText(LANGUAGE_BENGALI)),
154150
RadioItem(LANGUAGE_BULGARIAN, getKeyboardLanguageText(LANGUAGE_BULGARIAN)),
151+
RadioItem(LANGUAGE_DANISH, getKeyboardLanguageText(LANGUAGE_DANISH)),
155152
RadioItem(LANGUAGE_ENGLISH_QWERTY, getKeyboardLanguageText(LANGUAGE_ENGLISH_QWERTY)),
156153
RadioItem(LANGUAGE_ENGLISH_QWERTZ, getKeyboardLanguageText(LANGUAGE_ENGLISH_QWERTZ)),
157154
RadioItem(LANGUAGE_ENGLISH_DVORAK, getKeyboardLanguageText(LANGUAGE_ENGLISH_DVORAK)),
158155
RadioItem(LANGUAGE_FRENCH, getKeyboardLanguageText(LANGUAGE_FRENCH)),
159156
RadioItem(LANGUAGE_GERMAN, getKeyboardLanguageText(LANGUAGE_GERMAN)),
160157
RadioItem(LANGUAGE_GREEK, getKeyboardLanguageText(LANGUAGE_GREEK)),
161158
RadioItem(LANGUAGE_LITHUANIAN, getKeyboardLanguageText(LANGUAGE_LITHUANIAN)),
159+
RadioItem(LANGUAGE_NORWEGIAN, getKeyboardLanguageText(LANGUAGE_NORWEGIAN)),
162160
RadioItem(LANGUAGE_ROMANIAN, getKeyboardLanguageText(LANGUAGE_ROMANIAN)),
163161
RadioItem(LANGUAGE_RUSSIAN, getKeyboardLanguageText(LANGUAGE_RUSSIAN)),
164162
RadioItem(LANGUAGE_SLOVENIAN, getKeyboardLanguageText(LANGUAGE_SLOVENIAN)),
165163
RadioItem(LANGUAGE_SPANISH, getKeyboardLanguageText(LANGUAGE_SPANISH)),
164+
RadioItem(LANGUAGE_SWEDISH, getKeyboardLanguageText(LANGUAGE_SWEDISH)),
166165
RadioItem(LANGUAGE_TURKISH_Q, getKeyboardLanguageText(LANGUAGE_TURKISH_Q)),
167166
)
168167
}
@@ -171,18 +170,22 @@ fun Context.getKeyboardLanguageText(language: Int): String {
171170
return when (language) {
172171
LANGUAGE_BENGALI -> getString(R.string.translation_bengali)
173172
LANGUAGE_BULGARIAN -> getString(R.string.translation_bulgarian)
173+
LANGUAGE_DANISH -> getString(R.string.translation_danish)
174174
LANGUAGE_ENGLISH_DVORAK -> "${getString(R.string.translation_english)} (DVORAK)"
175175
LANGUAGE_ENGLISH_QWERTZ -> "${getString(R.string.translation_english)} (QWERTZ)"
176176
LANGUAGE_FRENCH -> getString(R.string.translation_french)
177177
LANGUAGE_GERMAN -> getString(R.string.translation_german)
178178
LANGUAGE_GREEK -> getString(R.string.translation_greek)
179179
LANGUAGE_LITHUANIAN -> getString(R.string.translation_lithuanian)
180+
LANGUAGE_NORWEGIAN -> getString(R.string.translation_norwegian)
180181
LANGUAGE_ROMANIAN -> getString(R.string.translation_romanian)
181182
LANGUAGE_RUSSIAN -> getString(R.string.translation_russian)
182183
LANGUAGE_SLOVENIAN -> getString(R.string.translation_slovenian)
183184
LANGUAGE_SPANISH -> getString(R.string.translation_spanish)
185+
LANGUAGE_SWEDISH -> getString(R.string.translation_swedish)
184186
LANGUAGE_TURKISH_Q -> "${getString(R.string.translation_turkish)} (Q)"
185187
else -> "${getString(R.string.translation_english)} (QWERTY)"
186188
}
187189
}
188190

191+

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ const val LANGUAGE_TURKISH_Q = 10
8989
const val LANGUAGE_LITHUANIAN = 11
9090
const val LANGUAGE_BENGALI = 12
9191
const val LANGUAGE_GREEK = 13
92+
const val LANGUAGE_NORWEGIAN = 14
93+
const val LANGUAGE_SWEDISH = 15
94+
const val LANGUAGE_DANISH = 16
9295

9396
// keyboard height multiplier options
9497
const val KEYBOARD_HEIGHT_MULTIPLIER_SMALL = 1

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,15 +298,18 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL
298298
return when (baseContext.config.keyboardLanguage) {
299299
LANGUAGE_BENGALI -> R.xml.keys_letters_bengali
300300
LANGUAGE_BULGARIAN -> R.xml.keys_letters_bulgarian
301+
LANGUAGE_DANISH -> R.xml.keys_letters_danish
301302
LANGUAGE_ENGLISH_DVORAK -> R.xml.keys_letters_english_dvorak
302303
LANGUAGE_ENGLISH_QWERTZ -> R.xml.keys_letters_english_qwertz
303304
LANGUAGE_FRENCH -> R.xml.keys_letters_french
304305
LANGUAGE_GERMAN -> R.xml.keys_letters_german
305306
LANGUAGE_GREEK -> R.xml.keys_letters_greek
306307
LANGUAGE_LITHUANIAN -> R.xml.keys_letters_lithuanian
308+
LANGUAGE_NORWEGIAN -> R.xml.keys_letters_norwegian
307309
LANGUAGE_ROMANIAN -> R.xml.keys_letters_romanian
308310
LANGUAGE_RUSSIAN -> R.xml.keys_letters_russian
309311
LANGUAGE_SLOVENIAN -> R.xml.keys_letters_slovenian
312+
LANGUAGE_SWEDISH -> R.xml.keys_letters_swedish
310313
LANGUAGE_SPANISH -> R.xml.keys_letters_spanish_qwerty
311314
LANGUAGE_TURKISH_Q -> R.xml.keys_letters_turkish_q
312315
else -> R.xml.keys_letters_english_qwerty
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Keyboard xmlns:app="http://schemas.android.com/apk/res-auto">
3+
<Row app:isNumbersRow="true">
4+
<Key
5+
app:keyEdgeFlags="left"
6+
app:keyLabel="1"
7+
app:topSmallNumber="1" />
8+
<Key
9+
app:keyLabel="2"
10+
app:topSmallNumber="2" />
11+
<Key
12+
app:keyLabel="3"
13+
app:topSmallNumber="3" />
14+
<Key
15+
app:keyLabel="4"
16+
app:topSmallNumber="4" />
17+
<Key
18+
app:keyLabel="5"
19+
app:topSmallNumber="5" />
20+
<Key
21+
app:keyLabel="6"
22+
app:topSmallNumber="6" />
23+
<Key
24+
app:keyLabel="7"
25+
app:topSmallNumber="7" />
26+
<Key
27+
app:keyLabel="8"
28+
app:topSmallNumber="8" />
29+
<Key
30+
app:keyLabel="9"
31+
app:topSmallNumber="9" />
32+
<Key
33+
app:keyEdgeFlags="right"
34+
app:keyLabel="0"
35+
app:topSmallNumber="0" />
36+
</Row>
37+
<Row>
38+
<Key
39+
app:keyEdgeFlags="left"
40+
app:keyLabel="q"
41+
app:keyWidth="9.05%p"
42+
app:popupCharacters="1"
43+
app:popupKeyboard="@xml/keyboard_popup_template"
44+
app:topSmallNumber="1" />
45+
<Key
46+
app:keyLabel="w"
47+
app:keyWidth="9.05%p"
48+
app:popupCharacters="2"
49+
app:popupKeyboard="@xml/keyboard_popup_template"
50+
app:topSmallNumber="2" />
51+
<Key
52+
app:keyLabel="e"
53+
app:keyWidth="9.05%p"
54+
app:popupCharacters="éè3êëēę"
55+
app:popupKeyboard="@xml/keyboard_popup_template"
56+
app:topSmallNumber="3" />
57+
<Key
58+
app:keyLabel="r"
59+
app:keyWidth="9.05%p"
60+
app:popupCharacters="ř4ŕ"
61+
app:popupKeyboard="@xml/keyboard_popup_template"
62+
app:topSmallNumber="4" />
63+
<Key
64+
app:keyLabel="t"
65+
app:keyWidth="9.05%p"
66+
app:popupCharacters=""
67+
app:popupKeyboard="@xml/keyboard_popup_template"
68+
app:topSmallNumber="5" />
69+
<Key
70+
app:keyLabel="y"
71+
app:keyWidth="9.05%p"
72+
app:popupCharacters="ý6ÿ¥"
73+
app:popupKeyboard="@xml/keyboard_popup_template"
74+
app:topSmallNumber="6" />
75+
<Key
76+
app:keyLabel="u"
77+
app:keyWidth="9.05%p"
78+
app:popupCharacters="űúù7ûüū"
79+
app:popupKeyboard="@xml/keyboard_popup_template"
80+
app:topSmallNumber="7" />
81+
<Key
82+
app:keyLabel="i"
83+
app:keyWidth="9.05%p"
84+
app:popupCharacters="íì8îïī"
85+
app:popupKeyboard="@xml/keyboard_popup_template"
86+
app:topSmallNumber="8" />
87+
<Key
88+
app:keyLabel="o"
89+
app:keyWidth="9.05%p"
90+
app:popupCharacters="őöøóôò9õō"
91+
app:popupKeyboard="@xml/keyboard_popup_template"
92+
app:topSmallNumber="9" />
93+
<Key
94+
app:keyLabel="p"
95+
app:keyWidth="9.05%p"
96+
app:popupCharacters="0"
97+
app:popupKeyboard="@xml/keyboard_popup_template"
98+
app:topSmallNumber="0" />
99+
<Key
100+
app:keyEdgeFlags="right"
101+
app:keyLabel="å"
102+
app:keyWidth="9.05%p" />
103+
</Row>
104+
<Row>
105+
<Key
106+
app:keyEdgeFlags="left"
107+
app:keyLabel="a"
108+
app:keyWidth="9.05%p"
109+
app:popupCharacters="áàâãäåāæą"
110+
app:popupKeyboard="@xml/keyboard_popup_template" />
111+
<Key
112+
app:keyLabel="s"
113+
app:keyWidth="9.05%p"
114+
app:popupCharacters="śßš"
115+
app:popupKeyboard="@xml/keyboard_popup_template" />
116+
<Key
117+
app:keyLabel="d"
118+
app:keyWidth="9.05%p"
119+
app:popupCharacters="ďđ"
120+
app:popupKeyboard="@xml/keyboard_popup_template" />
121+
<Key
122+
app:keyLabel="f"
123+
app:keyWidth="9.05%p"
124+
app:popupCharacters=""
125+
app:popupKeyboard="@xml/keyboard_popup_template" />
126+
<Key
127+
app:keyLabel="g"
128+
app:keyWidth="9.05%p" />
129+
<Key
130+
app:keyLabel="h"
131+
app:keyWidth="9.05%p" />
132+
<Key
133+
app:keyLabel="j"
134+
app:keyWidth="9.05%p" />
135+
<Key app:keyLabel="k" />
136+
<Key
137+
app:keyLabel="l"
138+
app:keyWidth="9.05%p"
139+
app:popupCharacters="ĺľł"
140+
app:popupKeyboard="@xml/keyboard_popup_template" />
141+
<Key
142+
app:keyLabel="æ"
143+
app:keyWidth="9.05%p"
144+
app:popupCharacters="ä"
145+
app:popupKeyboard="@xml/keyboard_popup_template" />
146+
<Key
147+
app:keyEdgeFlags="right"
148+
app:keyLabel="ø"
149+
app:keyWidth="9.05%p"
150+
app:popupCharacters="ö"
151+
app:popupKeyboard="@xml/keyboard_popup_template" />
152+
153+
</Row>
154+
<Row>
155+
<Key
156+
app:code="-1"
157+
app:keyEdgeFlags="left"
158+
app:keyIcon="@drawable/ic_caps_outline_vector"
159+
app:keyWidth="15%p" />
160+
<Key
161+
app:keyLabel="z"
162+
app:popupCharacters="źžż"
163+
app:popupKeyboard="@xml/keyboard_popup_template" />
164+
<Key app:keyLabel="x" />
165+
<Key
166+
app:keyLabel="c"
167+
app:popupCharacters="çčć¢"
168+
app:popupKeyboard="@xml/keyboard_popup_template" />
169+
<Key app:keyLabel="v" />
170+
<Key app:keyLabel="b" />
171+
<Key
172+
app:keyLabel="n"
173+
app:popupCharacters="ňńñ"
174+
app:popupKeyboard="@xml/keyboard_popup_template" />
175+
<Key app:keyLabel="m" />
176+
<Key
177+
app:code="-5"
178+
app:isRepeatable="true"
179+
app:keyEdgeFlags="right"
180+
app:keyIcon="@drawable/ic_clear_vector"
181+
app:keyWidth="15%p" />
182+
</Row>
183+
<Row>
184+
<Key
185+
app:code="-2"
186+
app:keyEdgeFlags="left"
187+
app:keyLabel="123"
188+
app:keyWidth="15%p" />
189+
<Key
190+
app:keyLabel=","
191+
app:keyWidth="10%p" />
192+
<Key
193+
app:code="-6"
194+
app:keyEdgeFlags="left"
195+
app:keyIcon="@drawable/ic_emoji_emotions_outline_vector"
196+
app:keyWidth="10%p"
197+
app:secondaryKeyIcon="@drawable/ic_language_outlined" />
198+
<Key
199+
app:code="32"
200+
app:isRepeatable="true"
201+
app:keyWidth="40%p" />
202+
<Key
203+
app:keyLabel="."
204+
app:keyWidth="10%p"
205+
app:popupCharacters=",?!;:…"
206+
app:popupKeyboard="@xml/keyboard_popup_template" />
207+
<Key
208+
app:code="-4"
209+
app:keyEdgeFlags="right"
210+
app:keyIcon="@drawable/ic_enter_vector"
211+
app:keyWidth="15%p" />
212+
</Row>
213+
</Keyboard>

app/src/main/res/xml/keys_letters_lithuanian.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
app:topSmallNumber="7" />
7474
<Key
7575
app:keyLabel="i"
76-
app:popupCharacters="íìî8įïī"
76+
app:popupCharacters="íìîį8ïī"
7777
app:popupKeyboard="@xml/keyboard_popup_template"
7878
app:topSmallNumber="8" />
7979
<Key
@@ -159,17 +159,17 @@
159159
app:code="-6"
160160
app:keyEdgeFlags="left"
161161
app:keyIcon="@drawable/ic_emoji_emotions_outline_vector"
162-
app:secondaryKeyIcon="@drawable/ic_language_outlined"
163-
app:keyWidth="10%p" />
162+
app:keyWidth="10%p"
163+
app:secondaryKeyIcon="@drawable/ic_language_outlined" />
164164
<Key
165165
app:code="32"
166166
app:isRepeatable="true"
167167
app:keyWidth="40%p" />
168168
<Key
169169
app:keyLabel="."
170+
app:keyWidth="10%p"
170171
app:popupCharacters=",?!;:…"
171-
app:popupKeyboard="@xml/keyboard_popup_template"
172-
app:keyWidth="10%p" />
172+
app:popupKeyboard="@xml/keyboard_popup_template" />
173173
<Key
174174
app:code="-4"
175175
app:keyEdgeFlags="right"

0 commit comments

Comments
 (0)