Titanium 5.2.0: Wrap-up of new features for Android

This is our final walkthrough on the Sample App for Titanium 5.2.0 as we wrap up with the remaining new features and changes for Android:

Textfield inputType

You could already set the keyboardType for a TextField, but even the KEYBOARD_TYPE_NUMBER_PAD still included other characters than just numbers and does not impose any limit on hardware keyboards.

The new inputType allows you to the specifically allow only numbers or numbers and text. It will automatically override the right keyboardType for you.

The sample allows you to enable either or both input types to see the effect.

Launcher Shortcuts

Ti.Android.Intent.putExra() now accepts an intent or icon. Among other possible use cases, this allows you to create an intent to install additional launch shortcuts for specific activities within your app, each with a unique icon, title and extras to identify the desired action.

The sample demonstrates how to create this intent in the launcher.js controller, while the index.js shows how to retrieve extras from the launch intent to take appropriate action.

NOTE: It’s a known issue that if the app is running in the background, there is no way to know which intent (e.g. a launch shortcut) caused it to resume.

TableView separatorStyle

Ti.UI.TableView.separatorStyle was already supported for iOS and MobileWeb, but now you can hide the separator line on Android as well.

Tap anywhere in the Sample’s TableView to toggle the style.

NOTE: Support for ListView is yet to be added.

Fullscreen Splash Image

If you set the <fullscreen> option in tiapp.xml to true this will now show the splash image fullscreen. The Android top status bar and bottom soft navigation bar will be hidden:

Be aware that this will also default your app to use the Theme.AppCompat.NoTitleBar.Fullscreen theme introduced in 5.0. If you want a fullscreen splash image but still show the status bar and Action Bar in the app itself, you will have to manually set the theme. The sample app uses a custom theme, but you can also use the default like this:

<android xmlns:android="https://schemas.android.com/apk/res/android">
    <application android:theme="@style/Theme.AppCompat" />

Renamed APIs

Finally, I’d like to remind you again of some properties and methods that we have deprecated and renamed to improve the consistency of our API. The old ones will be removed in Titanium 6.0.


Code Strong ?