Skip to content

Commit

Permalink
98 Fixed linting issues due to unused variable or properties as found…
Browse files Browse the repository at this point in the history
… by detekt
  • Loading branch information
YMAHESHD committed Sep 19, 2024
1 parent 124e649 commit 3fa06db
Show file tree
Hide file tree
Showing 14 changed files with 10 additions and 34 deletions.
12 changes: 3 additions & 9 deletions app/src/main/java/be/scri/fragments/AboutFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ 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,
Expand Down Expand Up @@ -219,10 +218,5 @@ class AboutFragment : Fragment() {
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
}

}
4 changes: 1 addition & 3 deletions app/src/main/java/be/scri/helpers/String.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
1 change: 0 additions & 1 deletion app/src/main/java/be/scri/services/EnglishKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/java/be/scri/services/FrenchKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ 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,
Expand All @@ -32,7 +31,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
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/java/be/scri/services/GermanKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,8 +48,7 @@ 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)
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/java/be/scri/services/ItalianKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,8 +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)
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/java/be/scri/services/PortugueseKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,8 +48,7 @@ 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)
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/java/be/scri/services/RussianKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,8 +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)
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/be/scri/services/SpanishKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/be/scri/services/SwedishKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/be/scri/views/MyKeyboardView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
}

dependencies {
classpath("com.android.tools.build:gradle:8.6.0")
classpath("com.android.tools.build:gradle:8.2.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
classpath("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.6")
classpath("org.jlleitschuh.gradle:ktlint-gradle:12.1.1")
Expand Down
2 changes: 1 addition & 1 deletion detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ style:
ReturnCount:
active: false
UnusedPrivateProperty:
active: false
active: true
UnusedParameter:
active: false
FunctionOnlyReturningConstant:
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ android.nonFinalResIds=false
android.nonTransitiveRClass=false
android.useAndroidX=true
org.gradle.jvmargs=-Xmx4g -Xms1g

org.gradle.java.home=C:/Program Files/Android/Android Studio/jbr

0 comments on commit 3fa06db

Please sign in to comment.