removing some more unused attributes

This commit is contained in:
tibbi 2022-01-21 18:01:00 +01:00
parent 80963a35d2
commit 4b45826480
3 changed files with 1 additions and 19 deletions

View File

@ -62,8 +62,6 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
private var mLabelTextSize = 0 private var mLabelTextSize = 0
private var mKeyTextSize = 0 private var mKeyTextSize = 0
private var mShadowRadius = 0f
private var mShadowColor = 0
private val mBackgroundDimAmount: Float private val mBackgroundDimAmount: Float
private var mTextColor = 0 private var mTextColor = 0
@ -73,7 +71,6 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
private var mPreviewText: TextView? = null private var mPreviewText: TextView? = null
private val mPreviewPopup: PopupWindow private val mPreviewPopup: PopupWindow
private var mPreviewTextSizeLarge = 0 private var mPreviewTextSizeLarge = 0
private var mPreviewOffset = 0
private var mPreviewHeight = 0 private var mPreviewHeight = 0
// Working variable // Working variable
@ -218,13 +215,10 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
R.styleable.MyKeyboardView_keyBackground -> mKeyBackground = attributes.getDrawable(attr) R.styleable.MyKeyboardView_keyBackground -> mKeyBackground = attributes.getDrawable(attr)
R.styleable.MyKeyboardView_verticalCorrection -> mVerticalCorrection = attributes.getDimensionPixelOffset(attr, 0) R.styleable.MyKeyboardView_verticalCorrection -> mVerticalCorrection = attributes.getDimensionPixelOffset(attr, 0)
R.styleable.MyKeyboardView_keyPreviewLayout -> previewLayout = attributes.getResourceId(attr, 0) R.styleable.MyKeyboardView_keyPreviewLayout -> previewLayout = attributes.getResourceId(attr, 0)
R.styleable.MyKeyboardView_keyPreviewOffset -> mPreviewOffset = attributes.getDimensionPixelOffset(attr, 0)
R.styleable.MyKeyboardView_keyPreviewHeight -> mPreviewHeight = attributes.getDimensionPixelSize(attr, 80) R.styleable.MyKeyboardView_keyPreviewHeight -> mPreviewHeight = attributes.getDimensionPixelSize(attr, 80)
R.styleable.MyKeyboardView_keyTextSize -> mKeyTextSize = attributes.getDimensionPixelSize(attr, 18) R.styleable.MyKeyboardView_keyTextSize -> mKeyTextSize = attributes.getDimensionPixelSize(attr, 18)
R.styleable.MyKeyboardView_labelTextSize -> mLabelTextSize = attributes.getDimensionPixelSize(attr, 14) R.styleable.MyKeyboardView_labelTextSize -> mLabelTextSize = attributes.getDimensionPixelSize(attr, 14)
R.styleable.MyKeyboardView_popupLayout -> mPopupLayout = attributes.getResourceId(attr, 0) R.styleable.MyKeyboardView_popupLayout -> mPopupLayout = attributes.getResourceId(attr, 0)
R.styleable.MyKeyboardView_shadowColor -> mShadowColor = attributes.getColor(attr, 0)
R.styleable.MyKeyboardView_shadowRadius -> mShadowRadius = attributes.getFloat(attr, 0f)
} }
} }
} finally { } finally {
@ -778,7 +772,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
if (!mPreviewCentered) { if (!mPreviewCentered) {
mPopupPreviewX = key.x - mPreviewText!!.paddingLeft + paddingLeft mPopupPreviewX = key.x - mPreviewText!!.paddingLeft + paddingLeft
mPopupPreviewY = key.y - popupHeight + mPreviewOffset mPopupPreviewY = key.y - popupHeight
} else { } else {
// TODO: Fix this if centering is brought back // TODO: Fix this if centering is brought back
mPopupPreviewX = 160 - mPreviewText!!.measuredWidth / 2 mPopupPreviewX = 160 - mPreviewText!!.measuredWidth / 2

View File

@ -17,21 +17,12 @@
<attr name="keyTextColor" format="color" /> <attr name="keyTextColor" format="color" />
<!-- Layout resource for key press feedback. --> <!-- Layout resource for key press feedback. -->
<attr name="keyPreviewLayout" format="reference" /> <attr name="keyPreviewLayout" format="reference" />
<!-- Vertical offset of the key press feedback from the key. -->
<attr name="keyPreviewOffset" format="dimension" />
<!-- Height of the key press feedback popup. --> <!-- Height of the key press feedback popup. -->
<attr name="keyPreviewHeight" format="dimension" /> <attr name="keyPreviewHeight" format="dimension" />
<!-- Amount to offset the touch Y coordinate by, for bias correction. --> <!-- Amount to offset the touch Y coordinate by, for bias correction. -->
<attr name="verticalCorrection" format="dimension" /> <attr name="verticalCorrection" format="dimension" />
<!-- Layout resource for popup keyboards. --> <!-- Layout resource for popup keyboards. -->
<attr name="popupLayout" format="reference" /> <attr name="popupLayout" format="reference" />
<attr name="shadowColor" format="color" />
<!-- Horizontal offset of the text shadow. -->
<attr name="shadowDx" format="dimension" />
<!-- Vertical offset of the text shadow. -->
<attr name="shadowDy" format="dimension" />
<!-- Blur radius of the text shadow. -->
<attr name="shadowRadius" format="float" />
</declare-styleable> </declare-styleable>
<declare-styleable name="MyKeyboard"> <declare-styleable name="MyKeyboard">

View File

@ -11,13 +11,10 @@
<item name="keyTextSize">22sp</item> <item name="keyTextSize">22sp</item>
<item name="keyTextColor">#FFFFFFFF</item> <item name="keyTextColor">#FFFFFFFF</item>
<item name="keyPreviewLayout">@layout/keyboard_key_preview</item> <item name="keyPreviewLayout">@layout/keyboard_key_preview</item>
<item name="keyPreviewOffset">0dp</item>
<item name="keyPreviewHeight">60dp</item> <item name="keyPreviewHeight">60dp</item>
<item name="labelTextSize">16sp</item> <item name="labelTextSize">16sp</item>
<item name="popupLayout">@layout/keyboard_popup_keyboard</item> <item name="popupLayout">@layout/keyboard_popup_keyboard</item>
<item name="verticalCorrection">-10dp</item> <item name="verticalCorrection">-10dp</item>
<item name="shadowColor">#BB000000</item>
<item name="shadowRadius">2.75</item>
</style> </style>
<style name="Widget.KeyboardViewPopup" parent="Widget.KeyboardView"> <style name="Widget.KeyboardViewPopup" parent="Widget.KeyboardView">