minor code cleanup

This commit is contained in:
tibbi 2022-01-08 23:19:40 +01:00
parent 9337500bcd
commit 718cd41d8a
1 changed files with 1 additions and 9 deletions

View File

@ -24,9 +24,7 @@ import android.text.TextUtils
import android.util.TypedValue import android.util.TypedValue
import android.util.Xml import android.util.Xml
import androidx.annotation.XmlRes import androidx.annotation.XmlRes
import com.simplemobiletools.commons.helpers.mydebug
import com.simplemobiletools.keyboard.R import com.simplemobiletools.keyboard.R
import java.io.FileNotFoundException
import java.util.* import java.util.*
/** /**
@ -311,7 +309,6 @@ class MyKeyboard {
edgeFlags = a.getInt(R.styleable.Keyboard_Key_keyEdgeFlags, 0) edgeFlags = a.getInt(R.styleable.Keyboard_Key_keyEdgeFlags, 0)
edgeFlags = edgeFlags or parent.rowEdgeFlags edgeFlags = edgeFlags or parent.rowEdgeFlags
icon = a.getDrawable(R.styleable.Keyboard_Key_keyIcon) icon = a.getDrawable(R.styleable.Keyboard_Key_keyIcon)
icon?.setBounds(0, 0, icon!!.intrinsicWidth, icon!!.intrinsicHeight) icon?.setBounds(0, 0, icon!!.intrinsicWidth, icon!!.intrinsicHeight)
label = a.getText(R.styleable.Keyboard_Key_keyLabel) ?: "" label = a.getText(R.styleable.Keyboard_Key_keyLabel) ?: ""
@ -339,11 +336,9 @@ class MyKeyboard {
/** /**
* Changes the pressed state of the key. * Changes the pressed state of the key.
* *
*
* Toggled state of the key will be flipped when all the following conditions are * Toggled state of the key will be flipped when all the following conditions are
* fulfilled: * fulfilled:
* *
*
* * This is a sticky key, that is, [.sticky] is `true`. * * This is a sticky key, that is, [.sticky] is `true`.
* * The parameter `inside` is `true`. * * The parameter `inside` is `true`.
* * [android.os.Build.VERSION.SDK_INT] is greater than * * [android.os.Build.VERSION.SDK_INT] is greater than
@ -378,7 +373,6 @@ class MyKeyboard {
try { try {
values[count++] = st.nextToken().toInt() values[count++] = st.nextToken().toInt()
} catch (nfe: NumberFormatException) { } catch (nfe: NumberFormatException) {
mydebug("NumberFormatException $nfe")
} }
} }
return values return values
@ -653,7 +647,6 @@ class MyKeyboard {
if (event == XmlResourceParser.START_TAG) { if (event == XmlResourceParser.START_TAG) {
val tag = parser.name val tag = parser.name
if (TAG_ROW == tag) { if (TAG_ROW == tag) {
//mydebug("row $currentRow")
inRow = true inRow = true
x = 0 x = 0
currentRow = createRowFromXml(res, parser) currentRow = createRowFromXml(res, parser)
@ -699,8 +692,7 @@ class MyKeyboard {
} }
} }
} }
} catch (e: FileNotFoundException) { } catch (e: Exception) {
mydebug("Exception $e")
} }
height = y - mDefaultVerticalGap height = y - mDefaultVerticalGap
} }