/** * Returns a standard {@value #TAG} with specified animations. * * @param activity {@link android.app.Activity} * @param textCharSequence {@link CharSequence} * @param durationInteger {@link com.github.johnpersano.supertoasts.SuperToast.Duration} * @param animations {@link com.github.johnpersano.supertoasts.SuperToast.Animations} * * @return {@link SuperActivityToast} */ public static SuperActivityToast create(Activity activity, CharSequence textCharSequence, int durationInteger, Animations animations) { final SuperActivityToast superActivityToast = new SuperActivityToast(activity); superActivityToast.setText(textCharSequence); superActivityToast.setDuration(durationInteger); superActivityToast.setAnimations(animations); return superActivityToast; }
/** * Private method used to set a default style to the {@value #TAG} */ private void setStyle(Style style) { this.setAnimations(style.animations); this.setTypefaceStyle(style.typefaceStyle); this.setTextColor(style.textColor); this.setBackground(style.background); if (this.mType == Type.BUTTON) { this.setDividerColor(style.dividerColor); this.setButtonTextColor(style.buttonTextColor); } }
superActivityToast.setAnimations(referenceHolder.mAnimations); superActivityToast.setText(referenceHolder.mText); superActivityToast.setTypefaceStyle(referenceHolder.mTypefaceStyle);