Repeater added to gallery app

This commit is contained in:
Vladimir Enchev
2015-05-25 16:14:58 +03:00
parent 5402f3eee9
commit e1bad6d1aa
4 changed files with 28 additions and 0 deletions

View File

@ -76,6 +76,9 @@
<TypeScriptCompile Include="apps\gallery-app\views\list-view.ts">
<DependentUpon>list-view.xml</DependentUpon>
</TypeScriptCompile>
<TypeScriptCompile Include="apps\gallery-app\views\repeater.ts">
<DependentUpon>repeater.xml</DependentUpon>
</TypeScriptCompile>
<TypeScriptCompile Include="apps\placeholder-demo\app.ts" />
<TypeScriptCompile Include="apps\placeholder-demo\main-page.android.ts">
<DependentUpon>main-page.xml</DependentUpon>
@ -597,6 +600,7 @@
<Content Include="apps\gallery-app\content\border.xml" />
<Content Include="apps\gallery-app\app.css" />
<Content Include="apps\gallery-app\views\list-picker.xml" />
<Content Include="apps\gallery-app\views\repeater.xml" />
<Content Include="apps\gallery-app\views\segmented-bar.xml" />
<Content Include="apps\gallery-app\views\time-picker.xml" />
<Content Include="apps\gallery-app\views\date-picker.xml" />

View File

@ -32,6 +32,7 @@
<Button tag="views/image" text="Image" tap="itemTap" />
<Button tag="views/search-bar" text="SearchBar" tap="itemTap" />
<Button tag="views/list-view" text="ListView" tap="itemTap" />
<Button tag="views/repeater" text="Repeater" tap="itemTap" />
<Button tag="views/dialogs" text="Dialogs" tap="itemTap" />
<Button tag="views/date-picker" text="DatePicker" tap="itemTap" />
<Button tag="views/time-picker" text="TimePicker" tap="itemTap" />

View File

@ -0,0 +1,10 @@
export function pageLoaded(args) {
var page = args.object;
var itemsArr = [];
for (var i = 1; i <= 64; i++) {
itemsArr.push({ title: "List item " + i });
}
page.bindingContext = { items: itemsArr };
}

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Page loaded="pageLoaded">
<ScrollView>
<Repeater items="{{ items }}">
<Repeater.itemsLayout>
<WrapLayout />
</Repeater.itemsLayout>
<Repeater.itemTemplate>
<Label text="{{ title }}" margin="10" />
</Repeater.itemTemplate>
</Repeater>
</ScrollView>
</Page>