当前位置: 首页>>代码示例>>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;未经允许,请勿转载。