Package 

Class SpanBackgroundHelper


  • 
    public final class SpanBackgroundHelper
    
                        

    Helper class to draw multi-line rounded background to certain parts of a text. The start/end positions of the backgrounds are annotated with android.text.Annotation class. Each annotation should have the annotation key set to rounded.

    i.e.:

        <!--without the quotes at the begining and end Android strips the whitespace and also starts
            the annotation at the wrong position-->
        <string name="ltr">"this is <annotation key="rounded">a regular</annotation> paragraph."</string>

    Note: BiDi text is not supported.

    • Constructor Detail

      • SpanBackgroundHelper

        SpanBackgroundHelper(Class<?> spanType, Integer horizontalPadding, Integer verticalPadding, Drawable drawable, Drawable drawableLeft, Drawable drawableMid, Drawable drawableRight)
        Parameters:
        horizontalPadding - the padding to be applied to left & right of the background
        verticalPadding - the padding to be applied to top & bottom of the background
        drawable - the drawable used to draw the background
        drawableLeft - the drawable used to draw left edge of the background
        drawableMid - the drawable used to draw for whole line
        drawableRight - the drawable used to draw right edge of the background