public class SuggestionSpan extends CharacterStyle implements ParcelableSpan
TextView.isSuggestionsEnabled()
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_SUGGESTION_PICKED |
static Parcelable.Creator<SuggestionSpan> |
CREATOR |
static int |
FLAG_AUTO_CORRECTION
Sets this flag if the auto correction is about to be applied to a word/text
that the user is typing/composing.
|
static int |
FLAG_EASY_CORRECT
Sets this flag if the suggestions should be easily accessible with few interactions.
|
static int |
FLAG_MISSPELLED
Sets this flag if the suggestions apply to a misspelled word/text.
|
static String |
SUGGESTION_SPAN_PICKED_AFTER |
static String |
SUGGESTION_SPAN_PICKED_BEFORE |
static String |
SUGGESTION_SPAN_PICKED_HASHCODE |
static int |
SUGGESTIONS_MAX_SIZE |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Constructor and Description |
---|
SuggestionSpan(Context context,
Locale locale,
String[] suggestions,
int flags,
Class<?> notificationTargetClass) |
SuggestionSpan(Context context,
String[] suggestions,
int flags) |
SuggestionSpan(Locale locale,
String[] suggestions,
int flags) |
SuggestionSpan(Parcel src) |
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
|
boolean |
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
int |
getFlags() |
String |
getLocale() |
String |
getNotificationTargetClassName() |
int |
getSpanTypeId()
Return a special type identifier for this span class.
|
String[] |
getSuggestions() |
int |
getUnderlineColor() |
int |
hashCode()
Returns an integer hash code for this object.
|
void |
setFlags(int flags) |
void |
updateDrawState(TextPaint tp) |
void |
writeToParcel(Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
getUnderlying, wrap
public static final int FLAG_EASY_CORRECT
public static final int FLAG_MISSPELLED
public static final int FLAG_AUTO_CORRECTION
public static final String ACTION_SUGGESTION_PICKED
public static final String SUGGESTION_SPAN_PICKED_AFTER
public static final String SUGGESTION_SPAN_PICKED_BEFORE
public static final String SUGGESTION_SPAN_PICKED_HASHCODE
public static final int SUGGESTIONS_MAX_SIZE
public static final Parcelable.Creator<SuggestionSpan> CREATOR
public SuggestionSpan(Context context, String[] suggestions, int flags)
context
- Context for the applicationsuggestions
- Suggestions for the string under the spanflags
- Additional flags indicating how this span is handled in TextViewpublic SuggestionSpan(Locale locale, String[] suggestions, int flags)
locale
- Locale of the suggestionssuggestions
- Suggestions for the string under the spanflags
- Additional flags indicating how this span is handled in TextViewpublic SuggestionSpan(Context context, Locale locale, String[] suggestions, int flags, Class<?> notificationTargetClass)
context
- Context for the applicationlocale
- locale Locale of the suggestionssuggestions
- Suggestions for the string under the span. Only the first up to
SUGGESTIONS_MAX_SIZE
will be considered. Null values not permitted.flags
- Additional flags indicating how this span is handled in TextViewnotificationTargetClass
- if not null, this class will get notified when the user
selects one of the suggestions.public SuggestionSpan(Parcel src)
public String[] getSuggestions()
public String getLocale()
public String getNotificationTargetClassName()
public int getFlags()
public void setFlags(int flags)
public int describeContents()
Parcelable
describeContents
in interface Parcelable
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 int getSpanTypeId()
ParcelableSpan
getSpanTypeId
in interface ParcelableSpan
public boolean equals(Object o)
Object
o
must represent the same object
as this instance using a class-specific comparison. The general contract
is that this comparison should be reflexive, symmetric, and transitive.
Also, no object reference other than null is equal to null.
The default implementation returns true
only if this ==
o
. See Writing a correct
equals
method
if you intend implementing your own equals
method.
The general contract for the equals
and Object.hashCode()
methods is that if equals
returns true
for
any two objects, then hashCode()
must return the same value for
these objects. This means that subclasses of Object
usually
override either both methods or neither of them.
equals
in class Object
o
- the object to compare this instance with.true
if the specified object is equal to this Object
; false
otherwise.Object.hashCode()
public int hashCode()
Object
Object.equals(java.lang.Object)
returns true
must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCode
method
if you intend implementing your own hashCode
method.
hashCode
in class Object
Object.equals(java.lang.Object)
public void updateDrawState(TextPaint tp)
updateDrawState
in class CharacterStyle
public int getUnderlineColor()