/** * @see BlurMaskFilter#BlurMaskFilter(float, BlurMaskFilter.Blur) */ public static Span blur(final float radius, @NonNull final BlurMaskFilter.Blur style) { return new Span(new SpanBuilder() { @Override public Object build() { return new MaskFilterSpan(new BlurMaskFilter(radius, style)); } }); }
/** * @see EmbossMaskFilter#EmbossMaskFilter(float[], float, float, float) */ public static Span emboss(@NonNull final float[] direction, final float ambient, final float specular, final float blurRadius) { return new Span(new SpanBuilder() { @Override public Object build() { return new MaskFilterSpan(new EmbossMaskFilter(direction, ambient, specular, blurRadius)); } }); }
public TextDecorator blur(final float radius, final BlurMaskFilter.Blur style, final String... texts) { int index; for (String text : texts) { if (content.contains(text)) { index = content.indexOf(text); decoratedContent.setSpan(new MaskFilterSpan(new BlurMaskFilter(radius, style)), index, index + text.length(), flags); } } return this; }
public TextDecorator emboss(final float[] direction, final float ambient, final float specular, final float blurRadius, final int start, final int end) { checkIndexOutOfBoundsException(start, end); decoratedContent.setSpan(new MaskFilterSpan(new EmbossMaskFilter(direction, ambient, specular, blurRadius)), start, end, flags); return this; }
public TextDecorator emboss(final float[] direction, final float ambient, final float specular, final float blurRadius, final String... texts) { int index; for (String text : texts) { if (content.contains(text)) { index = content.indexOf(text); decoratedContent.setSpan(new MaskFilterSpan(new EmbossMaskFilter(direction, ambient, specular, blurRadius)), index, index + text.length(), flags); } } return this; }
public static Node mask(MaskFilter filter, Object... nodes) { return new SpanNode(new MaskFilterSpan(filter), nodes); }
public TextDecorator blur(final float radius, final BlurMaskFilter.Blur style, final int start, final int end) { checkIndexOutOfBoundsException(start, end); decoratedContent.setSpan(new MaskFilterSpan(new BlurMaskFilter(radius, style)), start, end, flags); return this; }
/** * @param density * @param style BlurMaskFilter.Blur.NORMAL * @return */ public SpanOptions addMaskFilterSpan(float density, BlurMaskFilter.Blur style) { MaskFilterSpan span = new MaskFilterSpan(new BlurMaskFilter(density, style)); listSpan.add(span); return this; }
/** * 模糊效果 * * @param text * @param density * @param style BlurMaskFilter.Blur.NORMAL * @return */ public AndroidSpan drawMaskFilterSpan(String text, float density, BlurMaskFilter.Blur style) { MaskFilterSpan span = new MaskFilterSpan(new BlurMaskFilter(density, style)); drawSpan(text, span); return this; }