From 80963a35d2852ea9eeaf88f25a1266eb970fb69f Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 21 Jan 2022 17:24:47 +0100 Subject: [PATCH] removing unused verticalGap key attribute --- .../keyboard/helpers/MyKeyboard.kt | 18 ++---------------- app/src/main/res/values/attrs.xml | 2 -- .../main/res/xml/keyboard_popup_template.xml | 4 +--- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt index 8f04596b..5997c107 100644 --- a/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt +++ b/app/src/main/kotlin/com/simplemobiletools/keyboard/helpers/MyKeyboard.kt @@ -24,7 +24,6 @@ import java.util.* * android:keyWidth="%10p" * android:keyHeight="50px" * android:horizontalGap="2px" - * android:verticalGap="2px" > * <Row android:keyWidth="32px" > * <Key android:keyLabel="A" /> * ... @@ -35,7 +34,6 @@ import java.util.* * @attr ref android.R.styleable#Keyboard_keyWidth * @attr ref android.R.styleable#Keyboard_keyHeight * @attr ref android.R.styleable#Keyboard_horizontalGap - * @attr ref android.R.styleable#Keyboard_verticalGap */ class MyKeyboard { /** Horizontal gap default for all rows */ @@ -47,9 +45,6 @@ class MyKeyboard { /** Default key height */ private var mDefaultHeight = 0 - /** Default gap between rows */ - private var mDefaultVerticalGap = 0 - /** Is the keyboard in the shifted state */ var shiftState = SHIFT_OFF @@ -122,7 +117,6 @@ class MyKeyboard { * @attr ref android.R.styleable#Keyboard_keyWidth * @attr ref android.R.styleable#Keyboard_keyHeight * @attr ref android.R.styleable#Keyboard_horizontalGap - * @attr ref android.R.styleable#Keyboard_verticalGap * @attr ref android.R.styleable#Keyboard_Row_rowEdgeFlags * @attr ref android.R.styleable#Keyboard_Row_keyboardMode */ @@ -136,9 +130,6 @@ class MyKeyboard { /** Default horizontal gap between keys in this row. */ var defaultHorizontalGap = 0 - /** Vertical gap following this row. */ - var verticalGap = 0 - var mKeys = ArrayList() /** @@ -161,7 +152,6 @@ class MyKeyboard { defaultWidth = getDimensionOrFraction(a, R.styleable.MyKeyboard_keyWidth, parent.mDisplayWidth, parent.mDefaultWidth) defaultHeight = res.getDimension(R.dimen.key_height).toInt() defaultHorizontalGap = getDimensionOrFraction(a, R.styleable.MyKeyboard_horizontalGap, parent.mDisplayWidth, parent.mDefaultHorizontalGap) - verticalGap = getDimensionOrFraction(a, R.styleable.MyKeyboard_verticalGap, parent.mDisplayHeight, parent.mDefaultVerticalGap) a.recycle() a = res.obtainAttributes(Xml.asAttributeSet(parser), R.styleable.MyKeyboard_Row) @@ -393,7 +383,6 @@ class MyKeyboard { mDisplayHeight = dm.heightPixels mDefaultHorizontalGap = 0 mDefaultWidth = mDisplayWidth / 10 - mDefaultVerticalGap = 0 mDefaultHeight = mDefaultWidth mKeys = ArrayList() mEnterKeyType = enterKeyType @@ -424,7 +413,6 @@ class MyKeyboard { row.defaultHeight = mDefaultHeight row.defaultWidth = mDefaultWidth row.defaultHorizontalGap = mDefaultHorizontalGap - row.verticalGap = mDefaultVerticalGap row.rowEdgeFlags = EDGE_TOP or EDGE_BOTTOM characters.forEachIndexed { index, character -> @@ -615,15 +603,14 @@ class MyKeyboard { } } else if (inRow) { inRow = false - y += currentRow!!.verticalGap - y += currentRow.defaultHeight + y += currentRow!!.defaultHeight row++ } } } } catch (e: Exception) { } - height = y - mDefaultVerticalGap + height = y } private fun skipToEndOfRow(parser: XmlResourceParser) { @@ -640,7 +627,6 @@ class MyKeyboard { mDefaultWidth = getDimensionOrFraction(a, R.styleable.MyKeyboard_keyWidth, mDisplayWidth, mDisplayWidth / 10) mDefaultHeight = res.getDimension(R.dimen.key_height).toInt() mDefaultHorizontalGap = getDimensionOrFraction(a, R.styleable.MyKeyboard_horizontalGap, mDisplayWidth, 0) - mDefaultVerticalGap = getDimensionOrFraction(a, R.styleable.MyKeyboard_verticalGap, mDisplayHeight, 0) mProximityThreshold = (mDefaultWidth * SEARCH_DISTANCE).toInt() mProximityThreshold *= mProximityThreshold // Square it for comparison a.recycle() diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index cccfbda7..bae2e141 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -39,8 +39,6 @@ - - diff --git a/app/src/main/res/xml/keyboard_popup_template.xml b/app/src/main/res/xml/keyboard_popup_template.xml index 195b2799..e3b2a35b 100644 --- a/app/src/main/res/xml/keyboard_popup_template.xml +++ b/app/src/main/res/xml/keyboard_popup_template.xml @@ -1,4 +1,2 @@ - +