diff options
author | Scott Main <smain@google.com> | 2012-12-21 16:40:25 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-12-21 16:40:25 -0800 |
commit | 1a9c5a5f82786825937c0a4d46457f336cba8f97 (patch) | |
tree | 3eed807f19a9ec74f8e28c539ad8cd5ea064fac8 /docs/html/guide | |
parent | 51627153b9e6c26d5d2d87ee14ca0676968578e5 (diff) | |
parent | 96f0e00825cf1bf0f14c358b87394b426020a77b (diff) | |
download | frameworks_base-1a9c5a5f82786825937c0a4d46457f336cba8f97.zip frameworks_base-1a9c5a5f82786825937c0a4d46457f336cba8f97.tar.gz frameworks_base-1a9c5a5f82786825937c0a4d46457f336cba8f97.tar.bz2 |
am 96f0e008: am 481102ee: am 0dae634b: Merge "docs: add class on keyboards" into jb-mr1-dev
* commit '96f0e00825cf1bf0f14c358b87394b426020a77b':
docs: add class on keyboards
Diffstat (limited to 'docs/html/guide')
-rw-r--r-- | docs/html/guide/topics/ui/controls/text.jd | 48 |
1 files changed, 37 insertions, 11 deletions
diff --git a/docs/html/guide/topics/ui/controls/text.jd b/docs/html/guide/topics/ui/controls/text.jd index 2d9d215..654883d 100644 --- a/docs/html/guide/topics/ui/controls/text.jd +++ b/docs/html/guide/topics/ui/controls/text.jd @@ -79,15 +79,23 @@ should use the {@code textEmailAddress} input type:</p> </pre> -<p>There are several different input types available for different situations. You can find -them all listed with the documentation for <a -href="{@docRoot}reference/android/widget/TextView.html#attr_android:inputType">{@code -android:inputType}</a>.</p> - -<p class="note"><strong>Tip:</strong> To allow users to input long strings of text with line -breaks, use the {@code "textMultiLine"} input type. By default, an {@link android.widget.EditText} -object is restricted to one line of text and scrolls horizontally when the text exceeds the -available width.</p> +<p>There are several different input types available for different situations. +Here are some of the more common values for +<a href="{@docRoot}reference/android/widget/TextView.html#attr_android:inputType" +>{@code android:inputType}</a>:</p> + +<dl> + <dt>{@code "text"}</dt> + <dd>Normal text keyboard.</dd> + <dt>{@code "textEmailAddress"}</dt> + <dd>Normal text keyboard with the @ character.</dd> + <dt>{@code "textUri"}</dt> + <dd>Normal text keyboard with the / character.</dd> + <dt>{@code "number"}</dt> + <dd>Basic number keypad.</dd> + <dt>{@code "phone"}</dt> + <dd>Phone-style keypad.</dd> +</dl> <h3 id="Behaviors">Controlling other behaviors</h3> @@ -98,7 +106,25 @@ capitalize all new words or use features like auto-complete and spelling suggest <p>The <a href="{@docRoot}reference/android/widget/TextView.html#attr_android:inputType">{@code android:inputType}</a> attribute allows bitwise combinations so you can specify both a keyboard -layout and one or more behaviors at once. For example, here's how you can collect a postal +layout and one or more behaviors at once.</p> + +<p>Here are some of the common input type values that define keyboard behaviors:</p> + +<dl> + <dt>{@code "textCapSentences"}</dt> + <dd>Normal text keyboard that capitalizes the first letter for each new sentence.</dd> + <dt>{@code "textCapWords"}</dt> + <dd>Normal text keyboard that capitalizes every word. Good for titles or person names.</dd> + <dt>{@code "textAutoCorrect"}</dt> + <dd>Normal text keyboard that corrects commonly misspelled words.</dd> + <dt>{@code "textPassword"}</dt> + <dd>Normal text keyboard, but the characters entered turn into dots.</dd> + <dt>{@code "textMultiLine"}</dt> + <dd>Normal text keyboard that allow users to input long strings of text that include line +breaks (carriage returns).</dd> +</dl> + +<p>For example, here's how you can collect a postal address, capitalize each word, and disable text suggestions:</p> <pre> @@ -177,7 +203,7 @@ editText.setOnEditorActionListener(new OnEditorActionListener() { public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { boolean handled = false; if (actionId == EditorInfo.IME_ACTION_SEND) { - // Send the user message + sendMessage(); handled = true; } return handled; |