Author: ben
Date: 2007-07-08 15:40:10 -0700 (Sun, 08 Jul 2007)
New Revision: 5625

Modified:
   sandbox/ben/smush/classes.lzx
   sandbox/ben/smush/main.lzx
Log:
deferred loading of images

Modified: sandbox/ben/smush/classes.lzx
===================================================================
--- sandbox/ben/smush/classes.lzx       2007-07-08 20:35:10 UTC (rev 5624)
+++ sandbox/ben/smush/classes.lzx       2007-07-08 22:40:10 UTC (rev 5625)
@@ -5,13 +5,14 @@
         <text name="urlText" datapath="content/@url" visible="false"/>      
         <text name="guid" datapath="guid/text()" visible="false"/>             
 
         <view name="thumbnail" bgcolor="0xAABB00" stretches="both" 
width="${parent.width}" height="${parent.height}" />
-        <method event="oninit">
-            this.thumbnail.setSource(this.urlText.text);
-        </method>
         <method event="onclick">
             this.setSelected(true);
         </method>
 
+        <method name="loadThumbnail">
+            this.thumbnail.setSource(this.urlText.text);            
+        </method>
+        
         <method name="setSelected" args="s" >
             // copy image to floatimage
             // animate floatimage to destination view
@@ -61,6 +62,9 @@
         <animatorgroup name="intro" start="false" process="simultaneous" >
             <animator attribute="hspacing" duration="1000" from="250" to="2"  
/>
             <animator attribute="xoffset"  duration="1000" from="350" to="2"  
/>
+            <method event="onstop">
+                canvas.loadThumbnails();
+            </method>            
         </animatorgroup>
 
         <handler name="oninit" >

Modified: sandbox/ben/smush/main.lzx
===================================================================
--- sandbox/ben/smush/main.lzx  2007-07-08 20:35:10 UTC (rev 5624)
+++ sandbox/ben/smush/main.lzx  2007-07-08 22:40:10 UTC (rev 5625)
@@ -7,18 +7,26 @@
     <include href="classes.lzx" />
     <include href="resources.lzx" />
      
+     <method name="loadThumbnails">
+         Debug.write("loadThumbnails");   
+         for (i in gThumbnails.subviews) {
+            gThumbnails.subviews[i].loadThumbnail();
+         }      
+     </method>
+     
      <!-- views -->
-    <view width="${parent.width}" height="${parent.height}" bgcolor="white"  >
+    <view width="${parent.width}" height="${parent.height}" bgcolor="white">
     
         <!-- layout -->
         <simplelayout axis="y"  />
 
         <!-- title bar -->
-        <view id="tbar" width="${parent.width}" opacity="0" >
+        <view id="tbar" width="${parent.width}" opacity="1" >
             <view resource="headerbkgnd" stretches="width" 
width="${parent.width}" />
             <view resource="logo" x="7" y="7" />
             <text text="match a story with a picture to read the article" 
multiline="true" y="5" width="90" x="220" fontsize="9" fgcolor="0x2d4263" /> 
-            <animator name="headerfade_anm" attribute="opacity" to="1" 
duration="500" start="false" /> 
+            <animator name="headerfade_anm" attribute="opacity" to="1" 
duration="500" start="false">
+            </animator> 
         </view>        
         
         <!-- headline and photo content -->
@@ -35,7 +43,7 @@
                     this.lyout.update();
                 </handler>
             </view>                       
-            <view >
+            <view id="gThumbnails">
                 <rssimage  datapath="rss:/rss/channel/item[1-12]" width="320" 
/>                        
                 <mygridlayout id="piclayout" name="lyout" hsize="49" 
vsize="34" columns="2"/>
                 <handler name="oninit" >
@@ -166,7 +174,6 @@
                 this.nomatch.setVisible(false);                
                 
gMoreInfo.txt.setText(gDetails.currentTitleSelection.content.text);             
   
                 
gMoreInfo.img.setSource(gDetails.currentImageSelection.urlText.text);           
     
-                gDetails.reset();
                 gMoreInfo.show();
             }            
         </method>
@@ -251,7 +258,7 @@
         <handler name="onstop" reference="coverslide_anm" >
             this.setVisible(false);
             txtlayout.intro.doStart();
-            tbar.headerfade_anm.doStart();
+            // tbar.headerfade_anm.doStart();
         </handler>
         
     </view>


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to