<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" ><channel><title>cssgallery.info</title> <atom:link href="http://cssgallery.info/feed/" rel="self" type="application/rss+xml" /><link>http://cssgallery.info</link> <description>Resources for web and mobile developers</description> <lastBuildDate>Mon, 09 Jan 2012 18:54:55 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.2.1</generator> <item><title>QR Generator module for Titanium Appcelerator</title><link>http://cssgallery.info/qr-generator-module-for-titanium-appcelerator/</link> <comments>http://cssgallery.info/qr-generator-module-for-titanium-appcelerator/#comments</comments> <pubDate>Fri, 14 Oct 2011 08:34:02 +0000</pubDate> <dc:creator>Dan Tamas</dc:creator> <category><![CDATA[iPhone]]></category> <category><![CDATA[Titanium Appcelerator]]></category> <category><![CDATA[generate QR codes]]></category> <category><![CDATA[QR codes]]></category> <category><![CDATA[titanium appcelerator]]></category><guid isPermaLink="false">http://cssgallery.info/?p=2113</guid> <description><![CDATA[After Appcelerator launched the Marketplace I managed to create and post an iOs only module that is able to <strong>create QR codes directly on the  device</strong> without using an online service.It can generate <strong>all types of codes</strong> (from 1 to 40) and with <strong>any level of correction</strong> (L, M, Q, H). You can also <strong>customize the size of the resulting QR code</strong> and it will try to adapt itself to this size to remain perfectly sharp and fully visible.]]></description> <content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">var dzone_url="http://cssgallery.info/qr-generator-module-for-titanium-appcelerator/";var dzone_title="QR Generator module for Titanium Appcelerator";var dzone_style="1";var dzone_blurb="";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div class="tweetmeme_button" style="float: right; margin: 10px !important;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcssgallery.info%2Fqr-generator-module-for-titanium-appcelerator%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcssgallery.info%2Fqr-generator-module-for-titanium-appcelerator%2F&amp;source=dan_tamas&amp;style=normal&amp;b=2" height="61" width="50" /><br /> </a></div><p>After Appcelerator launched the Marketplace I managed to create and post an iOs only module that is able to <strong>create QR codes directly on the device</strong> without using an online service.</p><p>It can generate <strong>all types of codes</strong> (from 1 to 40) and with <strong>any level of correction</strong> (L, M, Q, H). You can also <strong>customize the size of the resulting QR code</strong> and it will try to adapt itself to this size to remain perfectly sharp and fully visible.</p><p>For now it&#8217;s able to generate these types of content:</p><ul><li>pure text</li><li>SMS (phone number, message)</li><li>phonecall (phone number)</li><li>email ( to, subject, message)</li><li>geo (lat, lon)</li><li>url</li></ul><p>You can buy it from the Marketplace: <a href="https://marketplace.appcelerator.com/apps/873" title="QR Generator module for Titanium Appcelerator" target="_blank">QR Generator module</a>.</p><div style="clear:both;">&nbsp;</div><div class="shr-publisher-2113"></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fcssgallery.info%2Fqr-generator-module-for-titanium-appcelerator%2F'></a><a class='shareaholic-fbsend' shr_href='http%3A%2F%2Fcssgallery.info%2Fqr-generator-module-for-titanium-appcelerator%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fcssgallery.info%2Fqr-generator-module-for-titanium-appcelerator%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><h3>Related posts:</h3><ol><li><a href='http://cssgallery.info/custom-row-for-tableview-in-appcelerator-titanium/' rel='bookmark' title='Custom row for TableView in Appcelerator Titanium'>Custom row for TableView in Appcelerator Titanium</a></li><li><a href='http://cssgallery.info/making-a-combo-box-in-titanium-appcelerator-code-and-video/' rel='bookmark' title='Making a combo-box in Titanium Appcelerator &#8211; code and video'>Making a combo-box in Titanium Appcelerator &#8211; code and video</a></li><li><a href='http://cssgallery.info/create-a-countdown-timer-with-titanium-appcelerator/' rel='bookmark' title='Create a countdown timer with Titanium Appcelerator'>Create a countdown timer with Titanium Appcelerator</a></li></ol>]]></content:encoded> <wfw:commentRss>http://cssgallery.info/qr-generator-module-for-titanium-appcelerator/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Seven days with Titanium &#8211; day 7 &#8211; orientation and accelerometer</title><link>http://cssgallery.info/seven-days-with-titanium-day-7-orientation-and-accelerometer/</link> <comments>http://cssgallery.info/seven-days-with-titanium-day-7-orientation-and-accelerometer/#comments</comments> <pubDate>Thu, 13 Oct 2011 20:29:22 +0000</pubDate> <dc:creator>Dan Tamas</dc:creator> <category><![CDATA[Android]]></category> <category><![CDATA[iPhone]]></category> <category><![CDATA[Titanium Appcelerator]]></category> <category><![CDATA[accelerometer]]></category> <category><![CDATA[orientation]]></category> <category><![CDATA[Ti.Accelerometer]]></category> <category><![CDATA[Ti.Gesture]]></category> <category><![CDATA[Ti.UI.FACE_DOWN]]></category> <category><![CDATA[Ti.UI.FACE_UP]]></category> <category><![CDATA[Ti.UI.LANDSCAPE_LEFT]]></category> <category><![CDATA[Ti.UI.LANDSCAPE_RIGHT]]></category> <category><![CDATA[Ti.UI.PORTRAIT]]></category> <category><![CDATA[Ti.UI.UNKNOWN]]></category> <category><![CDATA[Ti.UI.UPSIDE_PORTRAIT]]></category> <category><![CDATA[titanium appcelerator]]></category><guid isPermaLink="false">http://cssgallery.info/?p=2117</guid> <description><![CDATA[Most of the devices nowadays are equipped with an accelerometer that detect the orientation of the device or the movements the user is doing with it.Titanium exposes this functionality through its APIs so let's take advantage of that :)]]></description> <content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">/*<![CDATA[*/var dzone_url="http://cssgallery.info/seven-days-with-titanium-day-7-orientation-and-accelerometer/";var dzone_title="Seven days with Titanium &#8211; day 7 &#8211; orientation and accelerometer";var dzone_style="1";var dzone_blurb="";/*]]>*/</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div class="tweetmeme_button" style="float: right; margin: 10px !important;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcssgallery.info%2Fseven-days-with-titanium-day-7-orientation-and-accelerometer%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcssgallery.info%2Fseven-days-with-titanium-day-7-orientation-and-accelerometer%2F&amp;source=dan_tamas&amp;style=normal&amp;b=2" height="61" width="50" /><br /> </a></div><p>Most of the devices nowadays are equipped with an accelerometer that detect the orientation of the device or the movements the user is doing with it.</p><p>Titanium exposes this functionality through its APIs so let&#8217;s take advantage of that <img src='http://cssgallery.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><h2>The orientation</h2><p>The device can report <strong>7 states of the orientation</strong> and they are defined in Titanium as follows:</p><ul><li>Ti.UI.UNKNOWN &#8211; the app cannot detect the position</li><li>Ti.UI.PORTRAIT</li><li>Ti.UI.UPSIDE_PORTRAIT</li><li>Ti.UI.LANDSCAPE_LEFT</li><li>Ti.UI.LANDSCAPE_RIGHT</li><li>Ti.UI.FACE_DOWN &#8211; like resting on a table with the screen downward</li><li>Ti.UI.FACE_UP &#8211; like resting on a table but with the screen upward</li></ul><p>While we have all this constants defined there are situations where <strong>they might not be available</strong>: in iOs when the user locks the orientation <strong>the device will report <u>that</u> orientation</strong> no matter how the device is held. On Android <strong>many devices can detect only the PORTRAIT and LANDSCAPE_LEFT orientations</strong>.</p><p>Since version 1.7.2 of the SDK the orientation API changed and is set per window (or activity). You can do this using the property <strong>orientationModes</strong> that accepts an array with the allowed orientation for that window. <a href="http://developer.appcelerator.com/blog/2011/07/android-window-orientation-behavior-change-for-1-7-2.html" title="Appcelerator orientation" target="_blank">See this post on Appcelerator&#8217;s blog</a>.</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">win.<span style="color: #660066;">orientationModes</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">PORTRAIT</span><span style="color: #339933;">,</span> Ti.<span style="color: #660066;">UI</span>.<span style="color: #660066;">LANDSCAPE_RIGHT</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div><p>There is also an event that triggers when the orientation changes allowing you to make the changes you might need (adapt the UI to the new orientation for example.)</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ti.<span style="color: #660066;">Gesture</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'orientationchange'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">orientation</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>The alert <strong>will show a number from 1 to 7</strong> because the constants defined above are type INT. A good practice is to compare the orientation reported by the event with the constant and not directly with the number. In case something will change in the future this will assure you that the code will keep working.</p><p>You can find more about it in the docs page for <a href="http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Gesture-module" title="Titanium Gesture APIs" target="_blank">Titanium.Gesture</a></p><h2>The accelerometer</h2><p>The accelerometer is a piece of hardware that <strong>is giving you the current position of the device in a 3D coordinates</strong> (x, y and z) vector. This can allow you for example to control the movements of an element on the screen.</p><p>To get this vector all you have to do is to <strong>catch the update event</strong> of the <a href="http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Accelerometer-module" title="Titanium Accelerometer" target="_blank">Titanium.Accelerometer APIs</a>. It will return the vector we were talking about.</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Ti.<span style="color: #660066;">Accelerometer</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'update'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    lbl.<span style="color: #660066;">text</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'x: '</span> <span style="color: #339933;">+</span> e.<span style="color: #660066;">x</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'y:'</span> <span style="color: #339933;">+</span> e.<span style="color: #660066;">y</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'z:'</span> <span style="color: #339933;">+</span> e.<span style="color: #660066;">z</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>Again, <strong>it&#8217;s a good practice to remove the event when we don&#8217;t need it anymore</strong> to save some CPU cycles <img src='http://cssgallery.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>Well, that&#8217;s it for Day 7. Code strong!</p><div style="clear:both;">&nbsp;</div><div class="shr-publisher-2117"></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fcssgallery.info%2Fseven-days-with-titanium-day-7-orientation-and-accelerometer%2F'></a><a class='shareaholic-fbsend' shr_href='http%3A%2F%2Fcssgallery.info%2Fseven-days-with-titanium-day-7-orientation-and-accelerometer%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fcssgallery.info%2Fseven-days-with-titanium-day-7-orientation-and-accelerometer%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><h3>Related posts:</h3><ol><li><a href='http://cssgallery.info/seven-days-with-titanium-day-0-introduction/' rel='bookmark' title='Seven days with Titanium &#8211; day 0 &#8211; introduction'>Seven days with Titanium &#8211; day 0 &#8211; introduction</a></li><li><a href='http://cssgallery.info/seven-days-with-titanium-day-5-gps-and-maps/' rel='bookmark' title='Seven days with Titanium – day 5 – GPS and Maps'>Seven days with Titanium – day 5 – GPS and Maps</a></li><li><a href='http://cssgallery.info/seven-days-with-titanium-day-4-media-images-movies-and-sounds/' rel='bookmark' title='Seven days with Titanium – day 4 – Media – images, movies and sounds'>Seven days with Titanium – day 4 – Media – images, movies and sounds</a></li></ol>]]></content:encoded> <wfw:commentRss>http://cssgallery.info/seven-days-with-titanium-day-7-orientation-and-accelerometer/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Insights from the Titanium App Developer certification exam</title><link>http://cssgallery.info/insights-from-the-titanium-app-developer-certification-exam/</link> <comments>http://cssgallery.info/insights-from-the-titanium-app-developer-certification-exam/#comments</comments> <pubDate>Thu, 29 Sep 2011 18:51:51 +0000</pubDate> <dc:creator>Dan Tamas</dc:creator> <category><![CDATA[Titanium Appcelerator]]></category> <category><![CDATA[Appcelerator]]></category> <category><![CDATA[certification]]></category> <category><![CDATA[exam]]></category> <category><![CDATA[TCAD]]></category> <category><![CDATA[titanium]]></category> <category><![CDATA[Titanium Appcelerator TCAD exam certification]]></category><guid isPermaLink="false">http://cssgallery.info/?p=2097</guid> <description><![CDATA[Recently I became a Titanium Certified Application Developer (TCAD) and I was thinking on giving some insights on the exam for those who want to take it.]]></description> <content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">var dzone_url="http://cssgallery.info/insights-from-the-titanium-app-developer-certification-exam/";var dzone_title="Insights from the Titanium App Developer certification exam";var dzone_style="1";var dzone_blurb="";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div class="tweetmeme_button" style="float: right; margin: 10px !important;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcssgallery.info%2Finsights-from-the-titanium-app-developer-certification-exam%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcssgallery.info%2Finsights-from-the-titanium-app-developer-certification-exam%2F&amp;source=dan_tamas&amp;style=normal&amp;b=2" height="61" width="50" /><br /> </a></div><p><img src="http://cssgallery.info/wp-content/uploads/2011/09/tcad_tab_small-1.png" alt="" title="TCAD" width="83" height="100" class="alignleft size-full wp-image-2098" /></p><p>Recently I became a Titanium Certified Application Developer (TCAD) and I was thinking on giving some insights on the exam for those who want to take it.</p><p>The exam covers all the areas that exists in the process of developing an app with Titanium Appcelerator:</p><ul><li>Code Questions,</li><li>Contacts and Social APIs,</li><li>Cross-Platform Development in Titanium,</li><li>Integrating Web Content,</li><li>Media and the Filesystem,</li><li>Using Location Services,</li><li>Working with Local Data,</li><li>Working With Remote Data,</li><li>You&#8217;re a Native Application Developer Now,</li><li>Zero To App Recap,</li><li>UI Fundamentals,</li><li>Deployment and Distribution.</li></ul><p>To pass the exam you will need of course experience but the Appcelerator team has put online at <a title="TCAD Course Lab" href="http://wiki.appcelerator.org/display/td/TCAD+Course+Labs" target="_blank">Wiki</a> the <strong>labs for each part of the exam</strong>. I strongly suggest you to <strong>take a good look at them</strong>, even at those that might look already known to you, because you might find some nice stuff inside and it will also remind you forgotten stuff at least.</p><p><strong>Some of the courses have videos</strong> and also links to the downloadable projects.</p><p>The projects are a good point to start/learn how to do things &#8220;the right way&#8221; and explain pretty well some principles that apply to an Appcelerator app.</p><p>Don&#8217;t let the word &#8220;exam&#8221; scare you because it&#8217;s not really difficult &#8211; some of the questions are simple and common sense.</p><p>So go for it!</p><div style="clear:both;">&nbsp;</div><div class="shr-publisher-2097"></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fcssgallery.info%2Finsights-from-the-titanium-app-developer-certification-exam%2F'></a><a class='shareaholic-fbsend' shr_href='http%3A%2F%2Fcssgallery.info%2Finsights-from-the-titanium-app-developer-certification-exam%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fcssgallery.info%2Finsights-from-the-titanium-app-developer-certification-exam%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><h3>Related posts:</h3><ol><li><a href='http://cssgallery.info/seven-days-with-titanium-day-0-introduction/' rel='bookmark' title='Seven days with Titanium &#8211; day 0 &#8211; introduction'>Seven days with Titanium &#8211; day 0 &#8211; introduction</a></li><li><a href='http://cssgallery.info/custom-row-for-tableview-in-appcelerator-titanium/' rel='bookmark' title='Custom row for TableView in Appcelerator Titanium'>Custom row for TableView in Appcelerator Titanium</a></li><li><a href='http://cssgallery.info/create-a-countdown-timer-with-titanium-appcelerator/' rel='bookmark' title='Create a countdown timer with Titanium Appcelerator'>Create a countdown timer with Titanium Appcelerator</a></li></ol>]]></content:encoded> <wfw:commentRss>http://cssgallery.info/insights-from-the-titanium-app-developer-certification-exam/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Possible new CSS features from Adobe</title><link>http://cssgallery.info/possible-new-css-features-from-adobe/</link> <comments>http://cssgallery.info/possible-new-css-features-from-adobe/#comments</comments> <pubDate>Tue, 05 Jul 2011 15:43:04 +0000</pubDate> <dc:creator>Lucica Ibanescu</dc:creator> <category><![CDATA[CSS & CSS3]]></category> <category><![CDATA[Accessibility]]></category> <category><![CDATA[accessible]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[CSS Exclusions]]></category> <category><![CDATA[CSS Regions]]></category> <category><![CDATA[css3]]></category> <category><![CDATA[draft]]></category> <category><![CDATA[features]]></category> <category><![CDATA[flow]]></category> <category><![CDATA[multi column layout]]></category> <category><![CDATA[pie charts]]></category> <category><![CDATA[proposal]]></category> <category><![CDATA[prototype]]></category><guid isPermaLink="false">http://cssgallery.info/?p=2070</guid> <description><![CDATA[Inspired from the print world people from Adobe and Microsoft are coming with <strong>new features</strong> that might (or might not) be embedded into future CSS specs. These new features - <a href="http://dev.w3.org/csswg/css3-regions/" title="CSS Regions proposal">CSS Regions</a> and <a href="http://dev.w3.org/csswg/css3-exclusions/" title="CSS exclusions draft">CSS Exclusions</a> - will <strong>allow text to flow into webpages pretty much like they do in newspapers</strong> and magazines. ]]></description> <content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">var dzone_url="http://cssgallery.info/possible-new-css-features-from-adobe/";var dzone_title="Possible new CSS features from Adobe";var dzone_style="1";var dzone_blurb="";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div class="tweetmeme_button" style="float: right; margin: 10px !important;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcssgallery.info%2Fpossible-new-css-features-from-adobe%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcssgallery.info%2Fpossible-new-css-features-from-adobe%2F&amp;source=dan_tamas&amp;style=normal&amp;b=2" height="61" width="50" /><br /> </a></div><p>Inspired from the print world, people from Adobe and Microsoft are coming with <strong>new features</strong> that might (or might not) be embedded into future CSS specs. These new features &#8211; <a href="http://dev.w3.org/csswg/css3-regions/" title="CSS Regions proposal">CSS Regions</a> and <a href="http://dev.w3.org/csswg/css3-exclusions/" title="CSS exclusions draft">CSS Exclusions</a> &#8211; will <strong>allow text to flow into webpages pretty much like they do in newspapers</strong> and magazines.</p><p>You remember that the idea of text flowing into columns is another CSS3 proposal, <a href="http://www.w3.org/TR/2011/CR-css3-multicol-20110412/" title="CSS multi-column layout">CSS Multi-column Layout Module</a> and web layouts imitating magazine layouts is <a href="http://www.w3.org/TR/css3-page/" title="CSS3 paged media module">CSS3 Paged Media Module</a></p><p>Let&#8217;s see some <a href="http://labs.adobe.com/downloads/cssregions.html" title="CSS regions and exclusions implemented by Adobe">examples that Adobe implemented</a>:</p><h2>Content threads and shapes using CSS regions</h2><p>Text could easily <strong>flow from one region to the other</strong> and we can also choose to imbricate regions or give them different widths, heights and positions in the layout (see picture below)</p><p><img src="http://cssgallery.info/wp-content/uploads/2011/07/multiple-content-threads.jpg" alt="multiple content threads with CSS regions" title="multiple content threads with CSS regions" width="568" height="272" class="alignnone size-full wp-image-2071" /><br /> <img src="http://cssgallery.info/wp-content/uploads/2011/07/capture-2.png" alt="content shaped like a heart with CSS regions" title="content shaped like a heart with CSS regions" width="229" height="216" class="alignleft size-full wp-image-2073" style="box-shadow:none !important"/><br /> If you can set rectangular regions, why not come up with weird <strong>custom shapes</strong>?</p><p>Text will also flow from one region (shape in this case) to another.</p><p>The idea is super-cool and we waited for it for a while now, but <strong>I do wonder about its usability</strong> if we think about the way people are reading web content versus printed text (that might change the bottom-top L shaped reading order observed with eye tracking methods).</p><h2>Content exclusion</h2><p><img src="http://cssgallery.info/wp-content/uploads/2011/07/text-exclusion.gif" alt="text exclusion with CSS" title="text exclusion with CSS" width="500" height="226" class="alignleft size-full wp-image-2075"  style="box-shadow:none !important"/><br /> The opposite idea is to <strong>exclude text from a certain region</strong> or regions. (rectangular or custom shape)</p><h2 style="clear:both">Possible real world implementations</h2><p><img src="http://cssgallery.info/wp-content/uploads/2011/07/adaptive-design.jpg" alt="adaptive design" title="adaptive design" width="363" height="355" class="alignleft size-full wp-image-2083" /><br /> Adobe came up with <a href="http://labs.adobe.com/downloads/cssregions.html" title="Complex CSS examples from Adobe">more complex examples</a> (they work in their own version of WebKit based browser only since these features are still a draft and highly experimental).</p><p>Text can flow into custom shape areas and that <strong>will allow us create CSS accessible pie charts</strong> and <strong>complex layouts involving images and text</strong> that will behave well on devices with <strong>different screen sizes and resolutions</strong>.</p><div style="clear:both;">&nbsp;</div><div class="shr-publisher-2070"></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fcssgallery.info%2Fpossible-new-css-features-from-adobe%2F'></a><a class='shareaholic-fbsend' shr_href='http%3A%2F%2Fcssgallery.info%2Fpossible-new-css-features-from-adobe%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fcssgallery.info%2Fpossible-new-css-features-from-adobe%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><p>No related posts.</p>]]></content:encoded> <wfw:commentRss>http://cssgallery.info/possible-new-css-features-from-adobe/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Dan Tamas speaking about Titanium Appcelerator at TheEvent 2011, Cáceres, Spain</title><link>http://cssgallery.info/dan-tamas-speaking-about-titanium-appcelerator-at-theevent-2011-caceres-spain/</link> <comments>http://cssgallery.info/dan-tamas-speaking-about-titanium-appcelerator-at-theevent-2011-caceres-spain/#comments</comments> <pubDate>Mon, 30 May 2011 16:08:44 +0000</pubDate> <dc:creator>Lucica Ibanescu</dc:creator> <category><![CDATA[Titanium Appcelerator]]></category> <category><![CDATA[caceres]]></category> <category><![CDATA[Dan Tamas]]></category> <category><![CDATA[event]]></category> <category><![CDATA[introduction]]></category> <category><![CDATA[presentation]]></category> <category><![CDATA[slides]]></category> <category><![CDATA[spain]]></category> <category><![CDATA[spanish]]></category> <category><![CDATA[Theevnt2011]]></category> <category><![CDATA[titanium appcelerator]]></category><guid isPermaLink="false">http://cssgallery.info/?p=2060</guid> <description><![CDATA[Dan Tamas was invited to talk about Titanium Appcelerator at <a href="http://2011.theevnt.com/">TheEvnt 2011</a> in Cáceres, Spain, May 14th and the purpose of this talk was to <strong>present the advantages of using this framework to develop applications</strong> for iPhone, iPad and Android devices.It was an <strong>introductory talk</strong> in order to present to the Spanish developers an alternative to ObjectiveC and the very popular Java.<div style="width:625px" id="__ss_8222580"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/dan_tamas/introduccion-en-titanium-appcelerator-dan-tamas-theevnt2011" title="Introduccion en Titanium Appcelerator - Dan Tamas #theEvnt2011">Introduccion en Titanium Appcelerator - Dan Tamas #theEvnt2011</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/8222580" width="625" height="455" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe><div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/dan_tamas">dan_tamas</a></div></div>]]></description> <content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">var dzone_url="http://cssgallery.info/dan-tamas-speaking-about-titanium-appcelerator-at-theevent-2011-caceres-spain/";var dzone_title="Dan Tamas speaking about Titanium Appcelerator at TheEvent 2011, Cáceres, Spain";var dzone_style="1";var dzone_blurb="";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div class="tweetmeme_button" style="float: right; margin: 10px !important;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcssgallery.info%2Fdan-tamas-speaking-about-titanium-appcelerator-at-theevent-2011-caceres-spain%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcssgallery.info%2Fdan-tamas-speaking-about-titanium-appcelerator-at-theevent-2011-caceres-spain%2F&amp;source=dan_tamas&amp;style=normal&amp;b=2" height="61" width="50" /><br /> </a></div><p><a href="http://dan-tamas.me/">Dan Tamas</a> was invited to talk about Titanium Appcelerator at <a href="http://2011.theevnt.com/">TheEvnt 2011</a> in Cáceres, Spain, May 14th and the purpose of this talk was to <strong>present the advantages of using this framework to develop applications</strong> for iPhone, iPad and Android devices.</p><p>It was an <strong>introductory talk</strong> in order to present to the Spanish developers an alternative to ObjectiveC and the very popular Java.</p><div style="width:625px" id="__ss_8222580"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/dan_tamas/introduccion-en-titanium-appcelerator-dan-tamas-theevnt2011" title="Introduccion en Titanium Appcelerator - Dan Tamas #theEvnt2011">Introduccion en Titanium Appcelerator &#8211; Dan Tamas #theEvnt2011</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/8222580" width="625" height="455" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe><div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/dan_tamas">dan_tamas</a></div></p></div><p>For now I can only embed the slides (in Spanish) but I promise I will soon try to give you a link to the HTML version and also embed the video of the presentation.</p><div style="clear:both;">&nbsp;</div><div class="shr-publisher-2060"></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fcssgallery.info%2Fdan-tamas-speaking-about-titanium-appcelerator-at-theevent-2011-caceres-spain%2F'></a><a class='shareaholic-fbsend' shr_href='http%3A%2F%2Fcssgallery.info%2Fdan-tamas-speaking-about-titanium-appcelerator-at-theevent-2011-caceres-spain%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fcssgallery.info%2Fdan-tamas-speaking-about-titanium-appcelerator-at-theevent-2011-caceres-spain%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><h3>Related posts:</h3><ol><li><a href='http://cssgallery.info/making-a-combo-box-in-titanium-appcelerator-code-and-video/' rel='bookmark' title='Making a combo-box in Titanium Appcelerator &#8211; code and video'>Making a combo-box in Titanium Appcelerator &#8211; code and video</a></li><li><a href='http://cssgallery.info/custom-row-for-tableview-in-appcelerator-titanium/' rel='bookmark' title='Custom row for TableView in Appcelerator Titanium'>Custom row for TableView in Appcelerator Titanium</a></li><li><a href='http://cssgallery.info/seven-days-with-titanium-day-0-introduction/' rel='bookmark' title='Seven days with Titanium &#8211; day 0 &#8211; introduction'>Seven days with Titanium &#8211; day 0 &#8211; introduction</a></li></ol>]]></content:encoded> <wfw:commentRss>http://cssgallery.info/dan-tamas-speaking-about-titanium-appcelerator-at-theevent-2011-caceres-spain/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Advanced Titanium Tutorial &#8211; Bonjour Networking</title><link>http://cssgallery.info/advanced-titanium-tutorial-bonjour-networking/</link> <comments>http://cssgallery.info/advanced-titanium-tutorial-bonjour-networking/#comments</comments> <pubDate>Mon, 28 Feb 2011 10:33:51 +0000</pubDate> <dc:creator>Dan Tamas</dc:creator> <category><![CDATA[iPhone]]></category> <category><![CDATA[Titanium Appcelerator]]></category> <category><![CDATA[Bonjour]]></category> <category><![CDATA[Bonjour Networking]]></category> <category><![CDATA[connection.start()]]></category> <category><![CDATA[serviceBrowser]]></category> <category><![CDATA[titanium appcelerator]]></category> <category><![CDATA[Titanium Networking]]></category> <category><![CDATA[updatedServices event]]></category> <category><![CDATA[ZeroConf]]></category><guid isPermaLink="false">http://cssgallery.info/?p=2017</guid> <description><![CDATA[Titanium Appcelerator Mobile has implemented for iOs the Bonjour (or ZeroConf if you want) network protocol that <strong>allows you to connect to another device</strong> found in the same network.Before starting with the boring part - I mean the code - let's watch a video with a small demo showing 3 devices playing together :)<h2>Networking with Titanium Mobile on iOs</h2> <iframe title="YouTube video player" width="640" height="480" src="http://www.youtube.com/embed/CajPO9sBfU4?rel=0" frameborder="0" allowfullscreen></iframe>]]></description> <content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">/*<![CDATA[*/var dzone_url="http://cssgallery.info/advanced-titanium-tutorial-bonjour-networking/";var dzone_title="Advanced Titanium Tutorial &#8211; Bonjour Networking";var dzone_style="1";var dzone_blurb="";/*]]>*/</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div class="tweetmeme_button" style="float: right; margin: 10px !important;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcssgallery.info%2Fadvanced-titanium-tutorial-bonjour-networking%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcssgallery.info%2Fadvanced-titanium-tutorial-bonjour-networking%2F&amp;source=dan_tamas&amp;style=normal&amp;b=2" height="61" width="50" /><br /> </a></div><p>Titanium Appcelerator Mobile has implemented for iOs the Bonjour (or ZeroConf if you want) network protocol that <strong>allows you to connect to another device</strong> found in the same network.</p><p>Before starting with the boring part &#8211; I mean the code &#8211; let&#8217;s watch a video with a small demo showing 3 devices playing together <img src='http://cssgallery.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><h2>Networking with Titanium Mobile on iOs</h2><p><iframe title="YouTube video player" width="640" height="480" src="http://www.youtube.com/embed/CajPO9sBfU4?rel=0" frameborder="0" allowfullscreen></iframe></p><p>I would like to mention that the iPod is a second generation one &#8211;  so less capable (the delays are visible in the video) and somehow, sometimes, even seems to loose packets. I tested the same app with an iPad instead of the iPod and everything works just fine.<br /> <img src="http://cssgallery.info/wp-content/uploads/2011/02/bonjour-experiment1.png" alt="bubbles" title="bonjour experiment" width="158" height="372" class="alignright size-full wp-image-2041" style="margin:0px;border:none;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;"/></p><h2>Bonjour</h2><p>Based on the code found in <a href="https://github.com/appcelerator/titanium_mobile/blob/master/demos/KitchenSink/Resources/examples/bonjour.js">KitchenSink</a> I created a small function that creates the connection for us and returns an object to allow you to start it, close it and write to the socket.</p><p>Bonjour is a little weird to understand for those with less experience but shortly, things are like this:</p><ul><li><strong>We need a socket</strong> in read-write mode that will be used by a  localService  to publish its presence.</li><li>Each localService have to have <strong>its own unique name</strong> to be able to identify it in the network.</li></ul><p>Besides this, we need a <strong>serviceBrowser</strong> to find other devices around (that published their presence, of course).</p><p>Since everything is asynchronous we&#8217;ll have to rely on events to capture the data sent by somebody or the changes in the number of devices connected.</p><p>The serviceBrowser has the <strong>updatedServices event</strong> where we can capture the published services. Here in this function <strong>we&#8217;ll try to catch the read event</strong> for each service that is the one who tells us what data is sent over the network.</p><p><strong>Warning:</strong> Close the network connection the moment you don&#8217;t need it anymore.</p><h2>The Network Connection Function</h2><p>The function I created takes care of this so you will just have to use it as in the example below:</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Titanium.<span style="color: #660066;">include</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'bj.js'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> connection <span style="color: #339933;">=</span> bjnet<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'my_unique_name'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> json_data <span style="color: #339933;">=</span> JSON.<span style="color: #660066;">parse</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #006600; font-style: italic;">//do something with this data;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
connection.<span style="color: #660066;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>In other point of your app, where you want to send over a message, just do:</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">	connection.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'my_message'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>As I said before, don&#8217;t forget to clean everything:</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">win.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'close'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	connection.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><h2>What is going on in the demo?</h2><p>The example in the video is pretty simple. Depending on what blob you touch (red, green or blue)  you create a new connection with this name and start it. At this moment any message coming from the network is JSON parsed and a small blob is created with the specified coordinates and color.</p><p>On your turn, when you touch the screen you send over the network your coordinates and color so the other devices know what to draw. <strong>Every message is a JSON stringified object</strong> like the one below:</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">	<span style="color: #009900;">&#123;</span>coords<span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span>x<span style="color: #339933;">:</span><span style="color: #CC0000;">100</span><span style="color: #339933;">,</span>y<span style="color: #339933;">:</span><span style="color: #CC0000;">200</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>player<span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span><span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'red'</span><span style="color: #339933;">,</span> color<span style="color: #339933;">:</span><span style="color: #3366CC;">'#f00'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span></pre></div></div><p>As an aside <strong>the demo uses zero images</strong>. None. Everything is native and I plan a future tutorial on how to do this <img src='http://cssgallery.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><h2>The code</h2><p>The code is hosted on <a href="https://github.com/rborn/Advanced-Titanium-Tutorial---Bonjour-Networking">Github</a> and you can <a href="https://github.com/rborn/Advanced-Titanium-Tutorial---Bonjour-Networking">download it from here</a>. <strong>Everything is MIT licensed</strong> but I&#8217;d like to hear what you come up with.</p><p>Code strong!</p><p><strong>PS.</strong> I&#8217;m allowed to say this cause I&#8217;m a titan <img src='http://cssgallery.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p><p><strong class="spanish">Check the Spanish version of this post:<br /> <a href="http://nosoloweb.es/tutorial-avanzado-de-titanium-bonjour-networking/" rel="me">Tutorial Avanzado de Titanium – Bonjour Networking</a></strong></p><div style="clear:both;">&nbsp;</div><div class="shr-publisher-2017"></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fcssgallery.info%2Fadvanced-titanium-tutorial-bonjour-networking%2F'></a><a class='shareaholic-fbsend' shr_href='http%3A%2F%2Fcssgallery.info%2Fadvanced-titanium-tutorial-bonjour-networking%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fcssgallery.info%2Fadvanced-titanium-tutorial-bonjour-networking%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><h3>Related posts:</h3><ol><li><a href='http://cssgallery.info/seven-days-with-titanium-day-0-introduction/' rel='bookmark' title='Seven days with Titanium &#8211; day 0 &#8211; introduction'>Seven days with Titanium &#8211; day 0 &#8211; introduction</a></li><li><a href='http://cssgallery.info/seven-days-with-titanium-day-5-gps-and-maps/' rel='bookmark' title='Seven days with Titanium – day 5 – GPS and Maps'>Seven days with Titanium – day 5 – GPS and Maps</a></li><li><a href='http://cssgallery.info/making-a-combo-box-in-titanium-appcelerator-code-and-video/' rel='bookmark' title='Making a combo-box in Titanium Appcelerator &#8211; code and video'>Making a combo-box in Titanium Appcelerator &#8211; code and video</a></li></ol>]]></content:encoded> <wfw:commentRss>http://cssgallery.info/advanced-titanium-tutorial-bonjour-networking/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>Seven days with Titanium – day 6 – animations and transforms</title><link>http://cssgallery.info/seven-days-with-titanium-day-6%e2%80%93animations-and-transforms/</link> <comments>http://cssgallery.info/seven-days-with-titanium-day-6%e2%80%93animations-and-transforms/#comments</comments> <pubDate>Fri, 25 Feb 2011 18:05:11 +0000</pubDate> <dc:creator>Dan Tamas</dc:creator> <category><![CDATA[Android]]></category> <category><![CDATA[iPhone]]></category> <category><![CDATA[Titanium Appcelerator]]></category> <category><![CDATA[animation]]></category> <category><![CDATA[animation events]]></category> <category><![CDATA[autoreverse]]></category> <category><![CDATA[examples]]></category> <category><![CDATA[titanium appcelerator]]></category> <category><![CDATA[transforms]]></category><guid isPermaLink="false">http://cssgallery.info/?p=1977</guid> <description><![CDATA[Almost any UI element can be animated and transformed, allowing you to add to your application some eye candy or simply take advantage of predefined elements to give them a new role. For those familiar with <strong>CSS3 animations</strong> this will come very easy as the concept it's pretty the same.<h2>Animations</h2> Pointless to say, an animation will change one or more properties of an element form the current stage to another (set by us) in a period of time.]]></description> <content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">var dzone_url="http://cssgallery.info/seven-days-with-titanium-day-6%e2%80%93animations-and-transforms/";var dzone_title="Seven days with Titanium – day 6 – animations and transforms";var dzone_style="1";var dzone_blurb="";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div class="tweetmeme_button" style="float: right; margin: 10px !important;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcssgallery.info%2Fseven-days-with-titanium-day-6%25e2%2580%2593animations-and-transforms%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcssgallery.info%2Fseven-days-with-titanium-day-6%25e2%2580%2593animations-and-transforms%2F&amp;source=dan_tamas&amp;style=normal&amp;b=2" height="61" width="50" /><br /> </a></div><p>Almost any UI element can be animated and transformed, allowing you to add to your application some eye candy or simply take advantage of predefined elements to give them a new role. For those familiar with <strong>CSS3 animations</strong> this will come very easy as the concept it&#8217;s pretty the same.</p><h2>Animations</h2><p>Pointless to say, an animation will change one or more properties of an element form the current stage to another (set by us) in a period of time.</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> my_view <span style="color: #339933;">=</span>  Titanium.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createView</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">'#f00'</span><span style="color: #339933;">,</span>
    height<span style="color: #339933;">:</span><span style="color: #CC0000;">20</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
