I have designed an layout in which LinearLayout has 2 children LinearLayout and FrameLayout and in each child I put different views.>
LinearLayout
FrameLayout
Just wanted to add an answer here, since Koltin has some convenience methods to do this, which are a lot less ugly than adding and removing a onGlobalLayoutListener:
onGlobalLayoutListener
view.doOnLayout { it.measuredWidth it.measuredHeight }
You can see more of the convinience methods here.