mirror of
https://github.com/SimpleMobileTools/Simple-Keyboard.git
synced 2025-02-06 04:43: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 {
|
val systemFontPaint = Paint().apply {
|
||||||
typeface = Typeface.DEFAULT
|
typeface = Typeface.DEFAULT
|
||||||
}
|
}
|
||||||
|
|
||||||
val emojis = fullEmojiList.filter { emoji ->
|
val emojis = fullEmojiList.filter { emoji ->
|
||||||
systemFontPaint.hasGlyph(emoji) || EmojiCompat.get().getEmojiMatch(emoji, emojiCompatMetadataVersion) == EMOJI_SUPPORTED
|
systemFontPaint.hasGlyph(emoji) || EmojiCompat.get().getEmojiMatch(emoji, emojiCompatMetadataVersion) == EMOJI_SUPPORTED
|
||||||
}
|
}
|
||||||
|
|
||||||
Handler(Looper.getMainLooper()).post {
|
Handler(Looper.getMainLooper()).post {
|
||||||
setupEmojiAdapter(emojis)
|
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 emojiItemWidth = context.resources.getDimensionPixelSize(R.dimen.emoji_item_size)
|
||||||
val emojiTopBarElevation = context.resources.getDimensionPixelSize(R.dimen.emoji_top_bar_elevation).toFloat()
|
val emojiTopBarElevation = context.resources.getDimensionPixelSize(R.dimen.emoji_top_bar_elevation).toFloat()
|
||||||
|
|
||||||
mEmojiPaletteHolder!!.emojis_list.apply {
|
mEmojiPaletteHolder?.emojis_list?.apply {
|
||||||
layoutManager = AutoGridLayoutManager(context, emojiItemWidth)
|
layoutManager = AutoGridLayoutManager(context, emojiItemWidth)
|
||||||
adapter = EmojisAdapter(context = context, items = emojis) { emoji ->
|
adapter = EmojisAdapter(context = context, items = emojis) { emoji ->
|
||||||
mOnKeyboardActionListener!!.onText(emoji)
|
mOnKeyboardActionListener!!.onText(emoji)
|
||||||
vibrateIfNeeded()
|
vibrateIfNeeded()
|
||||||
}
|
}
|
||||||
|
|
||||||
onScroll {
|
onScroll {
|
||||||
mEmojiPaletteHolder!!.emoji_palette_top_bar.elevation = if (it > 4) emojiTopBarElevation else 0f
|
mEmojiPaletteHolder!!.emoji_palette_top_bar.elevation = if (it > 4) emojiTopBarElevation else 0f
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user