mirror of
https://github.com/SimpleMobileTools/Simple-Keyboard.git
synced 2025-01-28 17:09:17 +01:00
adding a crashfix at long pressing letters
This commit is contained in:
parent
3799ba0211
commit
d5a8c1a68d
@ -1453,9 +1453,11 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
|
||||
val systemFontPaint = Paint().apply {
|
||||
typeface = Typeface.DEFAULT
|
||||
}
|
||||
|
||||
val emojis = fullEmojiList.filter { emoji ->
|
||||
systemFontPaint.hasGlyph(emoji) || EmojiCompat.get().getEmojiMatch(emoji, emojiCompatMetadataVersion) == EMOJI_SUPPORTED
|
||||
}
|
||||
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
setupEmojiAdapter(emojis)
|
||||
}
|
||||
@ -1466,12 +1468,13 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
|
||||
val emojiItemWidth = context.resources.getDimensionPixelSize(R.dimen.emoji_item_size)
|
||||
val emojiTopBarElevation = context.resources.getDimensionPixelSize(R.dimen.emoji_top_bar_elevation).toFloat()
|
||||
|
||||
mEmojiPaletteHolder!!.emojis_list.apply {
|
||||
mEmojiPaletteHolder?.emojis_list?.apply {
|
||||
layoutManager = AutoGridLayoutManager(context, emojiItemWidth)
|
||||
adapter = EmojisAdapter(context = context, items = emojis) { emoji ->
|
||||
mOnKeyboardActionListener!!.onText(emoji)
|
||||
vibrateIfNeeded()
|
||||
}
|
||||
|
||||
onScroll {
|
||||
mEmojiPaletteHolder!!.emoji_palette_top_bar.elevation = if (it > 4) emojiTopBarElevation else 0f
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user