Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1576] Android: Allow Soft Keyboard States On Focus

GitHub Issuen/a
TypeNew Feature
Resolution Date2011-04-17T01:56:33.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0 M01
Labelsandroid, feature
ReporterDon Thorp
AssigneeDon Thorp


For some limited use cases, it is desirable to break away from the standard Android UI convention of only showing the keyboard when an edit field is touch focused or the user requests it with long-press on Menu.

One of those use cases is a PIN entry screen where the only possible options are entering and submitting the PIN.

Add View.softKeyboardOnFocus that accepts the following 3 states.

Ti.UI.Android.SOFT_KEYBOARD_DEFAULT_ON_FOCUS - Default, use Android Conventions

Ti.UI.Android.SOFT_KEYBOARD_HIDE_ON_FOCUS - Request hiding the keyboard. Useful on Button after leaving the input area.

Ti.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS - Request showing the keyboard. Useful when entering an input area.

This feature needs to be tested on 1.6 and 2.X platforms.


  1. Don Thorp 2011-04-15

    (from [b06ad77b3b072a3f3a93d2a47a9f3f43088b913f]) [#1576 state:fixed-in-qa] Special case had to be made for Droid and Donut. Intended for special use cases, not general behavior. It's not the Android UI way. http://github.com/appcelerator/titanium_mobile/commit/b06ad77b3b072a3f3a93d2a47a9f3f43088b913f"> http://github.com/appcelerator/titanium_mobile/commit/b06ad77b3b072...

  2. Thomas Huelbert 2011-04-15

    confirmed, needs testcase (or rather Don provided one, I need to add it to KS)

  3. Thomas Huelbert 2011-04-15

    reopened to test on 1.6 (2.2 checked)

  4. Thomas Huelbert 2011-04-15

    confirmed on a g1 running 1.6, the nexus one running 2.2

  5. John Veldboom 2011-04-15

    Also confirmed on Droid 2.2 stock.

    And just to clarify, it needs to be added to the TextField or TextArea itself.

       var searchField = Ti.UI.createTextField({
          softKeyboardOnFocus: Ti.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS
  6. John Veldboom 2011-04-15

    Would you mind providing an example on how to close the keyboard after a button press? I've tried a couple things, but can't figure it out. Thanks!

  7. Don Thorp 2011-04-15

    (from [fce0365c805b92bcceab662dfb04289709e1fb49]) [#1576 state:fixed-in-qa] Added example to KitchenSink, no code changes were made. https://github.com/appcelerator/titanium_mobile/commit/fce0365c805b92bcceab662dfb04289709e1fb49"> https://github.com/appcelerator/titanium_mobile/commit/fce0365c805b...

  8. Matt Schmulen 2011-04-15

    confirmed android 1.6 sim vi KS.

  9. Matt Schmulen 2011-04-15

    confirmed android 2.1 sim using KS

JSON Source