my_view.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>height<span style="color: #339933;">:</span><span style="color: #CC0000;">100</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>The simple code above will <strong>animate the height of my_view from 20 to 100</strong>.</p><p>You can complicate the things more <strong>adding more properties to animate</strong> (like the background color, opacity, etc), <strong>a duration</strong> (that needs to be in ms) and <strong>a curve </strong>(like ease-out or liniar, etc)</p><h3>Some examples</h3><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> view <span style="color: #339933;">=</span> Titanium.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createView</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	width<span style="color: #339933;">:</span><span style="color: #CC0000;">100</span><span style="color: #339933;">,</span>
	height<span style="color: #339933;">:</span><span style="color: #CC0000;">20</span><span style="color: #339933;">,</span>
	backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">'#f00'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
win.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>view<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
view.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	height<span style="color: #339933;">:</span><span style="color: #CC0000;">300</span><span style="color: #339933;">,</span> 
	backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">'#00f'</span><span style="color: #339933;">,</span> 
	duration<span style="color: #339933;">:</span><span style="color: #CC0000;">3000</span><span style="color: #339933;">,</span> 
	curve<span style="color: #339933;">:</span>Titanium.<span style="color: #660066;">UI</span>.<span style="color: #660066;">ANIMATION_CURVE_EASE_IN_OUT</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>If you need to make an animation to come back to the element&#8217;s original state and repeat it several times, there are 2 properties that might interest you :<strong>repeat</strong> and <strong>autoreverse</strong></p><p>The below code will make <strong>the view &#8220;pulse&#8221; 3 times</strong>.</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> view <span style="color: #339933;">=</span> Titanium.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createView</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	width<span style="color: #339933;">:</span><span style="color: #CC0000;">100</span><span style="color: #339933;">,</span>
	height<span style="color: #339933;">:</span><span style="color: #CC0000;">100</span><span style="color: #339933;">,</span>
	backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">'#f00'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
