Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,8 @@ class KeyboardUIManager(

val isTablet =
(context.resources.configuration.screenLayout and Configuration.SCREENLAYOUT_SIZE_MASK) >=
Configuration.SCREENLAYOUT_SIZE_LARGE
Configuration.SCREENLAYOUT_SIZE_LARGE ||
context.resources.configuration.smallestScreenWidthDp >= GeneralKeyboardIME.SMALLEST_SCREEN_WIDTH_TABLET

val emojiCount = if (isAutoSuggestEnabled) autoSuggestEmojis?.size ?: 0 else 0

Expand Down
6 changes: 0 additions & 6 deletions app/src/keyboards/java/be/scri/services/EnglishKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ import be.scri.helpers.KeyHandler
* The EnglishKeyboardIME class provides the input method for the English language keyboard.
*/
class EnglishKeyboardIME : GeneralKeyboardIME("English") {
companion object {
const val SMALLEST_SCREEN_WIDTH_TABLET = 600
}

private fun isTablet(): Boolean = resources.configuration.smallestScreenWidthDp >= SMALLEST_SCREEN_WIDTH_TABLET

override fun getKeyboardLayoutXML(): Int =
when {
isTablet() -> R.xml.keys_letters_english_tablet
Expand Down
6 changes: 0 additions & 6 deletions app/src/keyboards/java/be/scri/services/FrenchKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ import be.scri.helpers.KeyHandler
* The FrenchKeyboardIME class provides the input method for the French language keyboard.
*/
class FrenchKeyboardIME : GeneralKeyboardIME("French") {
companion object {
const val SMALLEST_SCREEN_WIDTH_TABLET = 600
}

private fun isTablet(): Boolean = resources.configuration.smallestScreenWidthDp >= SMALLEST_SCREEN_WIDTH_TABLET

override fun getKeyboardLayoutXML(): Int =
when {
isTablet() -> R.xml.keys_letters_french_tablet
Expand Down
3 changes: 3 additions & 0 deletions app/src/keyboards/java/be/scri/services/GeneralKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ abstract class GeneralKeyboardIME(
private var currentVerbForConjugation: String? = null
private var selectedConjugationSubCategory: String? = null

protected open fun isTablet(): Boolean = resources.configuration.smallestScreenWidthDp >= SMALLEST_SCREEN_WIDTH_TABLET

internal companion object {
const val SMALLEST_SCREEN_WIDTH_TABLET = 600
const val DEFAULT_SHIFT_PERM_TOGGLE_SPEED = 500
const val TEXT_LENGTH = 20
const val NOUN_TYPE_SIZE = 20f
Expand Down
6 changes: 0 additions & 6 deletions app/src/keyboards/java/be/scri/services/GermanKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ import be.scri.helpers.PreferencesHelper.getIsAccentCharacterDisabled
* The GermanKeyboardIME class provides the input method for the German language keyboard.
*/
class GermanKeyboardIME : GeneralKeyboardIME("German") {
companion object {
const val SMALLEST_SCREEN_WIDTH_TABLET = 600
}

private fun isTablet(): Boolean = resources.configuration.smallestScreenWidthDp >= SMALLEST_SCREEN_WIDTH_TABLET

override fun getKeyboardLayoutXML(): Int =
if (isTablet()) {
R.xml.keys_letters_german_tablet
Expand Down
6 changes: 0 additions & 6 deletions app/src/keyboards/java/be/scri/services/ItalianKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ import be.scri.helpers.KeyHandler
* The ItalianKeyboardIME class provides the input method for the Italian language keyboard.
*/
class ItalianKeyboardIME : GeneralKeyboardIME("Italian") {
companion object {
const val SMALLEST_SCREEN_WIDTH_TABLET = 600
}

private fun isTablet(): Boolean = resources.configuration.smallestScreenWidthDp >= SMALLEST_SCREEN_WIDTH_TABLET

override fun getKeyboardLayoutXML(): Int =
when {
isTablet() -> R.xml.keys_letters_italian_tablet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ import be.scri.helpers.KeyHandler
* The PortugueseKeyboardIME class provides the input method for the Portuguese language keyboard.
*/
class PortugueseKeyboardIME : GeneralKeyboardIME("Portuguese") {
companion object {
const val SMALLEST_SCREEN_WIDTH_TABLET = 600
}

private fun isTablet(): Boolean = resources.configuration.smallestScreenWidthDp >= SMALLEST_SCREEN_WIDTH_TABLET

override fun getKeyboardLayoutXML(): Int =
when {
isTablet() -> R.xml.keys_letters_portuguese_tablet
Expand Down
6 changes: 0 additions & 6 deletions app/src/keyboards/java/be/scri/services/RussianKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ import be.scri.helpers.KeyHandler
* The RussianKeyboardIME class provides the input method for the Russian language keyboard.
*/
class RussianKeyboardIME : GeneralKeyboardIME("Russian") {
companion object {
const val SMALLEST_SCREEN_WIDTH_TABLET = 600
}

private fun isTablet(): Boolean = resources.configuration.smallestScreenWidthDp >= SMALLEST_SCREEN_WIDTH_TABLET

override fun getKeyboardLayoutXML(): Int =
when {
isTablet() -> R.xml.keys_letters_russian_tablet
Expand Down
6 changes: 0 additions & 6 deletions app/src/keyboards/java/be/scri/services/SpanishKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ import be.scri.helpers.PreferencesHelper.getIsAccentCharacterDisabled
* The SpanishKeyboardIME class provides the input method for the Spanish language keyboard.
*/
class SpanishKeyboardIME : GeneralKeyboardIME("Spanish") {
companion object {
const val SMALLEST_SCREEN_WIDTH_TABLET = 600
}

private fun isTablet(): Boolean = resources.configuration.smallestScreenWidthDp >= SMALLEST_SCREEN_WIDTH_TABLET

override fun getKeyboardLayoutXML(): Int =
when {
isTablet() -> R.xml.keys_letters_spanish_tablet
Expand Down
6 changes: 0 additions & 6 deletions app/src/keyboards/java/be/scri/services/SwedishKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ import be.scri.helpers.PreferencesHelper.getIsAccentCharacterDisabled
* The SwedishKeyboardIME class provides the input method for the Swedish language keyboard.
*/
class SwedishKeyboardIME : GeneralKeyboardIME("Swedish") {
companion object {
const val SMALLEST_SCREEN_WIDTH_TABLET = 600
}

private fun isTablet(): Boolean = resources.configuration.smallestScreenWidthDp >= SMALLEST_SCREEN_WIDTH_TABLET

override fun getKeyboardLayoutXML(): Int =
when {
isTablet() -> R.xml.keys_letters_swedish_tablet
Expand Down
Loading