📜 ⬆️ ⬇️

Appcelerator Titanium SDK has been updated to version 5.1.0

Recently, Appcelerator SDK has been updated to version 5.1.0 . There are many useful features.
List of changes:

Android marshmallow


This release supports Android 6.0 and higher. To use it, the system must have Android SDK level 23 installed. In the settings of your project, the target SDK must be set to 23 (previously it was 21, Android 5.0 / Lollipop)

Node


Starting with this release, the Titanium SDK works with Node.js version 4.x (previously there was 0.12.x)

Studio


This release supports work with Appcelerator Studio 4.4.0, in the list of changes to which:

Changes in functionality


Android


AppCompat Buttons


Starting with this release, the Titanium SDK will use the buttons from the AppCompat library, which will make the buttons look the same on all versions of the platform. Previously, the appearance of the buttons differed depending on the version of Android.

Target SDK


The Android SDK version 23 must be installed on the system. If you specify the target SDK in the tiapp.xml file, it must be set to 23 (previously 21).

iOS


Activity Indicator Style


Starting with this release, iPhone namespace constants that define the Activity Indicator style are deprecated. To define the style of Activity Indicator, use the same constants , but without the namespace.

Events for TabGroup


This release introduces new events for the TabGroup: selected and unselected element. These events replace outdated focus and blur for iOS.

User Activity Support


Since this release, the new method Titanium.iOS.UserActivity.isSupported() replaces the deprecated property Titanium.iOS.UserActivity.supported for compatibility with other APIs.

Device Permissions


This release revises the process of requesting permissions for the platform to support the Android 6.0 request permissions model and compatibility between iOS and Android platforms. Windows will be added in one of the following releases.

To request permission to use the calendar, camera, contacts, and location, use the following methods:

New methods replace outdated iOS methods:

New functionality


Android


Cardview


With this release, support begins for CardView , a raised block with rounded corners. Unlike ListView, which displays data of the same type as a unified template, CardView is convenient to use to display a collection of different types of elements.

Reveal Effect


On the Android platform, View now supports the effect of a smooth show / hide. To do this, pass the { animated: true } object as a parameter to the .show / .hide method.
The effect is supported by Android Lollipop and above.

iOS


3D Touch


Titanium SDK now supports Peek and Pop, as well as quick actions . Both features require support for 3D Touch and devices with iOS 9 and higher. Testing this functionality is only possible on the device. Use the Titanium.UI.iOS.forceTouchSupported property to determine if the device supports 3D Touch.

Peek and Pop provides the ability to quickly view application content by clicking on it, to then possibly switch to this content. See Titanium.UI.iOS.PreviewContext API reference for details.
')
Quick Action provides the ability to quickly perform any action through shortcuts, without going into the application, but simply by clicking on the icon on the home screen. See Titanium.UI.iOS.ApplicationShortcuts API reference for details.

Alert dialog


From this release, if you call Aler Dialog with a Titanium.UI.iPhone.AlertDialogStyle.PLAIN_TEXT_INPUT or Titanium.UI.iPhone.AlertDialogStyle.SECURE_TEXT_INPUT style, you can specify the placeholder property to set the replacement text of input fields and keyboardType/ for a returnKeyType to set the replacement text of input fields and keyboardType/ for a returnKeyType for a text, 0, 20, 20, 100.INPUT_INPUT or Titanium.UI.iPhone.AlertDialogStyle.SECURE_TEXT_INPUT . .
When using Titanium.UI.iPhone.AlertDialogStyle.LOGIN_AND_PASSWORD_INPUT , you can specify a replacement text for both the login field and the password field.

Application resources


In order to comply with the App Thinning principle and the naming convention for files in iOS, PNG and JPEG files of your project will be automatically added to the resource directory. When a user installs your application, only the appropriate resources are used.
In order for resources to get into the application, add to their name @ 2x and @ 3x, for retina screens and iPjone 6 Plus, respectively. For other types of screens, do not add this suffix. Also add the suffix ~ iphone for iPhone apps and ~ ipad for iPad apps. For example:

This functionality only works for applications built on SDK version 5.1.0 and higher. For other applications, you will need to add a use-app-thinning with a value of true in tiapp.xml (in ios section).
  <ti: app>
   <ios>
     <use-app-thinning> true </ use-app-thinning>
   </ ios>
 </ ti: app>

Please note that since files are added to the resource directory, you will not be able to access them from the file system, for example, using the Ti.Filesystem API. In order to have access to them, you will have to disable this functionality.

Auto Layout


From this release, your app can use iOS's Auto Layout engine to position elements.
AutoLayout activation:
  <ti: app>
   <ios>
     <use-autolayout> true </ use-autolayout>
   </ ios>
 </ ti: app> 

Javascript streams


By default, javascript is executed in a separate thread. From this release, you can start performing it in the main thread.
Activation:
  <ti: app>
   <ios>
     <run-on-main-thread> false </ run-on-main-thread>
   </ ios>
 </ ti: app>

Please note, this feature is experimental and it has bugs:

