QUICK INTRO - VIEWNAVIGATOR Manages moving between views. Has a stack of view data objects By default only one view exists, others are destroyed after remove (only data persists) Setup of default transitions Access to current view
QUICK INTRO - VIEW Visual container for a view of your mobile app. You should only add mobile-optimised Flex components here Accepts data passed in pushView Returns data by overriding createReturnObject() Has destructionPolicy (default – auto) to control whether the view should be destroyed on pop or just cached. Setup menu by placing ViewMenuItem in a <s:viewMenuItems> tag.
OPTIMIZATION - BITMAPS BitmapImage 3x faster than spark Image Try to avoid compressed image formats like JPG Do caching (on by default) and queuing (off by default) by using ContentCache. Assign it to contentLoader property of BitmapImage and Image
OPTIMIZATION - TEXT RichEditableText RichText Label StyleableTextField (new in Flex 4.5) StageText (coming in Flex 4.6)
OPTIMIZATION - TEXT Only StyleableTextField extends flash.text.TextField Can’t use StyleableTextField directly in MXML, so you’re quite pushed to use it in AS3.
OPTIMIZATION – LISTS AND ITEMRENDERERS All mentioned before apply uber-optimized LabelItemRenderer and IconItemRenderer
OPTIMIZATION – LISTS AND ITEMRENDERERS Mobile item renderers – if possible use bundler uber-optimized LabelItemRenderer and IconItemRenderer, they were shown in all Flex Mobile demos. Avoid complex binding expressions. Turn off autoDrawBackground if not needed. Use cacheAsBitmap, but be careful. Use opaqueBackground itemRendererFunction prevents pooling and recycling. Favor FXG over spark graphic elements (if possible)
OPTIMIZATION - SKINS Extend MobileSkin instead of SparkSkin AS3 version will perform better than MXML Use FXG for static vector graphics, use where possible Use GraphicElement as lightweight graphic primitives. E.g. Backgrounds, borders etc.
TRICKS’N’TIPS Adding platform specific UI patterns CSS media rules Separate projects with common code base Ready multiplatform mobile themes
TRICKS’N’TIPS Handlingmulti DPI devices with MultiDPIBitmapSource
TRICKS’N’TIPS Be sure not to put references to view instances anywhere.
TRICKS’N’TIPS Don’t interfere expensive process of parsing data into view when doing a transition. Use BusyIndicator before or after transition.
TRICKS’N’TIPS Don’t cheat by testing your app on a high-end smartphone