private void inflateScrollView ( @ NonNull final ScrollableArea scrollableArea ) { if ( scrollView == null ) { LayoutInflater layoutInflater = LayoutInflater . from ( getContext ( ) ) ; scrollView = ( ScrollView ) layoutInflater . inflate ( R . layout . material_dialog_scroll_view , this , false ) ; scrollView . addScrollListener ( createScrollViewScrollListener ( ) ) ; scrollView . setDescendantFocusability ( ViewGroup . FOCUS_BEFORE_DESCENDANTS ) ; scrollView . setFocusableInTouchMode ( true ) ; if ( scrollableArea . getBottomScrollableArea ( ) . getIndex ( ) - scrollableArea . getTopScrollableArea ( ) . getIndex ( ) > 0 ) { LinearLayout scrollContainer = new LinearLayout ( getContext ( ) ) ; scrollContainer . setOrientation ( LinearLayout . VERTICAL ) ; scrollView . addView ( scrollContainer , ScrollView . LayoutParams . MATCH_PARENT , ScrollView . LayoutParams . MATCH_PARENT ) ; } addView ( scrollView ) ; } }
Inflates the scroll view which contains the dialog s scrollable areas if it has not been inflated yet .