MaskFilterSpan
open class MaskFilterSpan : CharacterStyle, UpdateAppearance
Span that allows setting a MaskFilter
to the text it's attached to.
For example, to blur a text, a android.graphics.BlurMaskFilter
can be used:
MaskFilter blurMask = new BlurMaskFilter(5f, BlurMaskFilter.Blur.NORMAL);
SpannableString string = new SpannableString("Text with blur mask");
string.setSpan(new MaskFilterSpan(blurMask), 10, 15, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
Text blurred with the
MaskFilterSpan
.
Summary
Inherited functions |
From class CharacterStyle
CharacterStyle! |
getUnderlying()
Returns "this" for most CharacterStyles, but for CharacterStyles that were generated by wrap , returns the underlying CharacterStyle.
|
CharacterStyle! |
wrap(cs: CharacterStyle!)
A given CharacterStyle can only applied to a single region of a given Spanned. If you need to attach the same CharacterStyle to multiple regions, you can use this method to wrap it with a new object that will have the same effect but be a distinct object so that it can also be attached without conflict.
|
|
Public constructors
Public methods
getMaskFilter
open fun getMaskFilter(): MaskFilter!
Return the mask filter for this span.
toString
open fun toString(): String
Return |
String |
a string representation of the object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[]]