Is there a way to hide some (but not all) of the text in a TextView? I tried setting the size to 0 with AbsoluteSizeSpan, but that doesn\'t have any visual effect that I see.
I just had this problem and wrote the following class:
public class NoDisplaySpan extends ReplacementSpan {
public NoDisplaySpan() {}
@Override
public void draw(Canvas arg0, CharSequence arg1, int arg2, int arg3,
float arg4, int arg5, int arg6, int arg7, Paint arg8) {}
@Override
public int getSize(Paint paint, CharSequence text, int start, int end,
FontMetricsInt fm) {
return 0;
}
}
It seems to only work within a paragraph; I get an ArrayIndexOutofBoundsException thrown when I set the span to extend past a newline. I'd love to hear if anyone can figure that out.