What is the best way to skin/theme an AIR application. For example, I want to use a dark/blackish theme instead (similar to Tour de Flex) instead of the default gray one.
The ScaleNine themes are a good place to start, find one that is sort of like what you want, plug it into your app, and gradually replace the colors, images, and controls with your own.
http://www.scalenine.com/
I'm only just getting started in AIR as well, but if you're using Flex check out the Flex in a Week video series. There are several videos that cover creating custom MXML components and item renderers, which effectively let you skin your application.
You can also use CSS to style your app.
First you need to set the system chrome property in the air application properties file to none.
<initialWindow>
...
<systemChrome>none</systemChrome>
...
</initialWindow>
If the main file in your air app is named Main.mxml, then your application properties files will be named Main-app.xml. This file is not hard to find, it should be in the same location as the Main.mxml file.
By setting this property to none you are saying that you do not wish your air app window to take the style of the OS windows in which the app is running.
Since this property is set to none, the chrome for the air app will have to come from your Main.mxml file, which should be a WindowedApplication
Use the titleBarBackgroundSkin attriubute of the WindowedApplication To set the skin for the air app. titleBarBackgroundSkin defaults to "mx.skins.halo.ApplicationTitleBarBackgroundSkin"
Related
We've used an existing example application to start a proof of concept with Worklight, we've made a lot of changes to the original code and we would like to change the application name and customize its icons and splash image. We've managed to make the aforementioned changes (Name, icons and splash) inside xCode, however this doesn't serve the future purpose of an automated build from Worklight to ipa.
Could you please let us know what steps are involved to:
How to rename an existing application in Worklight (changing only the application-descriptor.xml doesn't change the generated binaries though).
How to change icons and splash screens for app.
When you create a new application for a Worklight project, the application name is used throughout several files, so you will need to find all occurrences of the given application name and change them. These are:
main HTML filename
main CSS filename
main JavaScript filename
inside main HTML filename (references to the main CSS and JavaScript files, title)
Inside application-descriptor.xml (the elements: displayName, description, mainFile)
Note, the filenames should not matter to you. In the future they will, hopefully, always get a generic name (like index.html or main.css. ...).
The app icon title in the device is controlled by the displayName element in application-descriptor.xml.
As for the icons and splash images, you can simply place thme (regular icon, retina icon, splash image, retina splash image) with the appropriate filenames in the "nativeResources" folder (sits next to the "native" folder) and they will be copied during build time to the native project (which you will eventually open in Xcode).
You can find out the correct filenames inside the native >> Resources folder.
quote:
however this doesn't serve the future purpose of an automated build
from Worklight to ipa.
Worklight will, of course, never create an .ipa file for you... that's the role of Xcode.
We are going to develop a mobile app (iOS and Android), which should provide downloading and storing several user-selected PDF files and viewing them within the app (iOS with WebView) or with an external PDF Viewer (Android).
My Question is: Is this possible with Trigger.io? I didn't find anything concerning this in the official documentation. Can we do something with the file or the child browser / tabs module? If yes, do you have any examples?
Note: We will use Backbone.js and jQuery Mobile as additional libraries.
The Android webview doesn't allow for inline opening of PDFs - you can test that by opening e.g. http://trigger.io/cross-platform-application-development-blog/wp-content/uploads/2012/05/trigger.io-whitepaper.pdf in your stock browser.
On iOS, you can use:
forge.tools.getURL('my_file.pdf',
function (file) {
forge.tabs.open(file);
}
);
But that won't work on Android (tested on 2.3, 3 and 4.0).
Short answer - yes.
Downloading, storing, then showing/referencing later can definitely be done. Check out the forge.file documentation.
I have not tried the child browser feature yet. Although the tabs module will work, I think its best to just let the device (and its user settings) decide how to display/render the PDF. I am only saying this because my devices (especially the Android ones... 2.3 and 4.x) tend to behave differently. Either way... the device's "back button" always gets me back to where I left off in my trigger.io app.
When we open Dropbox folder, we can see icon on the left bottom of the folder.
I am developing an application in which i also want the same behavior. If folder is syncing then it will show sync icon and for other operation it will show other icon. The marked files/folder when viewed in Finder must be shown with a custom icon. But when they are selected for preview ( using spacebar) they must show their original icon ( i.e the blue icon for folder etc) .
Starting with Yosemite (10.10), there is now an officially supported (and thus Mac App Store compatible) method for displaying sync status badges in Finder icons in the form of Finder Sync extensions.
Dropbox has developed a NSPlugin for showing icon badges on each folder/file. As you would know, NSPlugins for Finder were deprecated by Apple starting with Snow Leopard. I think Dropbox worked around it with a hack - that reenabled plugin support. I don't think Apple would have liked that. Apple wants third party apps to only provide services support, since they don't want any third party code in Finder's process, but services are underwhelming.
In addition to the Finder Sync Extension mentioned in other answers, badges (and other metadata) on files can additionally be accomplished via the File Provider API:
File Provider
An extension other apps use to access files and folders managed by your app and synced with a remote storage.
https://developer.apple.com/documentation/fileprovider
Specifically, the NSFileProviderItemDecorating class:
Badge
The system displays the badge image on top of the item’s icon. It only displays the first Badge image.
FolderBadge
Only available on folder items. The system embosses the image over the folder icon. It only displays the first FolderBadge image.
This can be achieved by creating new Finder Sync Extension. Find more information here: https://stackoverflow.com/a/43183393
I'm building in FlashDevlop as pure AS3.
I'm looking at building a kiosk that uses two screens. Its used to administer tests. So one screen has the test, second the controls for admin the test. I have played with wide app but its not very elegant and I really would like both screens to run full screen on each screen. Is it possible to have one air app spawn two native air windows? A secondary question is it possible to detect multiple screens and target a screen to full screen to? Even something as simple as checking the window size to detect would work, im just not sure I can move and if the low level api will fullscreen on that screen. I could not find any examples of this in the docs.
What docs did you look into? I found it right away.
You'll need the Screen class if you want information on the screens that are connected to the PC. And here's some documentation on using it.
To create new windows, just instantiate a new NativeWindow class and call activate() on it when you're done configuring.
There's a lot of other useful stuff for you in the flash.display package. All the AIR stuff is marked with a little AIR icon. I have to admit that it would have been easier to find if they had put these classes in a separate AIR package.
I want to use icons like opened/closed folder in my table (UITableView)?
UPD:
For example, in Java you can get a standard image "folder" and use it in the FileTree:
new
DefaultTreeCellRenderer().getDefaultClosedIcon()
And also can use the constants of L&F (colors, styles, icons).
In the iOS, I found only these standard icons.
But not folder icons...
I'm not quite sure exactly what you want - the folder icon from iOS? Could you explain a little better?
If it is a folder icon that you want, there's no quick way to get it from code - doing so would use private API's and your app is likely to be rejected from the app store.
If you want something like a folder icon, a good way to get it would be by taking a screenshot of the iPhone simulator and editing it to the right size etc.