Crouton: use Builder to set custom font and textSize

79 Views Asked by At

Crouton library has Builder class that has some methods such as setTextSize(), setFontName() and etc. How can I use this class to change default this library configuration?

For example:

Crouton.makeText(activity, "HELLO" , Style.ALERT, rootLayout).show();

How can I use a builder for this line?

1

There are 1 best solutions below

0
On BEST ANSWER

As long as I could understand your question, you want something like this:



import de.keyboardsurfer.android.widget.crouton.Style.Builder;

Crouton.makeText(activity, "HELLO" , new Style.Builder()
                                                .setTextSize(12)
                                                .setFontName(someFontName)
                                                ...
                                                .build(),
                                     rootLayout)
                                     .show();