Avoid null pointer exception

This commit is contained in:
Naveen 2022-08-12 23:27:25 +05:30
parent 3f06b3516e
commit 888667ded5

View File

@ -1465,10 +1465,10 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
}
private fun setupEmojiAdapter(emojis: List<String>) {
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 {
val emojiItemWidth = context.resources.getDimensionPixelSize(R.dimen.emoji_item_size)
val emojiTopBarElevation = context.resources.getDimensionPixelSize(R.dimen.emoji_top_bar_elevation).toFloat()
layoutManager = AutoGridLayoutManager(context, emojiItemWidth)
adapter = EmojisAdapter(context = context, items = emojis) { emoji ->
mOnKeyboardActionListener!!.onText(emoji)