Commit 8040652b authored by Leonardo Aramaki's avatar Leonardo Aramaki

Add null-safety checks

parent fa1f3266
...@@ -80,44 +80,44 @@ class EmojiKeyboardPopup(context: Context, view: View) : OverKeyboardPopupWindow ...@@ -80,44 +80,44 @@ class EmojiKeyboardPopup(context: Context, view: View) : OverKeyboardPopupWindow
.setCancelable(true) .setCancelable(true)
.create() .create()
view.findViewById<TextView>(R.id.default_tone_text).also { view.findViewById<TextView>(R.id.default_tone_text)?.also {
it.text = EmojiParser.parse(it.text) it.text = EmojiParser.parse(it.text)
}.setOnClickListener { }?.setOnClickListener {
dialog.dismiss() dialog.dismiss()
changeSkinTone(Fitzpatrick.Default) changeSkinTone(Fitzpatrick.Default)
} }
view.findViewById<TextView>(R.id.light_tone_text).also { view.findViewById<TextView>(R.id.light_tone_text)?.also {
it.text = EmojiParser.parse(it.text) it.text = EmojiParser.parse(it.text)
}.setOnClickListener { }?.setOnClickListener {
dialog.dismiss() dialog.dismiss()
changeSkinTone(Fitzpatrick.LightTone) changeSkinTone(Fitzpatrick.LightTone)
} }
view.findViewById<TextView>(R.id.medium_light_text).also { view.findViewById<TextView>(R.id.medium_light_text)?.also {
it.text = EmojiParser.parse(it.text) it.text = EmojiParser.parse(it.text)
}.setOnClickListener { }?.setOnClickListener {
dialog.dismiss() dialog.dismiss()
changeSkinTone(Fitzpatrick.MediumLightTone) changeSkinTone(Fitzpatrick.MediumLightTone)
} }
view.findViewById<TextView>(R.id.medium_image_view).also { view.findViewById<TextView>(R.id.medium_image_view)?.also {
it.text = EmojiParser.parse(it.text) it.text = EmojiParser.parse(it.text)
}.setOnClickListener { }?.setOnClickListener {
dialog.dismiss() dialog.dismiss()
changeSkinTone(Fitzpatrick.MediumTone) changeSkinTone(Fitzpatrick.MediumTone)
} }
view.findViewById<TextView>(R.id.medium_dark_tone_text).also { view.findViewById<TextView>(R.id.medium_dark_tone_text)?.also {
it.text = EmojiParser.parse(it.text) it.text = EmojiParser.parse(it.text)
}.setOnClickListener { }?.setOnClickListener {
dialog.dismiss() dialog.dismiss()
changeSkinTone(Fitzpatrick.MediumDarkTone) changeSkinTone(Fitzpatrick.MediumDarkTone)
} }
view.findViewById<TextView>(R.id.dark_tone_text).also { view.findViewById<TextView>(R.id.dark_tone_text)?.also {
it.text = EmojiParser.parse(it.text) it.text = EmojiParser.parse(it.text)
}.setOnClickListener { }?.setOnClickListener {
dialog.dismiss() dialog.dismiss()
changeSkinTone(Fitzpatrick.DarkTone) changeSkinTone(Fitzpatrick.DarkTone)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment