Skip to content

Commit

Permalink
Merge pull request #741 from Automattic/fix/crash-emoji-picker-params
Browse files Browse the repository at this point in the history
Fix EmojiPicker crash when getting LayoutParams
  • Loading branch information
thomashorta authored Sep 13, 2023
2 parents c8e238b + c52f62a commit e1d5088
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ class EmojiPickerFragment : BottomSheetDialogFragment() {
super.setupDialog(dialog, style)
activity?.let { activity ->
val binding = FragmentBottomStickerEmojiDialogBinding.inflate(LayoutInflater.from(context))
// val contentView = View.inflate(context, R.layout.fragment_bottom_sticker_emoji_dialog, null)
dialog.setContentView(binding.root)
val params = binding.root.layoutParams as CoordinatorLayout.LayoutParams
val params = (binding.root.parent as View).layoutParams as CoordinatorLayout.LayoutParams

@Suppress("DEPRECATION")
(params.behavior as? BottomSheetBehavior)?.setBottomSheetCallback(bottomSheetBehaviorCallback)
Expand Down

0 comments on commit e1d5088

Please sign in to comment.