Merge branch 'main' into capitalizing_settings

This commit is contained in:
Konstantin Merenkov 2023-05-20 17:00:45 +10:00 committed by GitHub
commit 2ee861368b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 76 additions and 11 deletions

View File

@ -201,8 +201,14 @@ class MyKeyboard {
a.recycle()
a = res.obtainAttributes(Xml.asAttributeSet(parser), R.styleable.MyKeyboard_Key)
label = a.getText(R.styleable.MyKeyboard_Key_keyLabel) ?: ""
code = a.getInt(R.styleable.MyKeyboard_Key_code, 0)
if (label.isNotEmpty() && code == 0) {
code = label[0].code
}
popupCharacters = a.getText(R.styleable.MyKeyboard_Key_popupCharacters)
popupResId = a.getResourceId(R.styleable.MyKeyboard_Key_popupKeyboard, 0)
repeatable = a.getBoolean(R.styleable.MyKeyboard_Key_isRepeatable, false)
@ -213,12 +219,9 @@ class MyKeyboard {
secondaryIcon = a.getDrawable(R.styleable.MyKeyboard_Key_secondaryKeyIcon)
secondaryIcon?.setBounds(0, 0, secondaryIcon!!.intrinsicWidth, secondaryIcon!!.intrinsicHeight)
label = a.getText(R.styleable.MyKeyboard_Key_keyLabel) ?: ""
topSmallNumber = a.getString(R.styleable.MyKeyboard_Key_topSmallNumber) ?: ""
if (label.isNotEmpty() && code != KEYCODE_MODE_CHANGE && code != KEYCODE_SHIFT) {
code = label[0].code
}
a.recycle()
}

View File

@ -569,6 +569,8 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
for (i in 0 until keyCount) {
val key = keys[i]
val code = key.code
// TODO: Space key background on a KEYBOARD_PHONE should not be applied
setupKeyBackground(key, code, canvas)
// Switch the character to uppercase if shift is pressed
@ -674,9 +676,9 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
}
private fun setupKeyBackground(key: MyKeyboard.Key, keyCode: Int, canvas: Canvas) {
val keyBackground = when (keyCode) {
KEYCODE_SPACE -> getSpaceKeyBackground()
KEYCODE_ENTER -> getEnterKeyBackground()
val keyBackground = when {
keyCode == KEYCODE_SPACE && key.label.isBlank() -> getSpaceKeyBackground()
keyCode == KEYCODE_ENTER -> getEnterKeyBackground()
else -> mKeyBackground
}

View File

@ -41,13 +41,32 @@
</RelativeLayout>
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/text_edittext"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/change_keyboard_holder"
android:layout_margin="@dimen/activity_margin" />
android:orientation="vertical">
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/text_edittext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:layout_marginTop="@dimen/activity_margin"
android:layout_marginEnd="@dimen/activity_margin"
android:layout_marginBottom="@dimen/activity_margin" />
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/text_editphone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:layout_marginTop="@dimen/activity_margin"
android:layout_marginEnd="@dimen/activity_margin"
android:layout_marginBottom="@dimen/activity_margin"
android:inputType="phone" />
</LinearLayout>
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">ارتفاع لوحة المفاتيح</string>
<string name="show_key_borders">إظهار حدود المفاتيح</string>
<string name="show_numbers_row">إظهار الأرقام في صف منفصل</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">الرموز التعبيرية</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Вышыня клавіятуры</string>
<string name="show_key_borders">Паказаць контуры клавіш</string>
<string name="show_numbers_row">Паказаць лічбы ў асобным радку</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Эмодзі</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Височина на клавиатурата</string>
<string name="show_key_borders">Show key borders</string>
<string name="show_numbers_row">Show numbers on a separate row</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Емоджита</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Alçada del teclat</string>
<string name="show_key_borders">Mostra les vores de les tecles</string>
<string name="show_numbers_row">Mostra els números en una fila separada</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emojis</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">قەبارەی تەختەکلیل</string>
<string name="show_key_borders">لێواری دوگمەکان</string>
<string name="show_numbers_row">پیشاندانی لیستی ژمارەکان بەجیا</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">خەندەکان</string>
</resources>

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Výška klávesnice</string>
<string name="show_key_borders">Zobrazit ohraničení kláves</string>
<string name="show_numbers_row">Zobrazit čísla na samostatném řádku</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emotikony</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Keyboard height</string>
<string name="show_key_borders">Show key borders</string>
<string name="show_numbers_row">Show numbers on a separate row</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emojis</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Höhe der Tastatur</string>
<string name="show_key_borders">Tastenränder anzeigen</string>
<string name="show_numbers_row">Zahlen in einer separaten Zeile anzeigen</string>
<string name="start_sentences_capitalised">Sätze mit einem Großbuchstaben beginnen</string>
<!-- Emojis -->
<string name="emojis">Emojis</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Ύψος πληκτρολογίου</string>
<string name="show_key_borders">Εμφάνιση ορίων πλήκτρου</string>
<string name="show_numbers_row">Εμφάνιση αριθμών σε ξεχωριστή γραμμή</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emojis</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Keyboard height</string>
<string name="show_key_borders">Show key borders</string>
<string name="show_numbers_row">Show numbers on a separate row</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emojis</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Altura del teclado</string>
<string name="show_key_borders">Mostrar bordes de las teclas</string>
<string name="show_numbers_row">Mostrar los números en una fila separada</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emoticonos</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Klaviatuuri kõrgus</string>
<string name="show_key_borders">Näita klahvide ääriseid</string>
<string name="show_numbers_row">Näita numbreid eraldi real</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emojid</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Näppäimistön korkeus</string>
<string name="show_key_borders">Näytä näppäinten ääriviivat</string>
<string name="show_numbers_row">Näytä erillinen numerorivi</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emojit</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Hauteur du clavier</string>
<string name="show_key_borders">Afficher les bordures des touches</string>
<string name="show_numbers_row">Afficher les chiffres sur une ligne distincte</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Émojis</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Altura do teclado</string>
<string name="show_key_borders">Mostralos bordes das teclas</string>
<string name="show_numbers_row">Mostralos números nunha fila afastada</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emoticona</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Visina tipkovnice</string>
<string name="show_key_borders">Prikaži obrube ključeva</string>
<string name="show_numbers_row">Pokaži brojeve u zasebnom retku</string>
<string name="start_sentences_capitalised">Počni rečenice s velikim slovom</string>
<!-- Emojis -->
<string name="emojis">Emoji</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Billentyűzet magassága</string>
<string name="show_key_borders">Gombszélek megjelenítése</string>
<string name="show_numbers_row">Számok megjelenítése külön sorban</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emojik</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Tinggi papan tik</string>
<string name="show_key_borders">Tampilkan garis luar tombol</string>
<string name="show_numbers_row">Tampilkan nomor di baris terpisah</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emoji</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Altezza della tastiera</string>
<string name="show_key_borders">Mostra i bordi dei tasti</string>
<string name="show_numbers_row">Mostra i numeri su una riga separata</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emoji</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Keyboard height</string>
<string name="show_key_borders">Show key borders</string>
<string name="show_numbers_row">Show numbers on a separate row</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emojis</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">キーボードの高さ</string>
<string name="show_key_borders">キー枠を表示する</string>
<string name="show_numbers_row">数字を別の行に表示する</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">絵文字</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Keyboard height</string>
<string name="show_key_borders">Show key borders</string>
<string name="show_numbers_row">Show numbers on a separate row</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emojis</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">കീബോർഡ് ഉയരം</string>
<string name="show_key_borders">പ്രധാന അതിരുകൾ കാണിക്കുക</string>
<string name="show_numbers_row">ഒരു പ്രത്യേക വരിയിൽ സംഖ്യകൾ കാണിക്കുക</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">ഇമോജികൾ</string>
</resources>

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Keyboard height</string>
<string name="show_key_borders">Show key borders</string>
<string name="show_numbers_row">Show numbers on a separate row</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emojis</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Hoogte toetsenbord</string>
<string name="show_key_borders">Toetsen omranden</string>
<string name="show_numbers_row">Cijfers op een aparte rij</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emoji\'s</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">کیبورڈ دی اُچائی</string>
<string name="show_key_borders">کنجیاں دے حد ویکھو</string>
<string name="show_numbers_row">وکھری قطار وچ نمبر ویکھو</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">ایموجیاں</string>
</resources>

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">ਕੀਬੋਰਡ ਦੀ ਉਚਾਈ</string>
<string name="show_key_borders">Show key borders</string>
<string name="show_numbers_row">Show numbers on a separate row</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">ਇਮੋਜੀਆਂ</string>
</resources>

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Wysokość klawiatury</string>
<string name="show_key_borders">Pokazuj obramowania klawiszy</string>
<string name="show_numbers_row">Pokazuj cyfry w osobnym wierszu</string>
<string name="start_sentences_capitalised">Zaczynaj zdania wielką literą</string>
<!-- Emojis -->
<string name="emojis">Emoji</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Keyboard height</string>
<string name="show_key_borders">Show key borders</string>
<string name="show_numbers_row">Show numbers on a separate row</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emojis</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Altura do teclado</string>
<string name="show_key_borders">Mostrar contorno das teclas</string>
<string name="show_numbers_row">Mostrar números em linha distinta</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emojis</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Înălțime tastatură</string>
<string name="show_key_borders">Show key borders</string>
<string name="show_numbers_row">Show numbers on a separate row</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emoticoane</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Высота клавиатуры</string>
<string name="show_key_borders">Показывать границы кнопок</string>
<string name="show_numbers_row">Показывать цифры отдельной строкой</string>
<string name="start_sentences_capitalised">Начинать предложения с заглавной буквы</string>
<!-- Emojis -->
<string name="emojis">Эмодзи</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Výška klávesnice</string>
<string name="show_key_borders">Zobraziť hranice kláves</string>
<string name="show_numbers_row">Zobraziť čísla na samostatnom riadku</string>
<string name="start_sentences_capitalised">Začať vety veľkým písmenom</string>
<!-- Emojis -->
<string name="emojis">Emoji</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Višina tipkovnice</string>
<string name="show_key_borders">Prikaži meje ključa</string>
<string name="show_numbers_row">Prikažite številke v ločeni vrstici</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emoji-ji</string>
</resources>

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Висина тастатуре</string>
<string name="show_key_borders">Прикажи ивице кључева</string>
<string name="show_numbers_row">Прикажи бројеве у посебном реду</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Емоји</string>
</resources>

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Tangentbordshöjd</string>
<string name="show_key_borders">Visa ramar runt tangenterna</string>
<string name="show_numbers_row">Visa siffror på en separat rad</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emojier</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Keyboard height</string>
<string name="show_key_borders">Show key borders</string>
<string name="show_numbers_row">Show numbers on a separate row</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emojis</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Klavye yüksekliği</string>
<string name="show_key_borders">Tuş sınırlarını göster</string>
<string name="show_numbers_row">Sayıları ayrı bir satırda göster</string>
<string name="start_sentences_capitalised">Cümlelere büyük harfle başla</string>
<!-- Emojis -->
<string name="emojis">Emojiler</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">Висота клавіатури</string>
<string name="show_key_borders">Показати рамки клавіш</string>
<string name="show_numbers_row">Відображення чисел в окремому рядку</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Емодзі</string>
<!--

View File

@ -34,6 +34,7 @@
<string name="keyboard_height">键盘高度</string>
<string name="show_key_borders">显示键符边界</string>
<string name="show_numbers_row">在单独的行上显示数字</string>
<string name="start_sentences_capitalised">句子开头使用大写字母</string>
<!-- Emojis -->
<string name="emojis">表情符号</string>
<!--

View File

@ -35,6 +35,7 @@
<string name="keyboard_height">Keyboard height</string>
<string name="show_key_borders">Show key borders</string>
<string name="show_numbers_row">Show numbers on a separate row</string>
<string name="start_sentences_capitalised">Start sentences with a capital letter</string>
<!-- Emojis -->
<string name="emojis">Emojis</string>
<!--

View File

@ -35,7 +35,7 @@
<string name="show_key_borders">Show key borders</string>
<string name="show_numbers_row">Show numbers on a separate row</string>
<string name="enable_sentences_capitalization">Capisalise the first word of each sentence</string>
c <!-- Emojis -->
<!-- Emojis -->
<string name="emojis">Emojis</string>
<!--
Haven't found some strings? There's more at