diff --git a/app/src/main/java/be/scri/fragments/AboutFragment.kt b/app/src/main/java/be/scri/fragments/AboutFragment.kt index 774ae2d3..06e03cc7 100644 --- a/app/src/main/java/be/scri/fragments/AboutFragment.kt +++ b/app/src/main/java/be/scri/fragments/AboutFragment.kt @@ -2,7 +2,6 @@ package be.scri.fragments import android.content.Intent import android.os.Bundle -import android.view.GestureDetector import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -16,11 +15,7 @@ import be.scri.helpers.CustomAdapter import be.scri.models.ItemsViewModel class AboutFragment : Fragment() { - private var appName = "" - private var primaryColor = 0 - private lateinit var binding: FragmentAboutBinding - private lateinit var gestureDetector: GestureDetector override fun onCreateView( inflater: LayoutInflater, @@ -218,11 +213,4 @@ class AboutFragment : Fragment() { fragmentTransaction.addToBackStack(null) fragmentTransaction.commit() } - - companion object { - private const val EASTER_EGG_TIME_LIMIT = 3000L - private const val EASTER_EGG_REQUIRED_CLICKS = 7 - private const val SWIPE_THRESHOLD = 100 - private const val SWIPE_VELOCITY_THRESHOLD = 100 - } } diff --git a/app/src/main/java/be/scri/helpers/String.kt b/app/src/main/java/be/scri/helpers/String.kt index 08cbe7fa..b8dc615a 100644 --- a/app/src/main/java/be/scri/helpers/String.kt +++ b/app/src/main/java/be/scri/helpers/String.kt @@ -2,8 +2,6 @@ package be.scri.helpers operator fun String.times(x: Int): String { val stringBuilder = StringBuilder() - for (i in 1..x) { - stringBuilder.append(this) - } + (1..x).forEach { stringBuilder.append(this) } return stringBuilder.toString() } diff --git a/app/src/main/java/be/scri/services/EnglishKeyboardIME.kt b/app/src/main/java/be/scri/services/EnglishKeyboardIME.kt index 45de9418..c28c7c33 100644 --- a/app/src/main/java/be/scri/services/EnglishKeyboardIME.kt +++ b/app/src/main/java/be/scri/services/EnglishKeyboardIME.kt @@ -44,7 +44,6 @@ class EnglishKeyboardIME : SimpleKeyboardIME() { private var currentState: ScribeState = ScribeState.IDLE private lateinit var keyboardBinding: KeyboardViewKeyboardBinding - private lateinit var commandBinding: KeyboardViewCommandOptionsBinding override fun onInitializeInterface() { super.onInitializeInterface() diff --git a/app/src/main/java/be/scri/services/FrenchKeyboardIME.kt b/app/src/main/java/be/scri/services/FrenchKeyboardIME.kt index 025f5880..256a613c 100644 --- a/app/src/main/java/be/scri/services/FrenchKeyboardIME.kt +++ b/app/src/main/java/be/scri/services/FrenchKeyboardIME.kt @@ -14,9 +14,6 @@ import be.scri.views.MyKeyboardView class FrenchKeyboardIME : SimpleKeyboardIME() { override fun getKeyboardLayoutXML(): Int = R.xml.keys_letters_french - private var lastSpaceTime: Long = 0 - private val doubleTapThreshold: Long = 300 - enum class ScribeState { IDLE, SELECT_COMMAND, @@ -32,7 +29,6 @@ class FrenchKeyboardIME : SimpleKeyboardIME() { private var currentState: ScribeState = ScribeState.IDLE private lateinit var keyboardBinding: KeyboardViewKeyboardBinding - private lateinit var commandBinding: KeyboardViewCommandOptionsBinding override lateinit var binding: KeyboardViewCommandOptionsBinding override var keyboardView: MyKeyboardView? = null override var keyboard: MyKeyboard? = null diff --git a/app/src/main/java/be/scri/services/GermanKeyboardIME.kt b/app/src/main/java/be/scri/services/GermanKeyboardIME.kt index af7c478d..b69e3ec6 100644 --- a/app/src/main/java/be/scri/services/GermanKeyboardIME.kt +++ b/app/src/main/java/be/scri/services/GermanKeyboardIME.kt @@ -29,7 +29,6 @@ class GermanKeyboardIME : SimpleKeyboardIME() { private var currentState: ScribeState = ScribeState.IDLE private lateinit var keyboardBinding: KeyboardViewKeyboardBinding - private lateinit var commandBinding: KeyboardViewCommandOptionsBinding override lateinit var binding: KeyboardViewCommandOptionsBinding override var keyboardView: MyKeyboardView? = null override var keyboard: MyKeyboard? = null @@ -49,9 +48,6 @@ class GermanKeyboardIME : SimpleKeyboardIME() { keyboard = MyKeyboard(this, getKeyboardLayoutXML(), enterKeyType) } - private var lastSpaceTime: Long = 0 - private val doubleTapThreshold: Long = 300 - private fun shouldCommitPeriodAfterSpace(language: String): Boolean { val sharedPref = getSharedPreferences("app_preferences", Context.MODE_PRIVATE) return sharedPref.getBoolean("period_on_double_tap_$language", false) diff --git a/app/src/main/java/be/scri/services/ItalianKeyboardIME.kt b/app/src/main/java/be/scri/services/ItalianKeyboardIME.kt index 47558a26..2a2a2fe5 100644 --- a/app/src/main/java/be/scri/services/ItalianKeyboardIME.kt +++ b/app/src/main/java/be/scri/services/ItalianKeyboardIME.kt @@ -29,7 +29,6 @@ class ItalianKeyboardIME : SimpleKeyboardIME() { private var currentState: ScribeState = ScribeState.IDLE private lateinit var keyboardBinding: KeyboardViewKeyboardBinding - private lateinit var commandBinding: KeyboardViewCommandOptionsBinding override lateinit var binding: KeyboardViewCommandOptionsBinding override var keyboardView: MyKeyboardView? = null override var keyboard: MyKeyboard? = null @@ -49,9 +48,6 @@ class ItalianKeyboardIME : SimpleKeyboardIME() { keyboard = MyKeyboard(this, getKeyboardLayoutXML(), enterKeyType) } - private var lastSpaceTime: Long = 0 - private val doubleTapThreshold: Long = 300 - private fun shouldCommitPeriodAfterSpace(language: String): Boolean { val sharedPref = getSharedPreferences("app_preferences", Context.MODE_PRIVATE) return sharedPref.getBoolean("period_on_double_tap_$language", false) diff --git a/app/src/main/java/be/scri/services/PortugueseKeyboardIME.kt b/app/src/main/java/be/scri/services/PortugueseKeyboardIME.kt index e170fecc..9221b551 100644 --- a/app/src/main/java/be/scri/services/PortugueseKeyboardIME.kt +++ b/app/src/main/java/be/scri/services/PortugueseKeyboardIME.kt @@ -29,7 +29,6 @@ class PortugueseKeyboardIME : SimpleKeyboardIME() { private var currentState: ScribeState = ScribeState.IDLE private lateinit var keyboardBinding: KeyboardViewKeyboardBinding - private lateinit var commandBinding: KeyboardViewCommandOptionsBinding override lateinit var binding: KeyboardViewCommandOptionsBinding override var keyboardView: MyKeyboardView? = null override var keyboard: MyKeyboard? = null @@ -49,9 +48,6 @@ class PortugueseKeyboardIME : SimpleKeyboardIME() { keyboard = MyKeyboard(this, getKeyboardLayoutXML(), enterKeyType) } - private var lastSpaceTime: Long = 0 - private val doubleTapThreshold: Long = 300 - private fun shouldCommitPeriodAfterSpace(language: String): Boolean { val sharedPref = getSharedPreferences("app_preferences", Context.MODE_PRIVATE) return sharedPref.getBoolean("period_on_double_tap_$language", false) diff --git a/app/src/main/java/be/scri/services/RussianKeyboardIME.kt b/app/src/main/java/be/scri/services/RussianKeyboardIME.kt index 22b575c6..dce13da1 100644 --- a/app/src/main/java/be/scri/services/RussianKeyboardIME.kt +++ b/app/src/main/java/be/scri/services/RussianKeyboardIME.kt @@ -29,7 +29,6 @@ class RussianKeyboardIME : SimpleKeyboardIME() { private var currentState: ScribeState = ScribeState.IDLE private lateinit var keyboardBinding: KeyboardViewKeyboardBinding - private lateinit var commandBinding: KeyboardViewCommandOptionsBinding override lateinit var binding: KeyboardViewCommandOptionsBinding override var keyboardView: MyKeyboardView? = null override var keyboard: MyKeyboard? = null @@ -49,9 +48,6 @@ class RussianKeyboardIME : SimpleKeyboardIME() { keyboard = MyKeyboard(this, getKeyboardLayoutXML(), enterKeyType) } - private var lastSpaceTime: Long = 0 - private val doubleTapThreshold: Long = 300 - private fun shouldCommitPeriodAfterSpace(language: String): Boolean { val sharedPref = getSharedPreferences("app_preferences", Context.MODE_PRIVATE) return sharedPref.getBoolean("period_on_double_tap_$language", false) diff --git a/app/src/main/java/be/scri/services/SpanishKeyboardIME.kt b/app/src/main/java/be/scri/services/SpanishKeyboardIME.kt index 012e758b..70e2d3d9 100644 --- a/app/src/main/java/be/scri/services/SpanishKeyboardIME.kt +++ b/app/src/main/java/be/scri/services/SpanishKeyboardIME.kt @@ -29,7 +29,6 @@ class SpanishKeyboardIME : SimpleKeyboardIME() { private var currentState: ScribeState = ScribeState.IDLE private lateinit var keyboardBinding: KeyboardViewKeyboardBinding - private lateinit var commandBinding: KeyboardViewCommandOptionsBinding override lateinit var binding: KeyboardViewCommandOptionsBinding override var keyboardView: MyKeyboardView? = null override var keyboard: MyKeyboard? = null diff --git a/app/src/main/java/be/scri/services/SwedishKeyboardIME.kt b/app/src/main/java/be/scri/services/SwedishKeyboardIME.kt index df0236ce..7afd48d8 100644 --- a/app/src/main/java/be/scri/services/SwedishKeyboardIME.kt +++ b/app/src/main/java/be/scri/services/SwedishKeyboardIME.kt @@ -29,7 +29,6 @@ class SwedishKeyboardIME : SimpleKeyboardIME() { private var currentState: ScribeState = ScribeState.IDLE private lateinit var keyboardBinding: KeyboardViewKeyboardBinding - private lateinit var commandBinding: KeyboardViewCommandOptionsBinding override lateinit var binding: KeyboardViewCommandOptionsBinding override var keyboardView: MyKeyboardView? = null override var keyboard: MyKeyboard? = null diff --git a/app/src/main/java/be/scri/views/MyKeyboardView.kt b/app/src/main/java/be/scri/views/MyKeyboardView.kt index a6f8f202..a0321659 100644 --- a/app/src/main/java/be/scri/views/MyKeyboardView.kt +++ b/app/src/main/java/be/scri/views/MyKeyboardView.kt @@ -506,7 +506,6 @@ class MyKeyboardView val currentNightMode = context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK val isSystemDarkMode = currentNightMode == Configuration.UI_MODE_NIGHT_YES val isUserDarkMode = sharedPref.getBoolean("dark_mode", isSystemDarkMode) - val changeKeyColor = sharedPref.getBoolean("pref_key_change_key_color", false) val keyBackgroundColor = if (isUserDarkMode) { Color.DKGRAY diff --git a/detekt.yml b/detekt.yml index e09f04d7..dbc35c23 100644 --- a/detekt.yml +++ b/detekt.yml @@ -10,7 +10,7 @@ style: ReturnCount: active: false UnusedPrivateProperty: - active: false + active: true UnusedParameter: active: false FunctionOnlyReturningConstant: