English | Site Directory

Android - An Open Handset Alliance Project

android.text.method
public class

android.text.method.TextInputMethod

java.lang.Object
android.text.method.MetaKeyInputMethod
android.text.method.BaseInputMethod InputMethod
android.text.method.TextInputMethod

This is the input method for typing normal text. It delegates to other input methods appropriate to the current keyboard and language.

Nested Classes

Summary

Constants inherited from class android.text.method.MetaKeyInputMethod

Public Constructors

          TextInputMethod(Capitalize cap, boolean autotext)
Creates a new TextInputMethod with the specified capitalization and correction properties.

Public Methods

      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.
      static  TextInputMethod  getInstance(boolean autotext, Capitalize cap)
Returns a new or existing instance with the specified capitalization and correction properties.
      static  TextInputMethod  getInstance()
Returns a new or existing instance with no automatic capitalization or correction.
        boolean  onKeyDown(View view, Editable content, int keyCode, KeyEvent event)
Handles presses of the meta keys.
        boolean  onKeyUp(View view, Editable content, int keyCode, KeyEvent event)
Handles release of the meta keys.
      static  boolean  shouldCap(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.
Methods inherited from class android.text.method.BaseInputMethod
Methods inherited from class android.text.method.MetaKeyInputMethod
Methods inherited from class java.lang.Object
Methods inherited from interface android.text.method.InputMethod

Details

Public Constructors

public TextInputMethod(Capitalize cap, boolean autotext)

Creates a new TextInputMethod with the specified capitalization and correction properties.

Parameters

cap when, if ever, to automatically capitalize.
autotext whether to automatically do spelling corrections.

Public Methods

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.

public static TextInputMethod getInstance(boolean autotext, Capitalize cap)

Returns a new or existing instance with the specified capitalization and correction properties.

Parameters

autotext whether to automatically do spelling corrections.
cap when, if ever, to automatically capitalize.

public static TextInputMethod getInstance()

Returns a new or existing instance with no automatic capitalization or correction.

public boolean onKeyDown(View view, Editable content, int keyCode, KeyEvent event)

Handles presses of the meta keys.

public boolean onKeyUp(View view, Editable content, int keyCode, KeyEvent event)

Handles release of the meta keys.

public static boolean shouldCap(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.
Build m5-rc15g - 14 May 2008 12:50