Java 类android.text.style.MaskFilterSpan 实例源码
项目:spanner
文件:Spans.java
/**
* @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));
}
});
}
项目:spanner
文件:Spans.java
/**
* @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));
}
});
}
项目:text-decorator
文件:TextDecorator.java
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;
}
项目:text-decorator
文件:TextDecorator.java
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;
}
项目:text-decorator
文件:TextDecorator.java
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;
}
项目:Android-Spans
文件:Span.java
public static Node mask(MaskFilter filter, Object... nodes) {
return new SpanNode(new MaskFilterSpan(filter), nodes);
}
项目:text-decorator
文件:TextDecorator.java
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;
}
项目:AndroidSpan
文件:SpanOptions.java
/**
* @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;
}
项目:AndroidSpan
文件:AndroidSpan.java
/**
* 模糊效果
*
* @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;
}