Search in sources :

Example 1 with AlignmentSpan

use of jp.sblo.pandora.jota.text.style.AlignmentSpan in project Jota-Text-Editor-old by jiro-aqua.

the class Layout method getParagraphAlignment.

/**
     * Get the alignment of the specified paragraph, taking into account
     * markup attached to it.
     */
public final Alignment getParagraphAlignment(int line) {
    Alignment align = mAlignment;
    if (mSpannedText) {
        Spanned sp = (Spanned) mText;
        AlignmentSpan[] spans = sp.getSpans(getLineStart(line), getLineEnd(line), AlignmentSpan.class);
        int spanLength = spans.length;
        if (spanLength > 0) {
            align = spans[spanLength - 1].getAlignment();
        }
    }
    return align;
}
Also used : AlignmentSpan(jp.sblo.pandora.jota.text.style.AlignmentSpan) Spanned(android.text.Spanned) TextPaint(android.text.TextPaint) Paint(android.graphics.Paint)

Aggregations

Paint (android.graphics.Paint)1 Spanned (android.text.Spanned)1 TextPaint (android.text.TextPaint)1 AlignmentSpan (jp.sblo.pandora.jota.text.style.AlignmentSpan)1