DEV Community

Cover image for Titanium News #17
Michael Gangolf
Michael Gangolf

Posted on

Titanium News #17

Older posts can be found here.

Intro

It's been a long time since the last news update. Been busy with other projects ๐Ÿ˜„ Many Titanium related of course.

Titanium 12.2.1.GA, whats new in main branch and many modules updates.

Titanium 12.2.1.GA

Happy to announce that Titanium 12.2.x is available! The latest 12.2.1 bugfix release fixed some issues that where found after 12.2.0. Titanium 12.2.1 is packed with fixes and updates again. You can check all in the 12.2.0.GA release notes and the 12.2.1.GA release notes.

Some highlights are:

Reduced TableView updates on Android - PR

The amount of row updates was reduced a lot when you set the data property of a TableView. In a simple test with just 20 lines the internal update function was called only 23 times instead of 43 times.

New ListView scrolling event property forceUpdates - PR

Video

forceUpdates is a new property that you can use in combination with continuousUpdate. If you enable both you'll get scroll updates for almost every pixel (as fast as it can) and you receive the scrolled top position of your ListView. With this you can hide/show elements based on the scroll position. Full example can be found in the PR.

Different TabGroup tabModes on Android - PR

tabmodes

When opening a TabGroup you can set it to be either fixed (Ti.UI.Android.TAB_MODE_FIXED) or scrollable (Ti.UI.Android.TAB_MODE_SCROLLABLE).

Android: new property badgeTextColor PR

badge

badgeTextColor can be used in combination with badgeBackgroundColor to style the BottomNavigation badge on Android.

Android: Secure Ti.Network.Socket PR

If you use a TCP socket in Titanium you can enable secure:true on Android now to use a SSLSocket connection.

Android: make rotationX, rotationY animatable - PR

Android has two properties rotationX and rotationY that allow you to quickly set the rotation of an element. Those properties can now be used in the animate method. A full example + video is available in the PR.

Android: CameraX - PR

camerax
One of the bigger changes is that CameraX is included now! If you want to use it you can enable it with useCameraX:true inside the showCamera properties. It only works in combination with an overlay (otherwise the normal camera was used) but it has many new properties like aspectRatio, scalingMode, verticalAlign, targetImageWidth/Height.
Check the PR for more examples and images. Feel free to opt-in to CameraX and start using it.

modernize Apple Script to open Xcode - PR

After quite some time the Apple script to open Xcode was modernized including support of the macOS system settings app, clean up and better wording in the dialog.

iOS: support for DRM-encrypted video assets - PR

Use fairPlayConfiguration inside the VideoPlayer in order to play DRM-encrypted videos.

iOS: keyboardDismissMode for TableViews - PR

After adding keyboardDismissMode in ListViews it is now available for TableViews, too.

macOS: Build fixes for macOS (Catalyst) builds - PR

Build fixes for macOS builds.

iOS: fix orientation of the thumbnail image created from a video - PR

If you create thumbnails from videos they will be in the correct orientation now.

And there are only a few of the pull request that were merged into 12.2.0. Big ๐Ÿ‘ to the community and all contributors ๐Ÿš€

Preview

The next release with new features will be 12.3.0. Some possible pull request that could make it in to that version are:

and more. Currently we have 63 open PR but feel free to add more or test them.

Titanium CLI v7 (alpha)

Behind the scenes one of the core developers @cb1kenobi is working on a new, modernized Titanium CLI. You can follow his progress in the alpha PR post.

Modules

Tips & Tricks

Access database/collections of your Android app

If you use Collections inside your app (or a local database) you can use the following command to grab the Alloy database and dump it to a local file:

adb -d shell "run-as com.yourId cat /data/data/com.yourId/databases/_alloy_" > test.db
Enter fullscreen mode Exit fullscreen mode

Now you can use e.g. SQLiteBrowser to view it and access it as a normal database. If you make changes in your app can run the command again and press F5 to update the data in SQLiteBrowser. This makes it much quicker to verify the data inside your database and check the collections.

Optimize GeoJSON data

geojson

Some apps require you to use a GeoJSON file to display polygons on your map. Those files can be very big if they are really detailed.
Luckily there are some tools like https://turfjs.org/docs/#simplify and https://mapshaper.org/ to optimize your files and reduce the content. If you don't need every small border point you can go down from a 1.7MB file to 128KB and still have good enough shape to show it in your app. Smaller files are parsed faster so you can test how low you can go without losing details.

That's it

If you have feedback or some interesting Titanium SDK apps, modules or widgets you would like to share: get in contact with me or leave a comment and I'll add it to the next Titanium news.

Top comments (0)