/** * Set the text that this SnackBar is to display. * @param id The resourceId of text is displayed. * @return This SnackBar for chaining methods. */ public SnackBar text(int id){ return text(getContext().getResources().getString(id)); }
/** * Sets the text color, size, style from the specified TextAppearance resource. * @param resId The resourceId value. * @return This SnackBar for chaining methods. */ public SnackBar textAppearance(int resId){ if(resId != 0) mText.setTextAppearance(getContext(), resId); return this; }
/** * Sets the text color, size, style of the ActionButton from the specified TextAppearance resource. * @param resId The resourceId value. * @return This SnackBar for chaining methods. */ public SnackBar actionTextAppearance(int resId){ if(resId != 0) mAction.setTextAppearance(getContext(), resId); return this; }
/** * Set the text that the ActionButton is to display. * @param id If 0, then the ActionButton will be hidden. * @return This SnackBar for chaining methods. */ public SnackBar actionText(int id){ if(id == 0) return actionText(null); return actionText(getContext().getResources().getString(id)); }
/** * Set the style of RippleEffect of the ActionButton. * @param resId The resourceId of RippleEffect. * @return This SnackBar for chaining methods. */ public SnackBar actionRipple(int resId){ if(resId != 0) ViewUtil.setBackground(mAction, new RippleDrawable.Builder(getContext(), resId).build()); return this; }
removeOnDismiss(a.getBoolean(attr, true)); else if(attr == R.styleable.SnackBar_sb_inAnimation) animationIn(AnimationUtils.loadAnimation(getContext(), a.getResourceId(attr, 0))); else if(attr == R.styleable.SnackBar_sb_outAnimation) animationOut(AnimationUtils.loadAnimation(getContext(), a.getResourceId(attr, 0)));