win.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>view<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
view.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	height<span style="color: #339933;">:</span><span style="color: #CC0000;">130</span><span style="color: #339933;">,</span>
	width<span style="color: #339933;">:</span><span style="color: #CC0000;">130</span><span style="color: #339933;">,</span>
	repeat<span style="color: #339933;">:</span><span style="color: #CC0000;">3</span><span style="color: #339933;">,</span>
	autoreverse<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	curve<span style="color: #339933;">:</span>Titanium.<span style="color: #660066;">UI</span>.<span style="color: #660066;">ANIMATION_CURVE_EASE_IN_OUT</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>The animations have 2 events: <strong>start</strong> and <strong>complete</strong>.The <strong>complete event</strong> is very useful because we can chain more animations one after another or start some other actions when the current one stops.</p><h2>Transforms</h2><p>Similar to CSS3 transforms, in Titanium you can use 2D or 3D transforms.</p><p>Basically you create a 2D or a 3D matrix for the transform  or use the predefined &#8220;shortcuts&#8221; &#8211;  (like <strong>scale</strong> or <strong>rotate</strong>) and pass this transform to the object you are creating or to the animation.</p><h3>An example with transforms</h3><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> tr_start <span style="color: #339933;">=</span> Titanium.<span style="color: #660066;">UI</span>.<span style="color: #660066;">create2DMatrix</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
