Skip to content

Instantly share code, notes, and snippets.

@kevinzhow
Created December 20, 2015 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinzhow/f714ceabc739cdceecc1 to your computer and use it in GitHub Desktop.
Save kevinzhow/f714ceabc739cdceecc1 to your computer and use it in GitHub Desktop.
Fuse ScrollView
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
};
<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