ReplacementSpan
public
abstract
class
ReplacementSpan
extends MetricAffectingSpan
Known Direct Subclasses
|
Known Indirect Subclasses
|
Summary
Public methods |
abstract
void
|
draw(Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom, Paint paint)
Draws the span into the canvas.
|
abstract
int
|
getSize(Paint paint, CharSequence text, int start, int end, Paint.FontMetricsInt fm)
Returns the width of the span.
|
void
|
updateDrawState(TextPaint ds)
This method does nothing, since ReplacementSpans are drawn
explicitly instead of affecting Paint properties.
|
void
|
updateMeasureState(TextPaint p)
This method does nothing, since ReplacementSpans are measured
explicitly instead of affecting Paint properties.
|
Inherited methods |
From
class
android.text.style.MetricAffectingSpan
|
From
class
android.text.style.CharacterStyle
|
From
class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long millis, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long millis)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
|
Public constructors
ReplacementSpan
ReplacementSpan ()
Public methods
draw
void draw (Canvas canvas,
CharSequence text,
int start,
int end,
float x,
int top,
int y,
int bottom,
Paint paint)
Draws the span into the canvas.
Parameters |
canvas |
Canvas :
Canvas into which the span should be rendered. |
text |
CharSequence :
Current text. |
start |
int :
Start character index for span. |
end |
int :
End character index for span. |
x |
float :
Edge of the replacement closest to the leading margin. |
top |
int :
Top of the line. |
y |
int :
Baseline. |
bottom |
int :
Bottom of the line. |
paint |
Paint :
Paint instance.
|
getSize
int getSize (Paint paint,
CharSequence text,
int start,
int end,
Paint.FontMetricsInt fm)
Returns the width of the span. Extending classes can set the height of the span by updating
attributes of Paint.FontMetricsInt
. If the span covers the whole
text, and the height is not set,
draw(Canvas, CharSequence, int, int, float, int, int, int, Paint)
will not be
called for the span.
Parameters |
paint |
Paint :
Paint instance. |
text |
CharSequence :
Current text. |
start |
int :
Start character index for span. |
end |
int :
End character index for span. |
fm |
Paint.FontMetricsInt :
Font metrics, can be null. |
Returns |
int |
Width of the span.
|
updateDrawState
void updateDrawState (TextPaint ds)
This method does nothing, since ReplacementSpans are drawn
explicitly instead of affecting Paint properties.
updateMeasureState
void updateMeasureState (TextPaint p)
This method does nothing, since ReplacementSpans are measured
explicitly instead of affecting Paint properties.