mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-22 07:09:10 +00:00
remove popup label when the popup key is removed
This commit is contained in:
parent
2ad45af856
commit
d25df2c4de
2 changed files with 10 additions and 1 deletions
|
@ -327,7 +327,7 @@ public class Key implements Comparable<Key> {
|
||||||
// Final attributes.
|
// Final attributes.
|
||||||
mCode = key.mCode;
|
mCode = key.mCode;
|
||||||
mLabel = key.mLabel;
|
mLabel = key.mLabel;
|
||||||
mHintLabel = key.mHintLabel;
|
mHintLabel = PopopUtilKt.findPopupHintLabel(popupKeys, key.mHintLabel);
|
||||||
mLabelFlags = key.mLabelFlags;
|
mLabelFlags = key.mLabelFlags;
|
||||||
mIconName = key.mIconName;
|
mIconName = key.mIconName;
|
||||||
mWidth = key.mWidth;
|
mWidth = key.mWidth;
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
package helium314.keyboard.keyboard
|
||||||
|
|
||||||
|
import helium314.keyboard.keyboard.internal.PopupKeySpec
|
||||||
|
|
||||||
|
fun findPopupHintLabel(popupKeys: Array<PopupKeySpec>?, oldHintLabel: String?): String? {
|
||||||
|
if (popupKeys == null || oldHintLabel == null) return null
|
||||||
|
if (popupKeys.any { it.mLabel == oldHintLabel }) return oldHintLabel
|
||||||
|
return popupKeys.firstOrNull { it.mLabel != null }?.mLabel
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue