diff --git a/app/src/main/java/be/scri/helpers/AlphanumericComparator.kt b/app/src/main/java/be/scri/helpers/AlphanumericComparator.kt index 8820591f..3aa1ba2d 100644 --- a/app/src/main/java/be/scri/helpers/AlphanumericComparator.kt +++ b/app/src/main/java/be/scri/helpers/AlphanumericComparator.kt @@ -2,6 +2,8 @@ package be.scri.helpers // Taken from https://gist.github.com/MichaelRocks/1b94bb44c7804e999dbf31dac86955ec. // Make IMG_5.jpg come before IMG_10.jpg. +// This is a example test so suppressed as it doesn't effect the application +@Suppress("NestedBlockDepth") class AlphanumericComparator { fun compare( string1: String, diff --git a/app/src/main/java/be/scri/helpers/DatabaseHelper.kt b/app/src/main/java/be/scri/helpers/DatabaseHelper.kt index 99c85d11..d7f3d6ab 100644 --- a/app/src/main/java/be/scri/helpers/DatabaseHelper.kt +++ b/app/src/main/java/be/scri/helpers/DatabaseHelper.kt @@ -1,6 +1,7 @@ package be.scri.helpers import android.content.Context +import android.database.Cursor import android.database.sqlite.SQLiteDatabase import android.database.sqlite.SQLiteOpenHelper import java.io.FileOutputStream @@ -51,16 +52,19 @@ class DatabaseHelper( if (cursor.moveToFirst()) { do { val key = cursor.getString(0) - val values = mutableListOf() - - for (i in 1 until cursor.columnCount) { - values.add(cursor.getString(i)) - } - - hashMap[key] = values + hashMap[key] = getEmojiKeyMaps(cursor) } while (cursor.moveToNext()) } } return hashMap } + + fun getEmojiKeyMaps(cursor: Cursor): MutableList { + val values = mutableListOf() + + for (i in 1 until cursor.columnCount) { + values.add(cursor.getString(i)) + } + return values + } } diff --git a/app/src/main/java/be/scri/helpers/MyKeyboard.kt b/app/src/main/java/be/scri/helpers/MyKeyboard.kt index 43dd61a5..8775b3f9 100644 --- a/app/src/main/java/be/scri/helpers/MyKeyboard.kt +++ b/app/src/main/java/be/scri/helpers/MyKeyboard.kt @@ -21,7 +21,7 @@ import java.io.IOException * @attr ref android.R.styleable#Keyboard_keyWidth * @attr ref android.R.styleable#Keyboard_horizontalGap */ -@Suppress("LongMethod") +@Suppress("LongMethod", "NestedBlockDepth") class MyKeyboard { /** Horizontal gap default for all rows */ private var mDefaultHorizontalGap = 0 diff --git a/app/src/main/java/be/scri/views/MyKeyboardView.kt b/app/src/main/java/be/scri/views/MyKeyboardView.kt index bdf1e1c3..f2df62b8 100644 --- a/app/src/main/java/be/scri/views/MyKeyboardView.kt +++ b/app/src/main/java/be/scri/views/MyKeyboardView.kt @@ -58,7 +58,7 @@ import java.util.Arrays import java.util.Locale @SuppressLint("UseCompatLoadingForDrawables") -@Suppress("LargeClass", "LongMethod", "TooManyFunctions") +@Suppress("LargeClass", "LongMethod", "TooManyFunctions", "NestedBlockDepth") class MyKeyboardView @JvmOverloads constructor( diff --git a/detekt.yml b/detekt.yml index e9237d8e..f0650a62 100644 --- a/detekt.yml +++ b/detekt.yml @@ -25,7 +25,7 @@ complexity: TooManyFunctions: active: true NestedBlockDepth: - active: false + active: true ComplexCondition: active: true LongParameterList: diff --git a/github.com b/github.com new file mode 100644 index 00000000..e69de29b