FileDocCategorySizeDatePackage
LeadingMarginSpan.javaAPI DocAndroid 5.1 API5591Thu Mar 12 22:22:10 GMT 2015android.text.style

LeadingMarginSpan

public interface LeadingMarginSpan implements ParagraphStyle
A paragraph style affecting the leading margin. There can be multiple leading margin spans on a single paragraph; they will be rendered in order, each adding its margin to the ones before it. The leading margin is on the right for lines in a right-to-left paragraph.

LeadingMarginSpans should be attached from the first character to the last character of a single paragraph.

Fields Summary
Constructors Summary
Methods Summary
public voiddrawLeadingMargin(android.graphics.Canvas c, android.graphics.Paint p, int x, int dir, int top, int baseline, int bottom, java.lang.CharSequence text, int start, int end, boolean first, android.text.Layout layout)
Renders the leading margin. This is called before the margin has been adjusted by the value returned by {@link #getLeadingMargin(boolean)}.

param
c the canvas
param
p the paint. The this should be left unchanged on exit.
param
x the current position of the margin
param
dir the base direction of the paragraph; if negative, the margin is to the right of the text, otherwise it is to the left.
param
top the top of the line
param
baseline the baseline of the line
param
bottom the bottom of the line
param
text the text
param
start the start of the line
param
end the end of the line
param
first true if this is the first line of its paragraph
param
layout the layout containing this line

public intgetLeadingMargin(boolean first)
Returns the amount by which to adjust the leading margin. Positive values move away from the leading edge of the paragraph, negative values move towards it.

param
first true if the request is for the first line of a paragraph, false for subsequent lines
return
the offset for the margin.