public SnackbarWrapper buildWrapper ( ) { Snackbar snackbar = Snackbar . make ( parentView , message , duration ) ; SnackbarWrapper wrapper = new SnackbarWrapper ( snackbar ) . setAction ( actionText , sanitisedActionClickListener ( ) ) . setActionTextAllCaps ( actionAllCaps ) . addCallbacks ( callbacks ) . setIconMargin ( iconMargin ) ; if ( actionTextColor != 0 ) { wrapper . setActionTextColor ( actionTextColor ) ; } if ( messageTextColor != 0 ) { wrapper . setTextColor ( messageTextColor ) ; } if ( appendMessages != null ) { wrapper . appendMessage ( appendMessages ) ; } if ( backgroundColor != 0 ) { wrapper . setBackgroundColor ( backgroundColor ) ; } if ( icon != null ) { wrapper . setIcon ( icon ) ; } return wrapper ; }
Build a Snackbar using the options specified in the builder . Wrap this Snackbar into a SnackbarWrapper which allows further customisation .