Here's my code:
val inflater = LayoutInflater.from(this)
val popupView = inflater.inflate(R.layout.small_player, null)
val popupWindow = PopupWindow(popupView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT/*, focusable*/)
popupWindow.elevation = 1.0f
popupWindow.showAtLocation(window.decorView, Gravity.CENTER, 0, window.decorView.height)
val height = popupWindow.contentView.height //returns 0
I also tried with popupView.height
but it returns 0 and with popupWindow.contentView.layoutParams.height
that returned -1
So how can I get this height?