tr_start <span style="color: #339933;">=</span> tr_start.<span style="color: #660066;">rotate</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">30</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> tr_end <span style="color: #339933;">=</span> Titanium.<span style="color: #660066;">UI</span>.<span style="color: #660066;">create2DMatrix</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
tr_end <span style="color: #339933;">=</span> tr_end.<span style="color: #660066;">rotate</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span><span style="color: #CC0000;">30</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
tr_end <span style="color: #339933;">=</span> tr_end.<span style="color: #660066;">scale</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> view <span style="color: #339933;">=</span> Titanium.<span style="color: #660066;">UI</span>.<span style="color: #660066;">createView</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	width<span style="color: #339933;">:</span><span style="color: #CC0000;">100</span><span style="color: #339933;">,</span>
	height<span style="color: #339933;">:</span><span style="color: #CC0000;">100</span><span style="color: #339933;">,</span>
	transform<span style="color: #339933;">:</span>tr_start<span style="color: #339933;">,</span>
	backgroundColor<span style="color: #339933;">:</span><span style="color: #3366CC;">'#f00'</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
win.<span style="color: #660066;">add</span><span style="color: #009900;">&#40;</span>view<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
view.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	transform<span style="color: #339933;">:</span>tr_end<span style="color: #339933;">,</span>
	repeat<span style="color: #339933;">:</span><span style="color: #CC0000;">3</span><span style="color: #339933;">,</span>
	autoreverse<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	duration<span style="color: #339933;">:</span><span style="color: #CC0000;">500</span><span style="color: #339933;">,</span>
	curve<span style="color: #339933;">:</span>Titanium.<span style="color: #660066;">UI</span>.<span style="color: #660066;">ANIMATION_CURVE_EASE_IN_OUT</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>The best <strong>resources</strong> to see how everything works are the examples provided by the Appcelerator team in the KitchenSink, the entry point being here:<a href="http://bit.ly/eiow0B">http://bit.ly/eiow0B</a></p><p>These animations and transforms are not suited to a very intensive usage (like games) but they can be used with success to improve the apps&#8217; look and feel &#8211; and with this, the user experience.</p><p>As always, I wait for your questions, suggestions and what are you come up with <img src='http://cssgallery.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br /> <strong class="spanish">Check the Spanish version of this post:<br /> <a href="http://nosoloweb.es/siete-dias-con-titanium-dia-6-animaciones-y-transformaciones/" rel="me">Siete días con Titanium – día 6 – animaciones y transformaciones</a></strong></p><div style="clear:both;">&nbsp;</div><div class="shr-publisher-1977"></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fcssgallery.info%2Fseven-days-with-titanium-day-6%25e2%2580%2593animations-and-transforms%2F'></a><a class='shareaholic-fbsend' shr_href='http%3A%2F%2Fcssgallery.info%2Fseven-days-with-titanium-day-6%25e2%2580%2593animations-and-transforms%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fcssgallery.info%2Fseven-days-with-titanium-day-6%25e2%2580%2593animations-and-transforms%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><p>No related posts.</p>]]></content:encoded> <wfw:commentRss>http://cssgallery.info/seven-days-with-titanium-day-6%e2%80%93animations-and-transforms/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Seven days with Titanium – day 5 – GPS and Maps</title><link>http://cssgallery.info/seven-days-with-titanium-day-5-gps-and-maps/</link> <comments>http://cssgallery.info/seven-days-with-titanium-day-5-gps-and-maps/#comments</comments> <pubDate>Sat, 19 Feb 2011 18:13:53 +0000</pubDate> <dc:creator>Dan Tamas</dc:creator> <category><![CDATA[Development tools]]></category> <category><![CDATA[iPhone]]></category> <category><![CDATA[Titanium Appcelerator]]></category> <category><![CDATA[add a route]]></category> <category><![CDATA[code]]></category> <category><![CDATA[example]]></category> <category><![CDATA[forwardGeocoder]]></category> <category><![CDATA[Geolocation]]></category> <category><![CDATA[getCurrentHeading]]></category> <category><![CDATA[getCurrentPosition]]></category> <category><![CDATA[GPS]]></category> <category><![CDATA[Maproute]]></category> <category><![CDATA[mapview.addAnnotation]]></category> <category><![CDATA[reverseGeocoder]]></category> <category><![CDATA[titanium appcelerator]]></category> <category><![CDATA[Titanium.Geolocation]]></category> <category><![CDATA[Titanium.Map]]></category><guid isPermaLink="false">http://cssgallery.info/?p=1660</guid> <description><![CDATA[This doesn't need any kind of introduction. You can use the location on the devices to find the user's place and act accordingly. One thing good to know is that this needs the approval of the user, and for iOs &#62; 3.2 you need to set a <strong>purpose</strong> property to let Apple know what you need it for.<pre lang="javascript">Titanium.Geolocation.purpose = "GPS user coordinates";</pre><h2>How geolocation works?</h2>]]></description> <content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">var dzone_url="http://cssgallery.info/seven-days-with-titanium-day-5-gps-and-maps/";var dzone_title="Seven days with Titanium – day 5 – GPS and Maps";var dzone_style="1";var dzone_blurb="";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div class="tweetmeme_button" style="float: right; margin: 10px !important;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcssgallery.info%2Fseven-days-with-titanium-day-5-gps-and-maps%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcssgallery.info%2Fseven-days-with-titanium-day-5-gps-and-maps%2F&amp;source=dan_tamas&amp;style=normal&amp;b=2" height="61" width="50" /><br /> </a></div><p>This doesn&#8217;t need any kind of introduction. You can use the location on the devices to find the user&#8217;s place and act accordingly. One thing good to know is that this needs the approval of the user, and for iOs &gt; 3.2 you need to set a <strong>purpose</strong> property to let Apple know what you need it for.</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Titanium.<span style="color: #660066;">Geolocation</span>.<span style="color: #660066;">purpose</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;GPS user coordinates&quot;</span><span style="color: #339933;">;</span></pre></div></div><h2>How geolocation works</h2><p>When you start the app <strong>the coordinates are the ones cached on the device</strong>, in other words the ones detected at the last time you used the geolocation on your device. Detecting the current position takes time so if you have an app based on geolocation you might want to take this in account to improve the user experience and avoid to get false results.</p><p><a href="http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Geolocation-module">Titanium.Geolocation</a> provides the needed methods to manage geolocation.</p><p>In general the most used method is <strong>getCurrentPosition</strong> that gives you the current position and fires once and the <strong>location</strong> event that triggers repeatedly on the location change. To be more clear think you want to log a route the user follow: when the app starts you get its start position then while walking you can get the points of the route with a adjustable granularity.</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&nbsp;
