當前位置: 首頁>>代碼示例>>Java>>正文


Java RTParagraphSpan類代碼示例

本文整理匯總了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);
        }
    }
}
 
開發者ID:Ronak-LM,項目名稱:memoir,代碼行數:27,代碼來源:ParagraphSpanProcessor.java

示例2: ParagraphSpan

import com.onegravity.rteditor.spans.RTParagraphSpan; //導入依賴的package包/類
ParagraphSpan(RTParagraphSpan<V> span, Paragraph paragraph, boolean remove) {
    mSpan = span;
    mParagraph = paragraph;
    mRemove = remove;
}
 
開發者ID:Ronak-LM,項目名稱:memoir,代碼行數:6,代碼來源:ParagraphSpanProcessor.java

示例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));
    }
}
 
開發者ID:Ronak-LM,項目名稱:memoir,代碼行數:6,代碼來源:ParagraphSpanProcessor.java

示例4: addSpan

import com.onegravity.rteditor.spans.RTParagraphSpan; //導入依賴的package包/類
void addSpan(RTParagraphSpan<V> span, Paragraph paragraph) {
    mParagraphSpans.add(new ParagraphSpan<>(span, paragraph, false) );
}
 
開發者ID:Ronak-LM,項目名稱:memoir,代碼行數:4,代碼來源:ParagraphSpanProcessor.java

示例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));
    }
}
 
開發者ID:Ronak-LM,項目名稱:memoir,代碼行數:6,代碼來源:ParagraphSpanProcessor.java

示例6: addSpan

import com.onegravity.rteditor.spans.RTParagraphSpan; //導入依賴的package包/類
void addSpan(RTParagraphSpan<V> span, Paragraph paragraph) {
    mParagraphSpans.add( new ParagraphSpan<V>(span, paragraph, false) );
}
 
開發者ID:Ronak-LM,項目名稱:memoir,代碼行數:4,代碼來源:ParagraphSpanProcessor.java


注:本文中的com.onegravity.rteditor.spans.RTParagraphSpan類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。