SuggestionsInfo
class SuggestionsInfo : Parcelable
kotlin.Any | |
↳ | android.view.textservice.SuggestionsInfo |
This class contains a metadata of suggestions from the text service
Summary
Constants | |
---|---|
static Int |
Flag of the attributes of the suggestions that can be obtained by |
static Int |
Flag of the attributes of the suggestions that can be obtained by |
static Int |
Flag of the attributes of the suggestions that can be obtained by |
static Int |
Flag of the attributes of the suggestions that can be obtained by |
static Int |
Flag of the attributes of the suggestions that can be obtained by |
Inherited constants | |
---|---|
Public constructors | |
---|---|
SuggestionsInfo(source: Parcel!) |
|
SuggestionsInfo(suggestionsAttributes: Int, suggestions: Array<String!>!) Constructor. |
|
SuggestionsInfo(suggestionsAttributes: Int, suggestions: Array<String!>!, cookie: Int, sequence: Int) Constructor. |
Public methods | |
---|---|
Int |
Used to make this class parcelable. |
Int | |
Int | |
String! |
getSuggestionAt(i: Int) |
Int | |
Int | |
Unit |
setCookieAndSequence(cookie: Int, sequence: Int) Set the cookie and the sequence of SuggestionsInfo which are set to TextInfo from a client application |
Unit |
writeToParcel(dest: Parcel, flags: Int) Used to package this object into a |
Properties | |
---|---|
static Parcelable.Creator<SuggestionsInfo!> |
Used to make this class parcelable. |
Constants
RESULT_ATTR_DONT_SHOW_UI_FOR_SUGGESTIONS
static val RESULT_ATTR_DONT_SHOW_UI_FOR_SUGGESTIONS: Int
Flag of the attributes of the suggestions that can be obtained by getSuggestionsAttributes
: this tells that the text service has an alternative way to show UI for the list of correction suggestions to the user. When this flag is set, the receiver of the result suggestions should mark the erroneous part of the text with a text signifier (for example, underline), but should not show any UI for the list of correction suggestions to the user (for example, in a popup window).
Value: 16
RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS
static val RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS: Int
Flag of the attributes of the suggestions that can be obtained by getSuggestionsAttributes
: this tells that the text service thinks the result suggestions include highly recommended ones.
Value: 4
RESULT_ATTR_IN_THE_DICTIONARY
static val RESULT_ATTR_IN_THE_DICTIONARY: Int
Flag of the attributes of the suggestions that can be obtained by getSuggestionsAttributes
: this tells that the requested word was found in the dictionary in the text service.
Value: 1
RESULT_ATTR_LOOKS_LIKE_GRAMMAR_ERROR
static val RESULT_ATTR_LOOKS_LIKE_GRAMMAR_ERROR: Int
Flag of the attributes of the suggestions that can be obtained by getSuggestionsAttributes
: this tells that the text service thinks the requested sentence contains a grammar error.
Value: 8
RESULT_ATTR_LOOKS_LIKE_TYPO
static val RESULT_ATTR_LOOKS_LIKE_TYPO: Int
Flag of the attributes of the suggestions that can be obtained by getSuggestionsAttributes
: this tells that the text service thinks the requested word looks like a typo.
Value: 2
Public constructors
SuggestionsInfo
SuggestionsInfo(
suggestionsAttributes: Int,
suggestions: Array<String!>!)
Constructor.
Parameters | |
---|---|
suggestionsAttributes |
Int: from the text service |
suggestions |
Array<String!>!: from the text service |
SuggestionsInfo
SuggestionsInfo(
suggestionsAttributes: Int,
suggestions: Array<String!>!,
cookie: Int,
sequence: Int)
Constructor.
Parameters | |
---|---|
suggestionsAttributes |
Int: from the text service Value is either 0 or a combination of android.view.textservice.SuggestionsInfo#RESULT_ATTR_IN_THE_DICTIONARY , android.view.textservice.SuggestionsInfo#RESULT_ATTR_LOOKS_LIKE_TYPO , android.view.textservice.SuggestionsInfo#RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS , android.view.textservice.SuggestionsInfo#RESULT_ATTR_LOOKS_LIKE_GRAMMAR_ERROR , and android.view.textservice.SuggestionsInfo#RESULT_ATTR_DONT_SHOW_UI_FOR_SUGGESTIONS |
suggestions |
Array<String!>!: from the text service |
cookie |
Int: the cookie of the input TextInfo |
sequence |
Int: the cookie of the input TextInfo |
Public methods
describeContents
fun describeContents(): Int
Used to make this class parcelable.
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
getCookie
fun getCookie(): Int
Return | |
---|---|
Int |
the cookie which may be set by a client application |
getSequence
fun getSequence(): Int
Return | |
---|---|
Int |
the sequence which may be set by a client application |
getSuggestionAt
fun getSuggestionAt(i: Int): String!
Parameters | |
---|---|
i |
Int: the id of suggestions |
Return | |
---|---|
String! |
the suggestion at the specified id |
getSuggestionsAttributes
fun getSuggestionsAttributes(): Int
Return | |
---|---|
Int |
the attributes of suggestions. This includes whether the spell checker has the word in its dictionary or not and whether the spell checker has confident suggestions for the word or not. Value is either 0 or a combination of android.view.textservice.SuggestionsInfo#RESULT_ATTR_IN_THE_DICTIONARY , android.view.textservice.SuggestionsInfo#RESULT_ATTR_LOOKS_LIKE_TYPO , android.view.textservice.SuggestionsInfo#RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS , android.view.textservice.SuggestionsInfo#RESULT_ATTR_LOOKS_LIKE_GRAMMAR_ERROR , and android.view.textservice.SuggestionsInfo#RESULT_ATTR_DONT_SHOW_UI_FOR_SUGGESTIONS |
getSuggestionsCount
fun getSuggestionsCount(): Int
Return | |
---|---|
Int |
the count of the suggestions. If there's no suggestions at all, this method returns -1. Even if this method returns 0, it doesn't necessarily mean that there are no suggestions for the requested word. For instance, the caller could have been asked to limit the maximum number of suggestions returned. |
setCookieAndSequence
fun setCookieAndSequence(
cookie: Int,
sequence: Int
): Unit
Set the cookie and the sequence of SuggestionsInfo which are set to TextInfo from a client application
Parameters | |
---|---|
cookie |
Int: the cookie of an input TextInfo |
sequence |
Int: the cookie of an input TextInfo |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Used to package this object into a Parcel
.
Parameters | |
---|---|
dest |
Parcel: The Parcel to be written. |
flags |
Int: The flags used for parceling. |
Properties
CREATOR
static val CREATOR: Parcelable.Creator<SuggestionsInfo!>
Used to make this class parcelable.