Titanium.<span style="color: #660066;">Geolocation</span>.<span style="color: #660066;">distanceFilter</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// set the granularity of the location event</span>
&nbsp;
	Titanium.<span style="color: #660066;">Geolocation</span>.<span style="color: #660066;">getCurrentPosition</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">error</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
                <span style="color: #006600; font-style: italic;">// manage the error</span>
                <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> longitude <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">longitude</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> latitude <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">latitude</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> altitude <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">altitude</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> heading <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">heading</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> accuracy <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">accuracy</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> speed <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">speed</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> timestamp <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">timestamp</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> altitudeAccuracy <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">altitudeAccuracy</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #006600; font-style: italic;">// we use the above data the way we need it</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	Titanium.<span style="color: #660066;">Geolocation</span>.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'location'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">error</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
                <span style="color: #006600; font-style: italic;">// manage the error</span>
		<span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> longitude <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">longitude</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> latitude <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">latitude</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> altitude <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">altitude</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> heading <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">heading</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> accuracy <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">accuracy</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> speed <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">speed</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> timestamp <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">timestamp</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> altitudeAccuracy <span style="color: #339933;">=</span> e.<span style="color: #660066;">coords</span>.<span style="color: #660066;">altitudeAccuracy</span><span style="color: #339933;">;</span>
&nbsp;
               <span style="color: #006600; font-style: italic;">// again we use the gathered data</span>
      <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>There are some other methods that can be used like <strong>reverseGeocoder</strong>, <strong>forwardGeocoder</strong>, and <strong>getCurrentHeading</strong> &#8211;  for compass. Because not all the devices have the GPS location (like iPod) or the compass and because the user can have the location services disabled you have to check if it exists, if it&#8217;s enabled and then let the user know about this.</p><p>As the documentation page is not complete yet, I suggest you to <strong>take a look</strong> at the <a href="http://github.com/appcelerator/titanium_mobile/blob/master/demos/KitchenSink/Resources/examples/geolocation.js">geolocation example</a> that shows very well how to use this.</p><h2>Maps</h2><p>The maps are created using the <a href="http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Map-module">Titanium.Map</a> methods. The maps are a little bit complicated but allows you to do some real nice interfaces. You can use a <strong>Mapview</strong> and add a route to it, or pins(markers) and to the pins to attach popups with images, titles, even &#8220;links&#8221; o another windows for a more detailed view of the specified place or whatever you may need.</p><h3>Create a map</h3><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> mapview <span style="color: #339933;">=</span> Titanium.<span style="color: #660066;">Map</span>.<span style="color: #660066;">createView</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	top<span style="color: #339933;">:</span><span style="color: #CC0000;">20</span><span style="color: #339933;">,</span>
	height<span style="color: #339933;">:</span><span style="color: #CC0000;">300</span><span style="color: #339933;">,</span>
	mapType<span style="color: #339933;">:</span> Titanium.<span style="color: #660066;">Map</span>.<span style="color: #660066;">STANDARD_TYPE</span><span style="color: #339933;">,</span>
	region<span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span>latitude<span style="color: #339933;">:</span><span style="color: #CC0000;">33.74511</span><span style="color: #339933;">,</span> longitude<span style="color: #339933;">:-</span><span style="color: #CC0000;">84.38993</span><span style="color: #339933;">,</span> latitudeDelta<span style="color: #339933;">:</span><span style="color: #CC0000;">0.5</span><span style="color: #339933;">,</span> longitudeDelta<span style="color: #339933;">:</span><span style="color: #CC0000;">0.5</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	animate<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	regionFit<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	userLocation<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>Nothing complicated: the constructor can receive different arguments including the <strong>annotations</strong> (pins), but of course you will have to declare it first.</p><p>And this is done like this:</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> apple <span style="color: #339933;">=</span> Titanium.<span style="color: #660066;">Map</span>.<span style="color: #660066;">createAnnotation</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	latitude<span style="color: #339933;">:</span><span style="color: #CC0000;">37.33168900</span><span style="color: #339933;">,</span>
	longitude<span style="color: #339933;">:-</span><span style="color: #CC0000;">122.03073100</span><span style="color: #339933;">,</span>
	title<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Steve Jobs&quot;</span><span style="color: #339933;">,</span>
	subtitle<span style="color: #339933;">:</span><span style="color: #3366CC;">'Cupertino, CA'</span><span style="color: #339933;">,</span>
	pincolor<span style="color: #339933;">:</span>Titanium.<span style="color: #660066;">Map</span>.<span style="color: #660066;">ANNOTATION_GREEN</span><span style="color: #339933;">,</span>
	animate<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	rightButton<span style="color: #339933;">:</span> <span style="color: #3366CC;">'apple_logo.jpg'</span><span style="color: #339933;">,</span>
	myid<span style="color: #339933;">:</span><span style="color: #CC0000;">2</span> <span style="color: #006600; font-style: italic;">// CUSTOM ATTRIBUTE THAT IS PASSED INTO EVENT OBJECTS</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> atlanta <span style="color: #339933;">=</span> Titanium.<span style="color: #660066;">Map</span>.<span style="color: #660066;">createAnnotation</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
		latitude<span style="color: #339933;">:</span><span style="color: #CC0000;">33.74511</span><span style="color: #339933;">,</span>
		longitude<span style="color: #339933;">:-</span><span style="color: #CC0000;">84.38993</span><span style="color: #339933;">,</span>
		title<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;Atlanta, GA&quot;</span><span style="color: #339933;">,</span>
		subtitle<span style="color: #339933;">:</span><span style="color: #3366CC;">'Atlanta Braves Stadium<span style="color: #000099; font-weight: bold;">\n</span>foo'</span><span style="color: #339933;">,</span>
		animate<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
		leftButton<span style="color: #339933;">:</span><span style="color: #3366CC;">'atlanta.jpg'</span><span style="color: #339933;">,</span>
		rightButton<span style="color: #339933;">:</span> Titanium.<span style="color: #660066;">UI</span>.<span style="color: #660066;">iPhone</span>.<span style="color: #660066;">SystemButton</span>.<span style="color: #660066;">DISCLOSURE</span><span style="color: #339933;">,</span>
		myid<span style="color: #339933;">:</span><span style="color: #CC0000;">3</span> <span style="color: #006600; font-style: italic;">// CUSTOM ATTRIBUTE THAT IS PASSED INTO EVENT OBJECTS</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>and the map constructor gets</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">	annotations<span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span>atlanta<span style="color: #339933;">,</span>apple<span style="color: #009900;">&#93;</span></pre></div></div><p>or later you can add this annotation using</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">	mapview.<span style="color: #660066;">addAnnotation</span><span style="color: #009900;">&#40;</span>atlanta<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><h3>Map events</h3><p>One thing you need to know is that <strong>the events are registered at the map level</strong>. So you cannot get a click event on a pin. You will have to get the click event of the mapview ad use the <strong>clicksource</strong> and <strong>the custom property (myId) </strong> properties to detect the annotation and what has been clicked (pin, leftbutton, rightbutton, title, subtitle)</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>evt.<span style="color: #660066;">source</span>.<span style="color: #660066;">myid</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">3</span> <span style="color: #339933;">&amp;&amp;</span> evt.<span style="color: #660066;">clicksource</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'rightButton'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">// do your stuff</span>
        <span style="color: #009900;">&#125;</span></pre></div></div><h3>MapRoute</h3><p>Another thing you can do with a map is to <strong>add a route</strong> (iOs only for now). Basically you can draw a line on the map specifying the points (gpd point) it needs to pass through.</p><p>A route can look like this:</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> route <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;some name&quot;</span><span style="color: #339933;">,</span>
	points<span style="color: #339933;">:</span>points<span style="color: #339933;">,</span>
	color<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;red&quot;</span><span style="color: #339933;">,</span>
	width<span style="color: #339933;">:</span><span style="color: #CC0000;">2</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div><p>Where <strong>points</strong> it&#8217;s an array of objects containing latitude and longitude coordinates.</p><p><img src="http://cssgallery.info/wp-content/uploads/2011/02/gmap-capture-on-iphone.jpg" alt="screen capture showing a google map on an iphone screen" title="Maproute with Titanium" width="320" height="460" class="alignright size-full wp-image-1947" /></p><h3>Example &#8211; add a route to a Mapview</h3><p>Below is an example that adds a route to a mapview using some readymade coordinates. It will generate something similar to the screenshot in the right.</p><div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> center <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>latitude<span style="color: #339933;">:</span><span style="color: #CC0000;">42.30</span><span style="color: #339933;">,</span>longitude<span style="color: #339933;">:-</span><span style="color: #CC0000;">71.18</span><span style="color: #339933;">,</span>latitudeDelta<span style="color: #339933;">:</span><span style="color: #CC0000;">0.03</span><span style="color: #339933;">,</span> longitudeDelta<span style="color: #339933;">:</span><span style="color: #CC0000;">0.1</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> mapview <span style="color: #339933;">=</span> Titanium.<span style="color: #660066;">Map</span>.<span style="color: #660066;">createView</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	mapType<span style="color: #339933;">:</span> Titanium.<span style="color: #660066;">Map</span>.<span style="color: #660066;">STANDARD_TYPE</span><span style="color: #339933;">,</span>
	region<span style="color: #339933;">:</span> center<span style="color: #339933;">,</span>
	animate<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	regionFit<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
points <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>
	<span style="color: #009900;">&#123;</span>latitude<span style="color: #339933;">:</span><span style="color: #CC0000;">42.31</span><span style="color: #339933;">,</span>longitude<span style="color: #339933;">:-</span><span style="color: #CC0000;">71.11</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	<span style="color: #009900;">&#123;</span>latitude<span style="color: #339933;">:</span><span style="color: #CC0000;">42.32</span><span style="color: #339933;">,</span>longitude<span style="color: #339933;">:-</span><span style="color: #CC0000;">71.13</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	<span style="color: #009900;">&#123;</span>latitude<span style="color: #339933;">:</span><span style="color: #CC0000;">42.31</span><span style="color: #339933;">,</span>longitude<span style="color: #339933;">:-</span><span style="color: #CC0000;">71.22</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
	<span style="color: #009900;">&#123;</span>latitude<span style="color: #339933;">:</span><span style="color: #CC0000;">42.28</span><span style="color: #339933;">,</span>longitude<span style="color: #339933;">:-</span><span style="color: #CC0000;">71.26</span><span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#93;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// route object</span>
<span style="color: #003366; font-weight: bold;">var</span> route <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;some name&quot;</span><span style="color: #339933;">,</span>
	points<span style="color: #339933;">:</span>points<span style="color: #339933;">,</span>
	color<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;#00f&quot;</span><span style="color: #339933;">,</span>
	width<span style="color: #339933;">:</span><span style="color: #CC0000;">2</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// add a route</span>
mapview.<span style="color: #660066;">addRoute</span><span style="color: #009900;">&#40;</span>route<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><h2>What next?</h2><p>A good exercise would be maybe to create an application that it&#8217;s watching your position while you are driving or walking and display it on a map. All you would have to do is to use the <strong>location</strong> event and use the returned value to append a new item to the <strong>points</strong> array.</p><p>Anybody wanna try ? <img src='http://cssgallery.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p><strong class="spanish">Check the Spanish version of this post:<br /> <a href="http://nosoloweb.es/siete-dias-con-titanium-dia-5-gps-y-mapas/" rel="me">Siete días con Titanium – día 5 – GPS y Mapas</a></strong></p><div style="clear:both;">&nbsp;</div><div class="shr-publisher-1660"></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fcssgallery.info%2Fseven-days-with-titanium-day-5-gps-and-maps%2F'></a><a class='shareaholic-fbsend' shr_href='http%3A%2F%2Fcssgallery.info%2Fseven-days-with-titanium-day-5-gps-and-maps%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fcssgallery.info%2Fseven-days-with-titanium-day-5-gps-and-maps%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><h3>Related posts:</h3><ol><li><a href='http://cssgallery.info/seven-days-with-titanium-day-7-orientation-and-accelerometer/' rel='bookmark' title='Seven days with Titanium &#8211; day 7 &#8211; orientation and accelerometer'>Seven days with Titanium &#8211; day 7 &#8211; orientation and accelerometer</a></li><li><a href='http://cssgallery.info/seven-days-with-titanium-day-4-media-images-movies-and-sounds/' rel='bookmark' title='Seven days with Titanium – day 4 – Media – images, movies and sounds'>Seven days with Titanium – day 4 – Media – images, movies and sounds</a></li><li><a href='http://cssgallery.info/seven-days-with-titanium-day-6%e2%80%93animations-and-transforms/' rel='bookmark' title='Seven days with Titanium – day 6 – animations and transforms'>Seven days with Titanium – day 6 – animations and transforms</a></li></ol>]]></content:encoded> <wfw:commentRss>http://cssgallery.info/seven-days-with-titanium-day-5-gps-and-maps/feed/</wfw:commentRss> <slash:comments>9</slash:comments> </item> <item><title>How screen readers speak a page with HTML5 and ARIA</title><link>http://cssgallery.info/how-screen-readers-speak-a-page-with-html5-and-aria/</link> <comments>http://cssgallery.info/how-screen-readers-speak-a-page-with-html5-and-aria/#comments</comments> <pubDate>Mon, 24 Jan 2011 05:57:46 +0000</pubDate> <dc:creator>Lucica Ibanescu</dc:creator> <category><![CDATA[Accessibility]]></category> <category><![CDATA[HTML5]]></category> <category><![CDATA[ARIA]]></category> <category><![CDATA[ARIA roles]]></category> <category><![CDATA[html5]]></category> <category><![CDATA[landmarks]]></category> <category><![CDATA[NVDA]]></category> <category><![CDATA[screen readers]]></category> <category><![CDATA[WAI ARIA]]></category><guid isPermaLink="false">http://cssgallery.info/?p=1741</guid> <description><![CDATA[After seeing <a href="http://cssgallery.info/testing-the-accessibility-of-the-css-generated-content/"><strong>how AT reads a content generated with CSS pseudo-elements</strong></a> I was thinking to move on to HTML5. And since there are a lot of people saying <strong>we should mix HTML5 with ARIA in order to increase the accessibility of a website</strong>, then why not test and see what happens?]]></description> <content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">var dzone_url="http://cssgallery.info/how-screen-readers-speak-a-page-with-html5-and-aria/";var dzone_title="How screen readers speak a page with HTML5 and ARIA";var dzone_style="1";var dzone_blurb="";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div class="tweetmeme_button" style="float: right; margin: 10px !important;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcssgallery.info%2Fhow-screen-readers-speak-a-page-with-html5-and-aria%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcssgallery.info%2Fhow-screen-readers-speak-a-page-with-html5-and-aria%2F&amp;source=dan_tamas&amp;style=normal&amp;b=2" height="61" width="50" /><br /> </a></div><p>After seeing <a href="http://cssgallery.info/testing-the-accessibility-of-the-css-generated-content/"><strong>how AT reads a content generated with CSS pseudo-elements</strong></a> I was thinking to move on to HTML5. And since there are a lot of people saying <strong>we should mix HTML5 with ARIA in order to increase the accessibility of a website</strong>, then why not test and see what happens?</p><h2>A piece of code&#8230;</h2><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">...
&nbsp;
&lt;header id=&quot;header&quot; role=&quot;banner&quot;&gt;  
    &lt;div id=&quot;logo&quot;&gt;Logo here&lt;/div&gt;
    &lt;nav role=&quot;navigation&quot;&gt;
        &lt;ul id=&quot;mainnav&quot;&gt;........&lt;/ul&gt;
    &lt;/nav&gt;
&lt;/header&gt;
&nbsp;
&lt;section id=&quot;content&quot; role=&quot;main&quot;&gt;  
&nbsp;
    &lt;h1&gt;A level one heading here please&lt;/h1&gt;
&nbsp;
    &lt;div role=&quot;application&quot;&gt;&lt;p&gt;Here is where an application will be coded. &lt;/p&gt;&lt;/div&gt; 
&nbsp;
    &lt;article role=&quot;article&quot;&gt;             
            &lt;h2 class=&quot;index-headings&quot;&gt;Blog entry no 1&lt;/h2&gt;
            &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit...&lt;/p&gt;
    &lt;/article&gt;
&nbsp;
    &lt;article role=&quot;article&quot;&gt;
            &lt;h2 class=&quot;index-headings&quot;&gt;Blog entry no 2&lt;/h2&gt;
            &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit...&lt;/p&gt;
    &lt;/article&gt;
&nbsp;
&lt;/section&gt; 
&nbsp;
&lt;aside role=&quot;complementary&quot;&gt;  
    &lt;h2&gt;Sidebar&lt;/h2&gt;
    &lt;ul&gt;......................&lt;/ul&gt;
