public class InvisibleRecipientChip extends ReplacementSpan implements DrawableRecipientChip
Constructor and Description |
---|
InvisibleRecipientChip(RecipientEntry entry) |
Modifier and Type | Method and Description |
---|---|
void |
draw(Canvas canvas)
Draw the chip.
|
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.
|
Rect |
getBounds()
Get the bounds of the chip; may be 0,0 if it is not visibly rendered.
|
long |
getContactId()
Get the id of the contact associated with this chip.
|
long |
getDataId()
Get the id of the data associated with this chip.
|
Long |
getDirectoryId()
Get the directory id of the contact associated with this chip.
|
CharSequence |
getDisplay()
Get the text displayed in the chip.
|
RecipientEntry |
getEntry()
Get associated RecipientEntry.
|
String |
getLookupKey()
Get the directory lookup key associated with this chip, or
null . |
CharSequence |
getOriginalText()
Set the text in the edittextview originally associated with this chip
before any reverse lookups.
|
int |
getSize(Paint paint,
CharSequence text,
int start,
int end,
Paint.FontMetricsInt fm)
Returns the width of the span.
|
CharSequence |
getValue()
Get the text value this chip represents.
|
boolean |
isSelected()
Return true if the chip is selected.
|
void |
setOriginalText(String text)
Set the text in the edittextview originally associated with this chip
before any reverse lookups.
|
void |
setSelected(boolean selected)
Set the selected state of the chip.
|
updateDrawState, updateMeasureState
getUnderlying
wrap
public InvisibleRecipientChip(RecipientEntry entry)
public void setSelected(boolean selected)
public boolean isSelected()
public CharSequence getDisplay()
public CharSequence getValue()
public long getContactId()
public Long getDirectoryId()
public String getLookupKey()
null
.public long getDataId()
public RecipientEntry getEntry()
public void setOriginalText(String text)
public CharSequence getOriginalText()
public void draw(Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom, Paint paint)
ReplacementSpan
draw
in class ReplacementSpan
canvas
- Canvas into which the span should be rendered.text
- Current text.start
- Start character index for span.end
- End character index for span.x
- Edge of the replacement closest to the leading margin.top
- Top of the line.y
- Baseline.bottom
- Bottom of the line.paint
- Paint instance.public int getSize(Paint paint, CharSequence text, int start, int end, Paint.FontMetricsInt fm)
ReplacementSpan
Paint.FontMetricsInt
. If the span covers the whole
text, and the height is not set,
ReplacementSpan.draw(Canvas, CharSequence, int, int, float, int, int, int, Paint)
will not be
called for the span.getSize
in class ReplacementSpan
paint
- Paint instance.text
- Current text.start
- Start character index for span.end
- End character index for span.fm
- Font metrics, can be null.public Rect getBounds()
DrawableRecipientChip
getBounds
in interface DrawableRecipientChip
public void draw(Canvas canvas)
DrawableRecipientChip
draw
in interface DrawableRecipientChip