Created
December 20, 2015 08:21
-
-
Save kevinzhow/f714ceabc739cdceecc1 to your computer and use it in GitHub Desktop.
Fuse ScrollView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Observable = require('FuseJS/Observable'); | |
var name = Observable("Kevin"); | |
var people = Observable(); | |
for (var i = 0; i < 10; i++) { | |
people.add({name:"Man " + i, age: "He is " + ((2*i)+1) + " years old."}) | |
} | |
setTimeout(function(){ | |
name.value = "Fuse"; | |
},1000); | |
function Say() { | |
console.log("Say it"); | |
} | |
module.exports = { | |
name: name, | |
Say:Say, | |
people: people | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<App Theme="Basic"> | |
<JavaScript File="main.js" /> | |
<ScrollView Padding="30" ScrollPositionChanged="{Say}"> | |
<StackPanel ItemSpacing="20"> | |
<Each Items="{people}"> | |
<Rectangle> | |
<Stroke Width="2" Brush="#000" /> | |
<StackPanel ItemSpacing="5" Margin="10"> | |
<Text Value="{name}" FontSize="20" TextColor="#000" Margin="0"/> | |
<Text Value="{age}" TextColor="#aaa"/> | |
</StackPanel> | |
<WhilePressed> | |
<Scale Factor="0.98" Duration="0.1"/> | |
</WhilePressed> | |
</Rectangle> | |
</Each> | |
</StackPanel> | |
</ScrollView> | |
</App> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment