IT. Expert System.

Android Reference

SuggestionSpan


android.text.style

Class SuggestionSpan

  • All Implemented Interfaces:
    Parcelable, ParcelableSpan


    public class SuggestionSpan
    extends CharacterStyle
    implements ParcelableSpan
    Holds suggestion candidates for the text enclosed in this span. When such a span is edited in an EditText, double tapping on the text enclosed in this span will display a popup dialog listing suggestion replacement for that text. The user can then replace the original text by one of the suggestions. These spans should typically be created by the input method to provide correction and alternates for the text.
    See Also:
    TextView.isSuggestionsEnabled()
    • Field Detail

      • FLAG_EASY_CORRECT

        public static final int FLAG_EASY_CORRECT
        Sets this flag if the suggestions should be easily accessible with few interactions. This flag should be set for every suggestions that the user is likely to use.
        See Also:
        Constant Field Values
      • FLAG_MISSPELLED

        public static final int FLAG_MISSPELLED
        Sets this flag if the suggestions apply to a misspelled word/text. This type of suggestion is rendered differently to highlight the error.
        See Also:
        Constant Field Values
      • FLAG_AUTO_CORRECTION

        public static final 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. This type of suggestion is rendered differently to indicate the auto correction is happening.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SuggestionSpan

        public SuggestionSpan(Context context,
                      String[] suggestions,
                      int flags)
        Parameters:
        context - Context for the application
        suggestions - Suggestions for the string under the span
        flags - Additional flags indicating how this span is handled in TextView
      • SuggestionSpan

        public SuggestionSpan(Locale locale,
                      String[] suggestions,
                      int flags)
        Parameters:
        locale - Locale of the suggestions
        suggestions - Suggestions for the string under the span
        flags - Additional flags indicating how this span is handled in TextView
      • SuggestionSpan

        public SuggestionSpan(Context context,
                      Locale locale,
                      String[] suggestions,
                      int flags,
                      Class<?> notificationTargetClass)
        Parameters:
        context - Context for the application
        locale - locale Locale of the suggestions
        suggestions - 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 TextView
        notificationTargetClass - if not null, this class will get notified when the user selects one of the suggestions.
      • SuggestionSpan

        public SuggestionSpan(Parcel src)
    • Method Detail

      • getSuggestions

        public String[] getSuggestions()
        Returns:
        an array of suggestion texts for this span
      • getLocale

        public String getLocale()
        Returns:
        the locale of the suggestions
      • getNotificationTargetClassName

        public String getNotificationTargetClassName()
        Returns:
        The name of the class to notify. The class of the original IME package will receive a notification when the user selects one of the suggestions. The notification will include the original string, the suggested replacement string as well as the hashCode of this span. The class will get notified by an intent that has those information. This is an internal API because only the framework should know the class name.
      • getFlags

        public int getFlags()
      • setFlags

        public void setFlags(int flags)
      • describeContents

        public int describeContents()
        Description copied from interface: Parcelable
        Describe the kinds of special objects contained in this Parcelable's marshalled representation.
        Specified by:
        describeContents in interface Parcelable
        Returns:
        a bitmask indicating the set of special object types marshalled by the Parcelable.
      • equals

        public boolean equals(Object o)
        Description copied from class: Object
        Compares this instance with the specified object and indicates if they are equal. In order to be equal, 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.

        Overrides:
        equals in class Object
        Parameters:
        o - the object to compare this instance with.
        Returns:
        true if the specified object is equal to this Object; false otherwise.
        See Also:
        Object.hashCode()
      • hashCode

        public int hashCode()
        Description copied from class: Object
        Returns an integer hash code for this object. By contract, any two objects for which 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.

        Overrides:
        hashCode in class Object
        Returns:
        this object's hash code.
        See Also:
        Object.equals(java.lang.Object)
      • getUnderlineColor

        public int getUnderlineColor()
        Returns:
        The color of the underline for that span, or 0 if there is no underline


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 112 / 158863145. Delta: 0.02852 с