use of android.text.style.QuoteSpan in project Knife by mthli.
the class KnifeText method switchToKnifeStyle.
protected void switchToKnifeStyle(Editable editable, int start, int end) {
BulletSpan[] bulletSpans = editable.getSpans(start, end, BulletSpan.class);
for (BulletSpan span : bulletSpans) {
int spanStart = editable.getSpanStart(span);
int spanEnd = editable.getSpanEnd(span);
spanEnd = 0 < spanEnd && spanEnd < editable.length() && editable.charAt(spanEnd) == '\n' ? spanEnd - 1 : spanEnd;
editable.removeSpan(span);
editable.setSpan(new KnifeBulletSpan(bulletColor, bulletRadius, bulletGapWidth), spanStart, spanEnd, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
QuoteSpan[] quoteSpans = editable.getSpans(start, end, QuoteSpan.class);
for (QuoteSpan span : quoteSpans) {
int spanStart = editable.getSpanStart(span);
int spanEnd = editable.getSpanEnd(span);
spanEnd = 0 < spanEnd && spanEnd < editable.length() && editable.charAt(spanEnd) == '\n' ? spanEnd - 1 : spanEnd;
editable.removeSpan(span);
editable.setSpan(new KnifeQuoteSpan(quoteColor, quoteStripeWidth, quoteGapWidth), spanStart, spanEnd, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
URLSpan[] urlSpans = editable.getSpans(start, end, URLSpan.class);
for (URLSpan span : urlSpans) {
int spanStart = editable.getSpanStart(span);
int spanEnd = editable.getSpanEnd(span);
editable.removeSpan(span);
editable.setSpan(new KnifeURLSpan(span.getURL(), linkColor, linkUnderline), spanStart, spanEnd, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
}
use of android.text.style.QuoteSpan in project platform_frameworks_base by android.
the class HtmlToSpannedConverter method withinDiv.
private static void withinDiv(StringBuilder out, Spanned text, int start, int end, int option) {
int next;
for (int i = start; i < end; i = next) {
next = text.nextSpanTransition(i, end, QuoteSpan.class);
QuoteSpan[] quotes = text.getSpans(i, next, QuoteSpan.class);
for (QuoteSpan quote : quotes) {
out.append("<blockquote>");
}
withinBlockquote(out, text, i, next, option);
for (QuoteSpan quote : quotes) {
out.append("</blockquote>\n");
}
}
}
use of android.text.style.QuoteSpan in project XobotOS by xamarin.
the class HtmlToSpannedConverter method withinDiv.
private static void withinDiv(StringBuilder out, Spanned text, int start, int end) {
int next;
for (int i = start; i < end; i = next) {
next = text.nextSpanTransition(i, end, QuoteSpan.class);
QuoteSpan[] quotes = text.getSpans(i, next, QuoteSpan.class);
for (QuoteSpan quote : quotes) {
out.append("<blockquote>");
}
withinBlockquote(out, text, i, next);
for (QuoteSpan quote : quotes) {
out.append("</blockquote>\n");
}
}
}
use of android.text.style.QuoteSpan in project android_frameworks_base by DirtyUnicorns.
the class HtmlToSpannedConverter method withinDiv.
private static void withinDiv(StringBuilder out, Spanned text, int start, int end, int option) {
int next;
for (int i = start; i < end; i = next) {
next = text.nextSpanTransition(i, end, QuoteSpan.class);
QuoteSpan[] quotes = text.getSpans(i, next, QuoteSpan.class);
for (QuoteSpan quote : quotes) {
out.append("<blockquote>");
}
withinBlockquote(out, text, i, next, option);
for (QuoteSpan quote : quotes) {
out.append("</blockquote>\n");
}
}
}
use of android.text.style.QuoteSpan in project android_frameworks_base by DirtyUnicorns.
the class HtmlToSpannedConverter method endBlockquote.
private static void endBlockquote(Editable text) {
endBlockElement(text);
end(text, Blockquote.class, new QuoteSpan());
}
Aggregations