本文整理汇总了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) );
}