Author: ben
Date: 2007-07-09 12:23:06 -0700 (Mon, 09 Jul 2007)
New Revision: 5633
Modified:
sandbox/ben/smush/main.lzx
sandbox/ben/smush/yahooimags.xml
Log:
made article display look nicer, added 'tap to begin' hint at startup
Modified: sandbox/ben/smush/main.lzx
===================================================================
--- sandbox/ben/smush/main.lzx 2007-07-09 18:30:03 UTC (rev 5632)
+++ sandbox/ben/smush/main.lzx 2007-07-09 19:23:06 UTC (rev 5633)
@@ -1,4 +1,4 @@
-<canvas width="320" height="356">
+<canvas width="320" height="356" bgcolor="0x000000">
<!-- data -->
<dataset name="rss" src="yahooimags.xml" id="ds1" />
@@ -7,6 +7,7 @@
<include href="classes.lzx" />
<include href="resources.lzx" />
+ <!-- Wait to load thumbnails until after the app is initialized -->
<method name="loadThumbnails">
Debug.write("loadThumbnails");
for (i in gThumbnails.subviews) {
@@ -105,22 +106,22 @@
<view name="shadow" bgcolor="0x000000" x="3" y="3"
width="${parent.width}" height="${parent.height}" opacity=".5" />
<view name="image" width="${parent.width}" height="${parent.height}"
stretches="both"/>
<method name="setTarget" args="v" >
- this.movingView = v;
- this.setX( v.getAttributeRelative('x',canvas) );
- this.setY( v.getAttributeRelative('y',canvas) );
- this.setWidth(v.width);
- this.setHeight(v.height);
- this.image.setSource(v.urlText.text);
- this.setVisible( true );
- animSlide.doStart();
+ this.movingView = v;
+ this.setX( v.getAttributeRelative('x',canvas) );
+ this.setY( v.getAttributeRelative('y',canvas) );
+ this.setWidth(v.width);
+ this.setHeight(v.height);
+ this.image.setSource(v.urlText.text);
+ this.setVisible( true );
+ animSlide.doStart();
</method>
<animatorgroup name="animSlide" start="false" duration="500"
process="simultaneous" >
- <animator attribute="y" to="191" motion="easein" />
- <animator attribute="x" to="245" motion="easeout" />
- <method event="onstop">
- gDetails.showImage(floatview.movingView);
- floatview.setVisible(false);
- </method>
+ <animator attribute="y" to="191" motion="easein" />
+ <animator attribute="x" to="245" motion="easeout" />
+ <method event="onstop">
+ gDetails.showImage(floatview.movingView);
+ floatview.setVisible(false);
+ </method>
</animatorgroup>
<method name="setColor" args="c" >
@@ -138,7 +139,7 @@
this.showMismatch();
</method>
<method name="showMatch">
- // hide nomathc icon and text
+ // hide nomatch icon and text
this.nomatch.setVisible(false);
this.capsule.txt_nomatch.setVisible( false );
@@ -171,7 +172,8 @@
<method name="hideResult">
this.hideResultAnim.doStart();
if (this.matched) {
- this.nomatch.setVisible(false);
+ this.nomatch.setVisible(false);
+
gMoreInfo.title.setText(gDetails.currentTitleSelection.title.text);
gMoreInfo.txt.setText(gDetails.currentTitleSelection.content.text);
gMoreInfo.img.setSource(gDetails.currentImageSelection.urlText.text);
gMoreInfo.show();
@@ -192,7 +194,7 @@
</view>
- <animatorgroup name="showResultAnim" start="false"> <!--
process="sim3ltaneous"-->
+ <animatorgroup name="showResultAnim" start="false">
<animator
attribute="opacity" to="0.7" start="false" duration="300"
target="gResult.film"/>
<animator
@@ -230,10 +232,18 @@
<method name="show">
animIn.doStart();
</method>
+ <simplelayout axis="y" spacing="2" />
+ <text name="title" width="$once{gInfo.title.width}" text="Article
Title"
+ y="8" x="$once{gInfo.title.x}" fontstyle="bold"
+ multiline="true"
+ />
<text name="txt" multiline="true" width="$once{gInfo.title.width}"
height="$once{parent.height}" x="$once{gInfo.title.x}"
+ y="20"
/>
- <view name="img" x="${gPreview.x}" width="${gPreview.width}"
y="$once{gPreview.y}" height="$once{gPreview.height}" />
+ <view name="img" x="${gPreview.x-5}" width="${gPreview.width}" y="8"
+ height="$once{gPreview.height}" clip="true"
+ options="ignorelayout" />
<method event="onclick">
animOut.doStart();
</method>
@@ -241,7 +251,6 @@
<view name="cover" width="320" height="356"
onclick="coverslide_anm.doStart()" >
<view name="top" bgcolor="0x000000" height="178" width="320" >
- <!-- text x="30" text="NEWS" fontsize="40" fontstyle="bold"
fgcolor="white" y="$once{parent.height-height}" /-->
<view resource="cover-news.png" x="55"
y="$once{parent.height-height}" />
</view>
@@ -252,8 +261,13 @@
<animatorgroup name="coverslide_anm" process="simultaneous"
start="false" duration="500" >
<animator target="${cover.top}" attribute="y" to="-180" />
<animator target="${cover.bottom}" attribute="y" to="360" />
+ <method event="onstart">
+ parent.tapToBegin.setVisible(false);
+ </method>
</animatorgroup>
+ <text name="tapToBegin" y="300" x="120" visible="false" text="tap to
begin">
+ </text>
<handler name="onstop" reference="coverslide_anm" >
this.setVisible(false);
@@ -263,6 +277,10 @@
</view>
+<script>
+ canvas.cover.tapToBegin.setVisible(true);
+</script>
+
</canvas>
<!-- Copyright 2007 Laszlo Systems -->
Modified: sandbox/ben/smush/yahooimags.xml
===================================================================
--- sandbox/ben/smush/yahooimags.xml 2007-07-09 18:30:03 UTC (rev 5632)
+++ sandbox/ben/smush/yahooimags.xml 2007-07-09 19:23:06 UTC (rev 5633)
@@ -17,7 +17,7 @@
<item>
<title>Banggai Cardinal fish is seen in an exotic fish store aquarium
...</title>
<link>http://us.rd.yahoo.com/dailynews/rss/photos/categories/441/index/*http://news.yahoo.com/photos/ss/441/im:/070706/480/709332dece834d7c9b37a4668fbba8b2</link>
- <description><![CDATA[<p><a
href="http://us.rd.yahoo.com/dailynews/rss/photos/categories/441/index/*http://news.yahoo.com/photos/ss/441/im:/070706/480/709332dece834d7c9b37a4668fbba8b2">
</a>(AP) - A Banggai Cardinal fish is seen in an exotic fish store aquarium in
Tyler, Texas, Thursday, July 5, 2007. (AP Photo/Dr. Scott M. Lieberman)</p><br
clear=all>]]></description>
+ <description><![CDATA[<p>(AP) - A Banggai Cardinal fish is seen in an
exotic fish store aquarium in Tyler, Texas, Thursday, July 5, 2007. (AP
Photo/Dr. Scott M. Lieberman)</p><br clear=all>]]></description>
<author>(AP)</author>
<pubDate>Fri, 06 Jul 2007 01:39:23 GMT</pubDate>
<guid
isPermaLink="false">http://d.yimg.com/us.yimg.com/p/ap/20070706/capt.709332dece834d7c9b37a4668fbba8b2.banggai_cardinal_fish_txsl102.jpg?x=130&y=99&sig=wScS76wMjLGybZ5vcU.AUQ--</guid>
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins