removing the unused iconPreview key attribute too

This commit is contained in:
tibbi 2022-01-21 20:47:56 +01:00
parent 74b1fcbb75
commit 6323103b23
6 changed files with 1 additions and 19 deletions

View File

@ -151,7 +151,6 @@ class MyKeyboard {
* @attr ref android.R.styleable#Keyboard_Key_codes * @attr ref android.R.styleable#Keyboard_Key_codes
* @attr ref android.R.styleable#Keyboard_Key_keyIcon * @attr ref android.R.styleable#Keyboard_Key_keyIcon
* @attr ref android.R.styleable#Keyboard_Key_keyLabel * @attr ref android.R.styleable#Keyboard_Key_keyLabel
* @attr ref android.R.styleable#Keyboard_Key_iconPreview
* @attr ref android.R.styleable#Keyboard_Key_isRepeatable * @attr ref android.R.styleable#Keyboard_Key_isRepeatable
* @attr ref android.R.styleable#Keyboard_Key_popupKeyboard * @attr ref android.R.styleable#Keyboard_Key_popupKeyboard
* @attr ref android.R.styleable#Keyboard_Key_popupCharacters * @attr ref android.R.styleable#Keyboard_Key_popupCharacters
@ -170,9 +169,6 @@ class MyKeyboard {
/** Icon to display instead of a label. Icon takes precedence over a label */ /** Icon to display instead of a label. Icon takes precedence over a label */
var icon: Drawable? = null var icon: Drawable? = null
/** Preview version of the icon, for the preview popup */
var iconPreview: Drawable? = null
/** Width of the key, not including the gap */ /** Width of the key, not including the gap */
var width: Int var width: Int
@ -241,9 +237,6 @@ class MyKeyboard {
codes = parseCSV(codesValue.string.toString()) codes = parseCSV(codesValue.string.toString())
} }
iconPreview = a.getDrawable(R.styleable.MyKeyboard_Key_iconPreview)
iconPreview?.setBounds(0, 0, iconPreview!!.intrinsicWidth, iconPreview!!.intrinsicHeight)
popupCharacters = a.getText(R.styleable.MyKeyboard_Key_popupCharacters) popupCharacters = a.getText(R.styleable.MyKeyboard_Key_popupCharacters)
popupResId = a.getResourceId(R.styleable.MyKeyboard_Key_popupKeyboard, 0) popupResId = a.getResourceId(R.styleable.MyKeyboard_Key_popupKeyboard, 0)
repeatable = a.getBoolean(R.styleable.MyKeyboard_Key_isRepeatable, false) repeatable = a.getBoolean(R.styleable.MyKeyboard_Key_isRepeatable, false)

View File

@ -670,12 +670,7 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
val key = keys[keyIndex] val key = keys[keyIndex]
if (key.icon != null) { if (key.icon != null) {
val bottomDrawable = if (key.iconPreview != null) { mPreviewText!!.setCompoundDrawables(null, null, null, key.icon)
key.iconPreview
} else {
key.icon
}
mPreviewText!!.setCompoundDrawables(null, null, null, bottomDrawable)
} else { } else {
mPreviewText!!.setCompoundDrawables(null, null, null, null) mPreviewText!!.setCompoundDrawables(null, null, null, null)
try { try {

View File

@ -29,8 +29,6 @@
</attr> </attr>
<!-- Whether long-pressing on this key will make it repeat. --> <!-- Whether long-pressing on this key will make it repeat. -->
<attr name="isRepeatable" format="boolean" /> <attr name="isRepeatable" format="boolean" />
<!-- The icon to show in the popup preview. -->
<attr name="iconPreview" format="reference" />
<!-- The label to display on the key. --> <!-- The label to display on the key. -->
<attr name="keyLabel" format="string" /> <attr name="keyLabel" format="string" />
<!-- The icon to display on the key instead of the label. --> <!-- The icon to display on the key instead of the label. -->

View File

@ -138,7 +138,6 @@
app:keyLabel="m" /> app:keyLabel="m" />
<Key <Key
app:codes="-5" app:codes="-5"
app:iconPreview="@null"
app:isRepeatable="true" app:isRepeatable="true"
app:keyEdgeFlags="right" app:keyEdgeFlags="right"
app:keyIcon="@drawable/ic_clear_vector" app:keyIcon="@drawable/ic_clear_vector"
@ -156,7 +155,6 @@
app:keyWidth="10%p" /> app:keyWidth="10%p" />
<Key <Key
app:codes="32" app:codes="32"
app:iconPreview="@null"
app:isRepeatable="true" app:isRepeatable="true"
app:keyWidth="45%p" /> app:keyWidth="45%p" />
<Key <Key

View File

@ -114,7 +114,6 @@
app:keyWidth="10%p" /> app:keyWidth="10%p" />
<Key <Key
app:codes="32" app:codes="32"
app:iconPreview="@null"
app:isRepeatable="true" app:isRepeatable="true"
app:keyWidth="45%p" /> app:keyWidth="45%p" />
<Key <Key

View File

@ -114,7 +114,6 @@
app:keyWidth="10%p" /> app:keyWidth="10%p" />
<Key <Key
app:codes="32" app:codes="32"
app:iconPreview="@null"
app:isRepeatable="true" app:isRepeatable="true"
app:keyWidth="45%p" /> app:keyWidth="45%p" />
<Key <Key