/ TextView

A simpler way to style your TextViews

A simpler way to style your TextViews

BabushkaText

BabushkaText is a custom TextView which lets you customize the styling of parts of your text via Spannables, but without the hassle of having to deal directly with Spannable themselves.

What-can-I-do-with-Babushka

Create complex style structures for your text without having to add multiple TextViews to your view hierarchy.

Eliminate setSpan(Object what, int start, int end, int flags) calls by using more convenient methods such as .style(Typeface.BOLD), .superscript() and others.

What can I do with BabushkaText?

Examples of different styles. Each one is a single TextView.

| underline | UnderlineSpan |
| strike | StrikethroughSpan |
| superscript | SuperscriptSpan |
| subscript | SubscriptSpan |

What else can I do?

Once you've created and displayed your BabushkaText, you can modify the text contents of each
Piece individually. For example, if we want to change the 1.2 mi from the above example into
1.9 km, we could do the following:

// grab the Piece at position 1
Piece piece = babushka.getPiece(1);

// modify it's text
piece.setText("1.9 km ");

// you must always call display after you alter a Piece's text
babushka.display();

GitHub