public class EasyEditSpan extends Object implements ParcelableSpan
The TextView
uses this span to allow the user to delete a chuck of text in one click.
TextView
removes the span when the user deletes the whole text or modifies it.
This span can be also used to receive notification when the user deletes or modifies the text;
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static String |
EXTRA_TEXT_CHANGED_TYPE
The extra key field in the pending intent that describes how the text changed.
|
static int |
TEXT_DELETED
The value of
EXTRA_TEXT_CHANGED_TYPE when the text wrapped by this span is deleted. |
static int |
TEXT_MODIFIED
The value of
EXTRA_TEXT_CHANGED_TYPE when the text wrapped by this span is modified. |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
EasyEditSpan()
Creates the span.
|
EasyEditSpan(Parcel source)
Constructor called from
TextUtils to restore the span. |
EasyEditSpan(PendingIntent pendingIntent) |
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
PendingIntent |
getPendingIntent() |
int |
getSpanTypeId()
Return a special type identifier for this span class.
|
int |
getSpanTypeIdInternal()
Internal implementation of
ParcelableSpan.getSpanTypeId() that is not meant to
be overridden outside of the framework. |
boolean |
isDeleteEnabled() |
void |
setDeleteEnabled(boolean value)
Enables or disables the deletion of the text.
|
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
void |
writeToParcelInternal(Parcel dest,
int flags)
Internal implementation of
Parcelable.writeToParcel(Parcel, int)
that is not meant to be overridden outside of the framework. |
public static final String EXTRA_TEXT_CHANGED_TYPE
TEXT_DELETED
,
TEXT_MODIFIED
,
getPendingIntent()
,
Constant Field Valuespublic static final int TEXT_DELETED
EXTRA_TEXT_CHANGED_TYPE
when the text wrapped by this span is deleted.public static final int TEXT_MODIFIED
EXTRA_TEXT_CHANGED_TYPE
when the text wrapped by this span is modified.public EasyEditSpan()
public EasyEditSpan(PendingIntent pendingIntent)
pendingIntent
- The intent will be sent when the wrapped text is deleted or modified.
When the pending intent is sent, EXTRA_TEXT_CHANGED_TYPE
is
added in the intent to describe how the text changed.public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public void writeToParcel(Parcel dest, int flags)
Parcelable
writeToParcel
in interface Parcelable
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.public void writeToParcelInternal(Parcel dest, int flags)
ParcelableSpan
Parcelable.writeToParcel(Parcel, int)
that is not meant to be overridden outside of the framework.writeToParcelInternal
in interface ParcelableSpan
public int getSpanTypeId()
ParcelableSpan
getSpanTypeId
in interface ParcelableSpan
public int getSpanTypeIdInternal()
ParcelableSpan
ParcelableSpan.getSpanTypeId()
that is not meant to
be overridden outside of the framework.getSpanTypeIdInternal
in interface ParcelableSpan
public boolean isDeleteEnabled()
TextView
should offer the ability to delete the text.public void setDeleteEnabled(boolean value)
public PendingIntent getPendingIntent()