From d3badad3aa7fd250a0a81549c6c3c15d8aee9f8d Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Sat, 18 Jul 2009 11:37:10 -0500 Subject: [PATCH] Clarify use of InputType flags Some developers were confused about how to use the inputType field and were omitting the class type when setting variations. There are places in the framework where it specifically checks for a class and variation before it invokes the desired behavior. For instance, in EditText when setting the input type to a visible password, it specifically checks for this condition: inputType == (TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_VISIBLE_PASSWORD) --- core/java/android/text/InputType.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/core/java/android/text/InputType.java b/core/java/android/text/InputType.java index d50684af911d5..41d5b84a5b66f 100644 --- a/core/java/android/text/InputType.java +++ b/core/java/android/text/InputType.java @@ -20,7 +20,25 @@ import android.text.TextUtils; /** * Bit definitions for an integer defining the basic content type of text - * held in an {@link Editable} object. + * held in an {@link Editable} object. Supported classes may be combined + * with variations and flags to indicate desired behaviors. + * + *

Examples

+ * + *
+ *
A password field with with the password visible to the user: + *
inputType = TYPE_CLASS_TEXT | + * TYPE_TEXT_VARIATION_VISIBLE_PASSWORD + * + *
A multi-line postal address with automatic capitalization: + *
inputType = TYPE_CLASS_TEXT | + * TYPE_TEXT_VARIATION_POSTAL_ADDRESS | + * TYPE_TEXT_FLAG_MULTI_LINE + * + *
A time field: + *
inputType = TYPE_CLASS_DATETIME | + * TYPE_DATETIME_VARIATION_TIME + *
*/ public interface InputType { /**