It’s been a few weeks since I’ve posted in the Weekend Coder series, and what a few weeks they’ve been when it comes to BlackBerry apps and development. Specifically, what does the Amazon partnership mean for native development? Obviously no one knows for sure but regardless of what the future holds, it won’t affect my passion for coding for BlackBerry 10. I plan to keep developing, in Cascades, because I enjoy it. And today I am going to share some of the new features 10.3 brings to the ActionBar.
The most obvious change to the ActionBar is the introduction of the signature action. Defining which action you’d like to be your signature action is as simple as defining the placement parameter.
ActionItem { ActionBar.placement: ActionBarPlacement.Signature }
Once defined, as a developer you have the ability to stylize your signature action by colorizing the action. You can use any color you want, defined in either hex, rgb, or the default color names. Otherwise it will default to your primary color and by default the primary color is Sky Blue (#0092CC). Defining the color looks something like:
ActionItem { title: "CrackBerry" imageSource: "asset:///images/icon1.png" ActionBar.placement: ActionBarPlacement.Signature backgroundColor: Color.create("#FF3D05") }
That code will produce a look similar to the main picture of this blog using hex to define the CrackBerry orange. Or using rgb, I create any color as well…
ActionItem { title:"Letters" imageSource:"asset:///images/icon1.png" ActionBar.placement:ActionBarPlacement.Signature backgroundColor:Color.create(0.96,0.37,0.06) }
This definitely gives your BlackBerry 10 app a nice pop of color, and gives an opportunity to extend your brand/theme color scheme into the ActionBar.
Another drastic change to the ActionBar is the ability to have a text input area using TextInputActionItem. This action has many of the same properties as a TextField such as hintText, submitKey, and obviously text. So an example of TextInputActionItem with a blank field, keyboard set to numbers, submit key will say “Send”, and when “submitted” the text will replace a Label called label5 and change the text field back to blank:
TextInputActionItem { id: inputAction text: "" input.keyLayout: KeyLayout.Number input { submitKey: SubmitKey.Send onSubmitted: { label5.text = inputAction.text; inputAction.text = ""; } } }
This will produce something that looks like:
Also notice in the screenshot I left my “CB” signature action item in the code. It is not possible to have a signature action and a text input action at the same time. So the code will ignore the signature property and replace it as if it was defined “onBar”.
I’m not sure of the exact use case developers would use this new text input for, possibly for a chat client? Or possibly for a search bar? Either way, I am glad to see expanded functionality to the Cascades toolset.
The ActionBar has always been a main component of almost every native BlackBerry 10 app and with these new additions in 10.3 we are moving towards refinements of tools rather than getting features that are absolutely necessary to code. This is a great sign of the platform beginning to mature. And in the coming weeks I plan to explore the many other maturing features of 10.3.
Read more
BlackBerry 10 device simulators updated to 10.3.1.2072
A little something for BlackBerry developers. If you head over to the BlackBerry developer site, you'll find a new batch of device simulators available for download. The last release shows them as running v10.3.1.2072 which should help with testing out any apps you're working on. As always, they're available for Window, Mac and Linux via VMWare images. There is no notable changes or...
BlackBerry OS 10.3.1.1949 device simulator now available
Just a little bit of a heads up for any developers (and those who just like to play around) who might not have spotted the update as of yet. You can now download the latest device simulator from the BlackBerry website, which sits at OS 10.3.1.1949. Keep in mind, if you plan on giving it a look you will need some VMWare tools in order to run it all but you can find the full details on...
Watch the application infrastructure for BES12 webcast
If you missed out on the application infrastructure for BES12 webcast on December 4th, you can now catch the replay of the event on your own time. We'll review the mobile app infrastructure built into BES 12 including how corporate systems can minimize risk when opening access to apps outside their firewall, and ensure data is secure through its journey from inside the corporate...
Application Infrastructure for BES 12 webcast
Creating apps for Enterprise customers can keep a developer busy but when doing so corporate data and systems need to be carefully managed. If you're building apps for BES12 customers, BlackBerry is hosting an application infrastructure for BES12 webcast on December 4, 2014, at 2 pm – 3 pm EST to help educate corporate app developers about best practices. We'll review the mobile...