Height picker


In previous releases , Picker height was fixed. Now you can manage its height.

Safari dialog


Titanium SDK now includes the ti.safaridialog module. Use it to browse sites in an application similar to Safari.
The feature requires iOS 9 and higher, and the application must be built on Xcode 7 and up.

See Module API reference for details.

WatchOS Message Callback


From this release, if the application receives a message from Watch OS ( Titanium.WatchSession.sendMessage () ), then you can send a callback to it.

API changes


The following API methods are new or have gained extended support among platforms:
APIType ofDescription
Titanium.App.iOS.USER_NOTIFICATION_BEHAVIOR_DEFAULTpropertyThe text box will not appear. Use with the property property (New, iPhone, iPad)
Titanium.App.iOS.USER_NOTIFICATION_BEHAVIOR_TEXTINPUTpropertyA text box will appear to respond to the notification outside the application. Use with the property property (New, iPhone, iPad)
Titanium.App.iOS.UserNotificationAction.behaviorpropertyDetermines whether to show a text field in the notification to respond to the notification (New, iPhone, iPad)
Titanium.App.iOS.UserNotificationAction.getBehaviormethodReturns the value of the Titanium.App.iOS.UserNotificationAction.behavior property (New, iPhone, iPad)
Titanium.App.iOS.UserNotificationAction.setBehaviormethodSets the value of the Titanium.App.iOS.UserNotificationAction.behavior property (New, iPhone, iPad)
Titanium.App.iOS.shortcutitemclickeventIt works when a user clicks on an application shortcut (New, iPhone, iPad)
Titanium.BufferobjectBuffer is a modifiable, extensible container for raw data (Added support for Windows Phone)
Titanium.Calendar.hasCalendarPermissionsmethodReturns true if the application has permission to use the calendar (New, Android, iPhone, iPad)
Titanium.Calendar.requestCalendarPermissionsmethodRequests permission to use the calendar (New, Android, iPhone, iPad)
Titanium.ContactsobjectContacts module, used to access and change the system of contacts from the address book (added support for Windows Phone)
Titanium.Contacts.GroupobjectAn object that represents a group of users from the address book (added support for Windows Phone)
Titanium.Contacts.PersonobjectThe object that represents the entry from the address book (added support for Windows Phone)
Titanium.Geolocation.hasLocationPermissionsmethodReturns true if the application has permission to use geolocation (New, Android, iPhone, iPad)
Titanium.Geolocation.requestLocationPermissionsmethodRequests permission to use the calendar (New, Android, iPhone, iPad)
Titanium.IOStreamobjectIOStream is an interface that implements all types of streams (added support for Windows Phone)
Titanium.Media.hasCameraPermissionsmethodReturns true if the application has permission to use the camera (New, Android, iPhone, iPad)
Titanium.Media.requestCameraPermissionsmethodRequests permission to use the camera (New, Android, iPhone, iPad)
Titanium.UI.ActivityIndicatorStyleobjectA set of constants for styling Titanium.UI.ActivityIndicator (Added support for iPhone, iPad)
Titanium.UI.AlertDialog.getLoginPlaceholdermethodReturns the value of the Titanium.UI.AlertDialog.loginPlaceholder property (New API, iPhone, iPad.)
Titanium.UI.AlertDialog.getPasswordPlaceholdermethodReturns the value of the Titanium.UI.AlertDialog.passwordPlaceholder property (New API, iPhone, iPad.)
Titanium.UI.AlertDialog.getPlaceholdermethodReturns the value of the Titanium.UI.AlertDialog.placeholder property (New API, iPhone, iPad.)
Titanium.UI.AlertDialog.loginPlaceholderpropertyPlaceholder for the login field inside the dialog (New API, iPhone, iPad.)
Titanium.UI.AlertDialog.passwordPlaceholderpropertyPlaceholder for the password field inside the dialog (New API, iPhone, iPad.)
Titanium.UI.AlertDialog.placeholderpropertyPlaceholder text field inside the dialog. (New API, iPhone, iPad.)
Titanium.UI.AlertDialog.setLoginPlaceholdermethodSets the value of the Titanium.UI.AlertDialog.loginPlaceholder property (New API, iPhone, iPad.)
Titanium.UI.AlertDialog.setPasswordPlaceholdermethodSets the value of the Titanium.UI.AlertDialog.passwordPlaceholder property (New API, iPhone, iPad.)
Titanium.UI.AlertDialog.setPlaceholdermethodSets the value of the Titanium.UI.AlertDialog.placeholder property (New API, iPhone, iPad.)
Titanium.UI.Android.CardViewobjectCard view with rounded corners, background and shadow (New API, Android)
Titanium.UI.PickerobjectA control for selecting one of a fixed set of values ​​(Added support for Windows Phone.)
Titanium.UI.PickerColumnobjectThe column is a group of Titanium.UI.Picker values ​​that are available for selection (Added support for Windows Phone.)
Titanium.UI.PickerRowobjectThe field is a selectable value of the Titanium.UI.Picker element (Added support for Windows Phone.)
Titanium.UI.TabGroup.selectedeventIt works when the tab is selected (New API, iPhone, iPad.)
Titanium.UI.TabGroup.unselectedeventIt works when the tab is selected (New API, iPhone, iPad.)
Titanium.UI.View.getPreviewContextmethodReturns the value of the Titanium.UI.View.previewContext property (New API, iPhone.)
Titanium.UI.View.previewContextpropertyContext used in 3D-Touch "Peek and Pop". (New API, iPhone.)
Titanium.UI.View.setPreviewContextmethodSets the value of the Titanium.UI.View.previewContext property (New API, iPhone.)
Titanium.UI.createPickermethodCreates and returns a link to Titanium.UI.Picker. (Added support for Windows Phone.)
Titanium.UI.createPickerColumnmethodCreates and returns a reference to Titanium.UI.PickerColumn. (Added support for Windows Phone.)
Titanium.UI.createPickerRowmethodCreates and returns a link to Titanium.UI.PickerRow. (Added support for Windows Phone.)
Titanium.UI.iOS.ApplicationShortcutsobjectThe quick action API on the home screen is used to add actions for your application for more convenience (New API, iPhone.)
Titanium.UI.iOS.PREVIEW_ACTION_STYLE_DEFAULTpropertyNormal action style (New API, iPhone, iPad.)
Titanium.UI.iOS.PREVIEW_ACTION_STYLE_DESTRUCTIVEpropertyDestructive style for action (New API, iPhone, iPad.)
Titanium.UI.iOS.PREVIEW_ACTION_STYLE_SELECTEDpropertySelected action style (New API, iPhone, iPad.)
Titanium.UI.iOS.PreviewActionobjectPreviewAction for iOS9 3D-Touch Peek and Pop. (New API, iPhone.)
Titanium.UI.iOS.PreviewActionGroupobjectPreviewActionGroup for iOS9 3D-Touch Peek and Pop. (New API, iPhone.)
Titanium.UI.iOS.PreviewContextobjectPreviewContext for iOS9 3D-Touch Peek and Pop. (New API, iPhone.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_ADDpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_ALARMpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_AUDIOpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_BOOKMARKpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_CAPTURE_PHOTOpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_CAPTURE_VIDEOpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_CLOUDpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_COMPOSEpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_CONFIRMATIONpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_CONTACTpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_DATEpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_FAVORITEpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_HOMEpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_INVITATIONpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_LOCATIONpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_LOVEpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_MAILpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_MARK_LOCATIONpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_MESSAGEpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_PAUSEpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_PLAYpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_PROHIBITpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_SEARCHpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_SHAREpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_SHUFFLEpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_TASKpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_TASK_COMPLETEDpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_TIMEpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.SHORTCUT_ICON_TYPE_UPDATEpropertyA constant that defines an icon for an application shortcut (New API, iPhone, iPad.)
Titanium.UI.iOS.createApplicationShortcutsmethodCreates and returns a reference to Titanium.UI.iOS.ApplicationShortcuts. (New API, iPhone, iPad.)
Titanium.UI.iOS.createPreviewActionmethodCreates and returns a reference to Titanium.UI.iOS.PreviewAction. (New API, iPhone, iPad.)
Titanium.UI.iOS.createPreviewActionGroupmethodCreates and returns a reference to Titanium.UI.iOS.PreviewActionGroup. (New API, iPhone, iPad.)
Titanium.UI.iOS.createPreviewContextmethodCreates and returns a reference to Titanium.UI.iOS.PreviewContext. (New API, iPhone, iPad.)
Titanium.UI.iOS.forceTouchSupportedpropertyDetermines whether the device supports 3D-Touch Force Touch ( true/ false ) (New API, iPhone, iPad.)
Titanium.UI.iOS.getForceTouchSupportedmethodGets the value of Titanium.UI.iOS.forceTouchSupported (New API, iPhone, iPad.)
Titanium.UI.iOS.setForceTouchSupportedmethodSets the value of Titanium.UI.iOS.forceTouchSupported (New API, iPhone, iPad.)

Outdated APIs


APITypeNotes
Titanium.App.iOS.UserActivity.getSupportedmethodUse the Ti.App.iOS.UserActivity.isSupported () method instead.
Titanium.App.iOS.UserActivity.setSupportedmethodUse the Ti.App.iOS.UserActivity.isSupported () method instead.
Titanium.App.iOS.UserActivity.supportedpropertyUse the Ti.App.iOS.UserActivity.isSupported () method instead.
Titanium.Calendar.requestEventsAuthorizationmethodUse requestCalendarPermissions instead.
Titanium.Media.requestCameraAccessmethodUse requestCameraPermissions instead.
Titanium.UI.TabGroup.blureventUse unselected instead.
Titanium.UI.TabGroup.focuseventUse selected instead.
Titanium.UI.iPhone.ActivityIndicatorStyleobjectUse Ti.UI.ActivityIndicatorStyle instead.

Source: https://habr.com/ru/post/272001/


All Articles