Added in API level 1

LineBackgroundSpan


public interface LineBackgroundSpan
implements ParagraphStyle

android.text.style.LineBackgroundSpan


Used to change the background of lines where the span is attached to.

Summary

Nested classes

class LineBackgroundSpan.Standard

Default implementation of the LineBackgroundSpan, which changes the background color of the lines to which the span is attached. 

Public methods

abstract void drawBackground(Canvas canvas, Paint paint, int left, int right, int top, int baseline, int bottom, CharSequence text, int start, int end, int lineNumber)

Draw the background on the canvas.

Public methods

drawBackground

Added in API level 1
public abstract void drawBackground (Canvas canvas, 
                Paint paint, 
                int left, 
                int right, 
                int top, 
                int baseline, 
                int bottom, 
                CharSequence text, 
                int start, 
                int end, 
                int lineNumber)

Draw the background on the canvas.

Parameters
canvas Canvas: canvas on which the span should be rendered This value cannot be null.

paint Paint: paint used to draw text, which should be left unchanged on exit This value cannot be null.

left int: left position of the line relative to input canvas, in pixels The units of this value are pixels.

right int: right position of the line relative to input canvas, in pixels The units of this value are pixels.

top int: top position of the line relative to input canvas, in pixels The units of this value are pixels.

baseline int: baseline of the text relative to input canvas, in pixels The units of this value are pixels.

bottom int: bottom position of the line relative to input canvas, in pixels The units of this value are pixels.

text CharSequence: current text This value cannot be null.

start int: start character index of the line

end int: end character index of the line

lineNumber int: line number in the current text layout