@ NonNull private Divider addDivider ( ) { Divider divider = new Divider ( getContext ( ) ) ; divider . setVisibility ( View . INVISIBLE ) ; divider . setBackgroundColor ( dividerColor ) ; LayoutParams layoutParams = new LayoutParams ( LayoutParams . MATCH_PARENT , dpToPixels ( getContext ( ) , 1 ) ) ; layoutParams . leftMargin = dividerMargin ; layoutParams . rightMargin = dividerMargin ; addView ( divider , layoutParams ) ; return divider ; }
Adds a divider to the view .