本文整理汇总了Java中net.nightwhistler.htmlspanner.spans.CenterSpan类的典型用法代码示例。如果您正苦于以下问题:Java CenterSpan类的具体用法?Java CenterSpan怎么用?Java CenterSpan使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CenterSpan类属于net.nightwhistler.htmlspanner.spans包,在下文中一共展示了CenterSpan类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: displayPageNumber
import net.nightwhistler.htmlspanner.spans.CenterSpan; //导入依赖的package包/类
private void displayPageNumber(int pageNumber) {
String pageString;
if (!config.isScrollingEnabled() && pageNumber > 0) {
pageString = Integer.toString(pageNumber) + "\n";
} else {
pageString = "\n";
}
SpannableStringBuilder builder = new SpannableStringBuilder(pageString);
builder.setSpan(new CenterSpan(), 0, builder.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
pageNumberView.setTextColor(config.getTextColor());
pageNumberView.setTextSize(config.getTextSize());
pageNumberView.setTypeface(config.getDefaultFontFamily().getDefaultTypeface());
pageNumberView.setText(builder);
pageNumberView.invalidate();
}
示例2: handleTagNode
import net.nightwhistler.htmlspanner.spans.CenterSpan; //导入依赖的package包/类
@Override public void handleTagNode(TagNode tagNode, SpannableStringBuilder spannableStringBuilder, int i, int i1) {
spannableStringBuilder.append("\n");
SpannableStringBuilder builder = new SpannableStringBuilder("$");
HrSpan hrSpan = new HrSpan(color, width);
builder.setSpan(hrSpan, 0, builder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
builder.setSpan(new CenterSpan(), 0, builder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
builder.append("\n");
spannableStringBuilder.append(builder);
}
示例3: handleTagNode
import net.nightwhistler.htmlspanner.spans.CenterSpan; //导入依赖的package包/类
@Override public void handleTagNode(TagNode node, SpannableStringBuilder builder, int start, int end) {
String src = node.getAttributeByName("src");
if (!InputHelper.isEmpty(src)) {
builder.append("");
if (isNull()) return;
DrawableGetter imageGetter = new DrawableGetter(textView, width);
builder.setSpan(new ImageSpan(imageGetter.getDrawable(src)), start, builder.length(), SPAN_EXCLUSIVE_EXCLUSIVE);
builder.setSpan(new CenterSpan(), start, builder.length(), SPAN_EXCLUSIVE_EXCLUSIVE);
appendNewLine(builder);
}
}
示例4: setImageSpan
import net.nightwhistler.htmlspanner.spans.CenterSpan; //导入依赖的package包/类
private void setImageSpan(SpannableStringBuilder builder,
Drawable drawable, int start, int end) {
builder.setSpan(new ImageSpan(drawable), start, end,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
if (spine != null && spine.isCover()) {
builder.setSpan(new CenterSpan(), start, end,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
}