IT. Expert System.

Android Reference

TextKeyListener


android.text.method

Class TextKeyListener

  • All Implemented Interfaces:
    KeyListener, NoCopySpan, SpanWatcher


    public class TextKeyListener
    extends BaseKeyListener
    implements SpanWatcher
    This is the key listener for typing normal text. It delegates to other key listeners appropriate to the current keyboard and language.

    As for all implementations of KeyListener, this class is only concerned with hardware keyboards. Software input methods have no obligation to trigger the methods in this class.
    • Constructor Detail

      • TextKeyListener

        public TextKeyListener(TextKeyListener.Capitalize cap,
                       boolean autotext)
        Creates a new TextKeyListener with the specified capitalization and correction properties.
        Parameters:
        cap - when, if ever, to automatically capitalize.
        autotext - whether to automatically do spelling corrections.
    • Method Detail

      • getInstance

        public static TextKeyListener getInstance(boolean autotext,
                                  TextKeyListener.Capitalize cap)
        Returns a new or existing instance with the specified capitalization and correction properties.
        Parameters:
        cap - when, if ever, to automatically capitalize.
        autotext - whether to automatically do spelling corrections.
      • getInstance

        public static TextKeyListener getInstance()
        Returns a new or existing instance with no automatic capitalization or correction.
      • shouldCap

        public static boolean shouldCap(TextKeyListener.Capitalize cap,
                        CharSequence cs,
                        int off)
        Returns whether it makes sense to automatically capitalize at the specified position in the specified text, with the specified rules.
        Parameters:
        cap - the capitalization rules to consider.
        cs - the text in which an insertion is being made.
        off - the offset into that text where the insertion is being made.
        Returns:
        whether the character being inserted should be capitalized.
      • getInputType

        public int getInputType()
        Description copied from interface: KeyListener
        Return the type of text that this key listener is manipulating, as per InputType. This is used to determine the mode of the soft keyboard that is shown for the editor.

        If you return InputType.TYPE_NULL then no soft keyboard will provided. In other words, you must be providing your own key pad for on-screen input and the key listener will be used to handle input from a hard keyboard.

        If you return any other value, a soft input method will be created when the user puts focus in the editor, which will provide a keypad and also consume hard key events. This means that the key listener will generally not be used, instead the soft input method will take care of managing key input as per the content type returned here.

        Specified by:
        getInputType in interface KeyListener
      • clear

        public static void clear(Editable e)
        Clear all the input state (autotext, autocap, multitap, undo) from the specified Editable, going beyond Editable.clear(), which just clears the text but not the input state.
        Parameters:
        e - the buffer whose text and state are to be cleared.
      • onSpanAdded

        public void onSpanAdded(Spannable s,
                       Object what,
                       int start,
                       int end)
        Description copied from interface: SpanWatcher
        This method is called to notify you that the specified object has been attached to the specified range of the text.
        Specified by:
        onSpanAdded in interface SpanWatcher
      • onSpanRemoved

        public void onSpanRemoved(Spannable s,
                         Object what,
                         int start,
                         int end)
        Description copied from interface: SpanWatcher
        This method is called to notify you that the specified object has been detached from the specified range of the text.
        Specified by:
        onSpanRemoved in interface SpanWatcher
      • onSpanChanged

        public void onSpanChanged(Spannable s,
                         Object what,
                         int start,
                         int end,
                         int st,
                         int en)
        Description copied from interface: SpanWatcher
        This method is called to notify you that the specified object has been relocated from the range ostart…oend to the new range nstart…nend of the text.
        Specified by:
        onSpanChanged in interface SpanWatcher
      • release

        public void release()


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: 10854 / . Delta: 0.03038 с