IT. Expert System.

Android Reference

BaseInputConnection


android.view.inputmethod

Class BaseInputConnection

  • All Implemented Interfaces:
    InputConnection


    public class BaseInputConnection
    extends Object
    implements InputConnection
    Base class for implementors of the InputConnection interface, taking care of most of the common behavior for providing a connection to an Editable. Implementors of this class will want to be sure to implement getEditable() to provide access to their own editable object.
    • Constructor Detail

      • BaseInputConnection

        public BaseInputConnection(View targetView,
                           boolean fullEditor)
    • Method Detail

      • removeComposingSpans

        public static final void removeComposingSpans(Spannable text)
      • setComposingSpans

        public static void setComposingSpans(Spannable text)
      • setComposingSpans

        public static void setComposingSpans(Spannable text,
                             int start,
                             int end)
      • getComposingSpanStart

        public static int getComposingSpanStart(Spannable text)
      • getComposingSpanEnd

        public static int getComposingSpanEnd(Spannable text)
      • getEditable

        public Editable getEditable()
        Return the target of edit operations. The default implementation returns its own fake editable that is just used for composing text; subclasses that are real text editors should override this and supply their own.
      • endBatchEdit

        public boolean endBatchEdit()
        Default implementation does nothing.
        Specified by:
        endBatchEdit in interface InputConnection
      • reportFinish

        protected void reportFinish()
        Called when this InputConnection is no longer used by the InputMethodManager.
      • commitCompletion

        public boolean commitCompletion(CompletionInfo text)
        Default implementation does nothing and returns false.
        Specified by:
        commitCompletion in interface InputConnection
        Parameters:
        text - The committed completion.
        Returns:
        Returns true on success, false if the input connection is no longer valid.
      • commitCorrection

        public boolean commitCorrection(CorrectionInfo correctionInfo)
        Default implementation does nothing and returns false.
        Specified by:
        commitCorrection in interface InputConnection
        Parameters:
        correctionInfo - Detailed information about the correction.
        Returns:
        True on success, false if the input connection is no longer valid.
      • commitText

        public boolean commitText(CharSequence text,
                         int newCursorPosition)
        Default implementation replaces any existing composing text with the given text. In addition, only if dummy mode, a key event is sent for the new text and the current editable buffer cleared.
        Specified by:
        commitText in interface InputConnection
        Parameters:
        text - The committed text.
        newCursorPosition - The new cursor position around the text. If > 0, this is relative to the end of the text - 1; if <= 0, this is relative to the start of the text. so a value of 1 will always advance you to the position after the full text being inserted. note that this means you can't position the cursor within the text, because the editor can make modifications to the text you are providing so it is not possible to correctly specify locations there.
        Returns:
        Returns true on success, false if the input connection is no longer valid.
      • deleteSurroundingText

        public boolean deleteSurroundingText(int beforeLength,
                                    int afterLength)
        The default implementation performs the deletion around the current selection position of the editable text.
        Specified by:
        deleteSurroundingText in interface InputConnection
        Parameters:
        beforeLength -
        afterLength -
        Returns:
        Returns true on success, false if the input connection is no longer valid.
      • finishComposingText

        public boolean finishComposingText()
        The default implementation removes the composing state from the current editable text. In addition, only if dummy mode, a key event is sent for the new text and the current editable buffer cleared.
        Specified by:
        finishComposingText in interface InputConnection
      • getCursorCapsMode

        public int getCursorCapsMode(int reqModes)
        The default implementation uses TextUtils.getCapsMode to get the cursor caps mode for the current selection position in the editable text, unless in dummy mode in which case 0 is always returned.
        Specified by:
        getCursorCapsMode in interface InputConnection
        Parameters:
        reqModes - The desired modes to retrieve, as defined by TextUtils.getCapsMode. These constants are defined so that you can simply pass the current TextBoxAttribute.contentType value directly in to here.
        Returns:
        Returns the caps mode flags that are in effect.
      • getTextBeforeCursor

        public CharSequence getTextBeforeCursor(int length,
                                       int flags)
        The default implementation returns the given amount of text from the current cursor position in the buffer.
        Specified by:
        getTextBeforeCursor in interface InputConnection
        Parameters:
        length - The expected length of the text.
        flags - Supplies additional options controlling how the text is returned. May be either 0 or InputConnection.GET_TEXT_WITH_STYLES.
        Returns:
        Returns the text before the cursor position; the length of the returned text might be less than n.
      • getSelectedText

        public CharSequence getSelectedText(int flags)
        The default implementation returns the text currently selected, or null if none is selected.
        Specified by:
        getSelectedText in interface InputConnection
        Parameters:
        flags - Supplies additional options controlling how the text is returned. May be either 0 or InputConnection.GET_TEXT_WITH_STYLES.
        Returns:
        Returns the text that is currently selected, if any, or null if no text is selected.
      • getTextAfterCursor

        public CharSequence getTextAfterCursor(int length,
                                      int flags)
        The default implementation returns the given amount of text from the current cursor position in the buffer.
        Specified by:
        getTextAfterCursor in interface InputConnection
        Parameters:
        length - The expected length of the text.
        flags - Supplies additional options controlling how the text is returned. May be either 0 or InputConnection.GET_TEXT_WITH_STYLES.
        Returns:
        Returns the text after the cursor position; the length of the returned text might be less than n.
      • performPrivateCommand

        public boolean performPrivateCommand(String action,
                                    Bundle data)
        The default implementation does nothing.
        Specified by:
        performPrivateCommand in interface InputConnection
        Parameters:
        action - Name of the command to be performed. This must be a scoped name, i.e. prefixed with a package name you own, so that different developers will not create conflicting commands.
        data - Any data to include with the command.
        Returns:
        Returns true if the command was sent (whether or not the associated editor understood it), false if the input connection is no longer valid.
      • setComposingText

        public boolean setComposingText(CharSequence text,
                               int newCursorPosition)
        The default implementation places the given text into the editable, replacing any existing composing text. The new text is marked as in a composing state with the composing style.
        Specified by:
        setComposingText in interface InputConnection
        Parameters:
        text - The composing text with styles if necessary. If no style object attached to the text, the default style for composing text is used. See {#link android.text.Spanned} for how to attach style object to the text. {#link android.text.SpannableString} and {#link android.text.SpannableStringBuilder} are two implementations of the interface {#link android.text.Spanned}.
        newCursorPosition - The new cursor position around the text. If > 0, this is relative to the end of the text - 1; if <= 0, this is relative to the start of the text. so a value of 1 will always advance you to the position after the full text being inserted. note that this means you can't position the cursor within the text, because the editor can make modifications to the text you are providing so it is not possible to correctly specify locations there.
        Returns:
        Returns true on success, false if the input connection is no longer valid.
      • setComposingRegion

        public boolean setComposingRegion(int start,
                                 int end)
        Description copied from interface: InputConnection
        Mark a certain region of text as composing text. Any composing text set previously will be removed automatically. The default style for composing text is used.
        Specified by:
        setComposingRegion in interface InputConnection
        Parameters:
        start - the position in the text at which the composing region begins
        end - the position in the text at which the composing region ends
        Returns:
        Returns true on success, false if the input connection is no longer valid.
      • setSelection

        public boolean setSelection(int start,
                           int end)
        The default implementation changes the selection position in the current editable text.
        Specified by:
        setSelection in interface InputConnection
        Returns:
        Returns true on success, false if the input connection is no longer valid.
      • reportFullscreenMode

        public boolean reportFullscreenMode(boolean enabled)
        Updates InputMethodManager with the current fullscreen mode.
        Specified by:
        reportFullscreenMode in interface InputConnection


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: 83 / 158856681. Delta: 0.67019 с