Skip to content

Commit

Permalink
Merge pull request #131 from Yashvardhan-17/feature/98-fix-unuesed-va…
Browse files Browse the repository at this point in the history
…riable-lint

98 Fixed linting issues due to unused variable or properties as found…
  • Loading branch information
andrewtavis authored Sep 19, 2024
2 parents 124e649 + 86a2d22 commit 88b765a
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 40 deletions.
12 changes: 0 additions & 12 deletions app/src/main/java/be/scri/fragments/AboutFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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
}
}
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: 0 additions & 4 deletions app/src/main/java/be/scri/services/FrenchKeyboardIME.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
4 changes: 0 additions & 4 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,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)
Expand Down
4 changes: 0 additions & 4 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,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)
Expand Down
4 changes: 0 additions & 4 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,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)
Expand Down
4 changes: 0 additions & 4 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,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)
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 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

0 comments on commit 88b765a

Please sign in to comment.