本文整理匯總了Java中com.onegravity.rteditor.spans.RTParagraphSpan類的典型用法代碼示例。如果您正苦於以下問題:Java RTParagraphSpan類的具體用法?Java RTParagraphSpan怎麽用?Java RTParagraphSpan使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RTParagraphSpan類屬於com.onegravity.rteditor.spans包,在下文中一共展示了RTParagraphSpan類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: process
import com.onegravity.rteditor.spans.RTParagraphSpan; //導入依賴的package包/類
void process(Spannable str) {
for (ParagraphSpan paragraphSpan : mParagraphSpans) {
RTParagraphSpan<V> span = paragraphSpan.mSpan;
int paraStart = paragraphSpan.mParagraph.start();
if (paragraphSpan.mRemove) {
int spanStart = str.getSpanStart(span);
if (spanStart > -1 && spanStart < paraStart) {
// process preceding spans
str.setSpan(span.createClone(), spanStart, paraStart, Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
}
str.removeSpan(span);
}
else {
Paragraph paragraph = paragraphSpan.mParagraph;
int paraEnd = paragraphSpan.mParagraph.end();
int flags = paragraph.isLast() && paragraph.isEmpty() ? Spanned.SPAN_INCLUSIVE_INCLUSIVE :
paragraph.isLast() && paragraph.isFirst() ? Spanned.SPAN_INCLUSIVE_INCLUSIVE :
paragraph.isLast() ? Spanned.SPAN_EXCLUSIVE_INCLUSIVE :
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE;
str.setSpan(span, paraStart, paraEnd, flags);
}
}
}
示例2: ParagraphSpan
import com.onegravity.rteditor.spans.RTParagraphSpan; //導入依賴的package包/類
ParagraphSpan(RTParagraphSpan<V> span, Paragraph paragraph, boolean remove) {
mSpan = span;
mParagraph = paragraph;
mRemove = remove;
}
示例3: removeSpan
import com.onegravity.rteditor.spans.RTParagraphSpan; //導入依賴的package包/類
void removeSpan(RTSpan<V> span, Paragraph paragraph) {
if (span instanceof RTParagraphSpan) {
mParagraphSpans.add(new ParagraphSpan<>((RTParagraphSpan<V>) span, paragraph, true));
}
}
示例4: addSpan
import com.onegravity.rteditor.spans.RTParagraphSpan; //導入依賴的package包/類
void addSpan(RTParagraphSpan<V> span, Paragraph paragraph) {
mParagraphSpans.add(new ParagraphSpan<>(span, paragraph, false) );
}
示例5: removeSpan
import com.onegravity.rteditor.spans.RTParagraphSpan; //導入依賴的package包/類
void removeSpan(RTSpan<V> span, Paragraph paragraph) {
if (span instanceof RTParagraphSpan) {
mParagraphSpans.add(new ParagraphSpan<V>((RTParagraphSpan<V>) span, paragraph, true));
}
}
示例6: addSpan
import com.onegravity.rteditor.spans.RTParagraphSpan; //導入依賴的package包/類
void addSpan(RTParagraphSpan<V> span, Paragraph paragraph) {
mParagraphSpans.add( new ParagraphSpan<V>(span, paragraph, false) );
}