&lt;/aside&gt;
&nbsp;
&lt;footer id=&quot;footer&quot;  role=&quot;contentinfo&quot;&gt;This is where the footer will stay.&lt;/footer&gt;     
...</pre></div></div><p>This is the page containing both <strong>HTML5 elements</strong>:</p><ul><li>header</li><li>nav</li><li>section</li><li>article</li><li>aside</li><li>footer</li></ul><p> and <strong>ARIA roles</strong> (<a href="http://cssgallery.info/useful-10-minutes-of-wai-aria/">learn about ARIA</a>):</p><ul><li><strong>role=&#8221;banner&#8221;</strong> &#8211; for the header element</li><li><strong>role=&#8221;navigation&#8221;</strong> &#8211; for the nav element</li><li> <strong>role=&#8221;main&#8221;</strong> &#8211; attached to the section</li><li><strong>role=&#8221;application&#8221;</strong> &#8211; in case I need to add a widget</li><li> <strong>role=&#8221;article&#8221;</strong> &#8211; for the article element</li><li><strong>role=&#8221;complementary&#8221;</strong> &#8211; for the aside</li><li><strong>role=&#8221;contentinfo&#8221;</strong> &#8211; for the footer</li></ul><h2>How NVDA, JAWS and Window Eyes read the HTML5-only version</h2><p>Long story short, <strong>no screen reader noticed the HTML5 elements</strong> &#8211; as expected. They all behaved like those elements were simple DIVs and read the webpage accordingly.</p><p><iframe title="YouTube video player" class="youtube-player" type="text/html" width="485" height="349" src="http://www.youtube.com/embed/oW0KFCNeFA4" frameborder="0" allowFullScreen></iframe></p><h2>How NVDA, JAWS and Window Eyes read the HTML5 + ARIA version</h2><p>Much better this time, <strong>ARIA is doing wonders</strong> although I don&#8217;t understand why Window Eyes doesn&#8217;t even pronounce the existence of the headers&#8230;I am a newbie in this field so maybe I did something wrong? I do not want to do WE any injustice so let&#8217;s say the results are inconclusive regarding this software.</p><p><iframe title="YouTube video player" class="youtube-player" type="text/html" width="485" height="349" src="http://www.youtube.com/embed/LP3zLrOjQSY" frameborder="0" allowFullScreen></iframe></p><h2>The difference</h2><p>So what was the difference between the two versions? What ARIA brought from this point of view?</p><h3>The banner area: role=&#8221;banner&#8221;</h3><p><strong>NVDA</strong> &#8211; &#8220;<em>banner landmark</em> logo here <em>navigation landmark</em> list with 4 items visited link home&#8230;&#8230;. &#8221;<br /> <strong>JAWS</strong> &#8211;  &#8220;<em>banner landmark</em> logo here <em>navigation landmark</em> list with 4 items visited link home&#8230;&#8230;. &#8221; At the beginning it also says that there are 8 landmarks, hurray!!!</p><h3>The main area: role=&#8221;main&#8221;</h3><p><strong>NVDA</strong> &#8211; &#8220;<em>main landmark</em> heading level one &#8230;&#8221;<br /> <strong>JAWS</strong> &#8211; &#8220;<em>main landmark</em> heading level one &#8230;&#8221;</p><h3>The application area: role=&#8221;application&#8221;</h3><p><strong>NVDA</strong> &#8211; the application role was not read at all.<br /> <strong>JAWS</strong> &#8211; &#8220;<em>application landmark</em> here is where&#8230;.&#8221;</p><h3>The articles: role=&#8221;article&#8221;</h3><p><strong>NVDA</strong> &#8211; the article was not mentioned in any way.<br /> <strong>JAWS</strong> &#8211; &#8220;<em>article landmark</em> heading level&#8230;.&#8221;</p><h3>The sidebar: role=&#8221;complementary&#8221;</h3><p><strong>NVDA</strong> the sidebar was read like this: &#8220;<em>complementary landmark</em> heading level 2&#8230;..&#8221;<br /> <strong>JAWS</strong> &#8211; &#8220;<em>complementary landmark</em> heading level 2&#8230;..&#8221;</p><h3>The footer: role=&#8221;contentinfo&#8221;</h3><p>- and the footer: &#8220;<em>content info landmark</em> this is where the&#8230;.&#8221;<br /> <strong>JAWS</strong> &#8211; &#8220;<em>content info landmark</em> this is where the&#8230;.&#8221;</p><p>So far <strong>JAWS was the only one able to speak all the landmarks</strong> while <strong>NVDA missed the article and the application</strong>. Like I mentioned before, Window Eyes din not read ARIA elements but maybe it&#8217;s just me being a newbie&#8230;<strong>Your opinion is much appreciated</strong>, maybe together we can make it work <img src='http://cssgallery.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p><strong class="spanish">Check the Spanish version of this post:<br /> <a href="http://nosoloweb.es/como-leen-los-lectores-de-pantalla-una-pagina-con-html5-y-aria/ rel="me">Cómo leen los lectores de pantalla una página con HTML5 y ARIA</a></strong></p><div style="clear:both;">&nbsp;</div><div class="shr-publisher-1741"></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fcssgallery.info%2Fhow-screen-readers-speak-a-page-with-html5-and-aria%2F'></a><a class='shareaholic-fbsend' shr_href='http%3A%2F%2Fcssgallery.info%2Fhow-screen-readers-speak-a-page-with-html5-and-aria%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fcssgallery.info%2Fhow-screen-readers-speak-a-page-with-html5-and-aria%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><h3>Related posts:</h3><ol><li><a href='http://cssgallery.info/useful-10-minutes-of-wai-aria/' rel='bookmark' title='Useful 10 minutes of WAI ARIA'>Useful 10 minutes of WAI ARIA</a></li><li><a href='http://cssgallery.info/testing-the-accessibility-of-the-css-generated-content/' rel='bookmark' title='Testing the accessibility of the CSS generated content'>Testing the accessibility of the CSS generated content</a></li></ol>]]></content:encoded> <wfw:commentRss>http://cssgallery.info/how-screen-readers-speak-a-page-with-html5-and-aria/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Testing the accessibility of the CSS generated content</title><link>http://cssgallery.info/testing-the-accessibility-of-the-css-generated-content/</link> <comments>http://cssgallery.info/testing-the-accessibility-of-the-css-generated-content/#comments</comments> <pubDate>Wed, 19 Jan 2011 20:38:23 +0000</pubDate> <dc:creator>Lucica Ibanescu</dc:creator> <category><![CDATA[Accessibility]]></category> <category><![CDATA[:after]]></category> <category><![CDATA[:before]]></category> <category><![CDATA[assistive technology]]></category> <category><![CDATA[CSS generated content]]></category> <category><![CDATA[pseudo-elements]]></category> <category><![CDATA[screen readers]]></category><guid isPermaLink="false">http://cssgallery.info/?p=1725</guid> <description><![CDATA[This article is about how screen readers speak the content added with <strong>CSS pseudo-elements :before</strong> and <strong>:after</strong> (in CSS3 they are ::before and ::after).I am trying to learn to use AT when developing websites and recently I saw that no matter how W3C wants us to use a certain CSS element, there will always be developers/designers who will try to push the limits of the specification.While I do advise you to <strong>NOT use pseudo-elements to generate useful content</strong> (limit yourself to generating quotes or design elements), just in case somebody thinks that the cool resides in generating content with CSS because everything else is already old, let's see how people using screen readers will "benefit" from the idea.]]></description> <content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">var dzone_url="http://cssgallery.info/testing-the-accessibility-of-the-css-generated-content/";var dzone_title="Testing the accessibility of the CSS generated content";var dzone_style="1";var dzone_blurb="";</script><script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div class="tweetmeme_button" style="float: right; margin: 10px !important;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fcssgallery.info%2Ftesting-the-accessibility-of-the-css-generated-content%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fcssgallery.info%2Ftesting-the-accessibility-of-the-css-generated-content%2F&amp;source=dan_tamas&amp;style=normal&amp;b=2" height="61" width="50" /><br /> </a></div><p>This article is about how screen readers speak the content added with <strong>CSS pseudo-elements :before</strong> and <strong>:after</strong> (in CSS3 they are ::before and ::after).</p><p>I am trying to learn to use AT when developing websites and recently I saw that no matter how W3C wants us to use a certain CSS element, there will always be developers/designers who will try to push the limits of the specification.</p><p>While I do advise you to <strong>NOT use pseudo-elements to generate useful content</strong> (limit yourself to generating quotes or design elements), just in case somebody thinks that the cool resides in generating content with CSS because everything else is already old, let&#8217;s see how people using screen readers will &#8220;benefit&#8221; from the idea.</p><h2>A piece of code&#8230;OK, maybe two&#8230;</h2><p>The HTML is really simple, an innocent paragraph of text:</p><div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;h1&gt;Example of content added with CSS pseudo-elements&lt;/h1&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit..and so on.&lt;/p&gt;</pre></div></div><p>and the CSS is also quite simple:</p><div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#content</span> p<span style="color: #3333ff;">:before </span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">:</span><span style="color: #ff0000;">&quot;This is before the text, you can style it&quot;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#content</span> p<span style="color: #3333ff;">:after</span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">:</span><span style="color: #ff0000;">&quot;This is after the text&quot;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div><h2>Let&#8217;s hear voices</h2><p>The video will show how NVDA, Jaws and Window Eyes read the page &#8211; I set NVDA to read at a lower rate in order for you to follow, but the other 2 are a bit faster.</p><p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/BmMrOfsXXEU?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/BmMrOfsXXEU?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p><h2>The conclusion</h2><p>There&#8217;s no need for me to tell you how bad the idea is, <strong>DON&#8217;T use these pseudo-elements for generating useful content</strong>, limit its use to generating quotes, breadcrumb icons, fluffy snowflakes or whatever. But keep it presentational in order for other people to have access to the useful stuff.</p><p><strong class="spanish">Check the Spanish version of this post:<br /> <a href="http://nosoloweb.es/probando-la-accesibilidad-del-contenido-generado-por-css/ rel="me">Probando la accesibilidad del contenido generado por CSS</a></strong></p><div style="clear:both;">&nbsp;</div><div class="shr-publisher-1725"></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' shr_layout='button_count' shr_showfaces='false' shr_href='http%3A%2F%2Fcssgallery.info%2Ftesting-the-accessibility-of-the-css-generated-content%2F'></a><a class='shareaholic-fbsend' shr_href='http%3A%2F%2Fcssgallery.info%2Ftesting-the-accessibility-of-the-css-generated-content%2F'></a><a class='shareaholic-googleplusone' shr_size='medium' shr_count='true' shr_href='http%3A%2F%2Fcssgallery.info%2Ftesting-the-accessibility-of-the-css-generated-content%2F'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><h3>Related posts:</h3><ol><li><a href='http://cssgallery.info/how-screen-readers-speak-a-page-with-html5-and-aria/' rel='bookmark' title='How screen readers speak a page with HTML5 and ARIA'>How screen readers speak a page with HTML5 and ARIA</a></li><li><a href='http://cssgallery.info/useful-10-minutes-of-wai-aria/' rel='bookmark' title='Useful 10 minutes of WAI ARIA'>Useful 10 minutes of WAI ARIA</a></li></ol>]]></content:encoded> <wfw:commentRss>http://cssgallery.info/testing-the-accessibility-of-the-css-generated-content/feed/</wfw:commentRss> <slash:comments>9</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: basic (User agent is rejected)
Database Caching 5/52 queries in 0.190 seconds using disk: basic

Served from: www.cssgallery.info @ 2012-02-04 17:08:37 -->
