You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by yi...@apache.org on 2019/01/01 09:55:45 UTC
[royale-asjs] branch develop updated: Provide separate list for
infinite scrolling.
This is an automated email from the ASF dual-hosted git repository.
yishayw pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new fc3e163 Provide separate list for infinite scrolling.
fc3e163 is described below
commit fc3e1638bfe0e788b8df0fbdfe742287aa402ed3
Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
AuthorDate: Tue Jan 1 11:54:55 2019 +0200
Provide separate list for infinite scrolling.
---
.../ListExample/src/main/royale/MyInitialView.mxml | 32 +++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/examples/royale/ListExample/src/main/royale/MyInitialView.mxml b/examples/royale/ListExample/src/main/royale/MyInitialView.mxml
index 49bd9bd..69f2b09 100644
--- a/examples/royale/ListExample/src/main/royale/MyInitialView.mxml
+++ b/examples/royale/ListExample/src/main/royale/MyInitialView.mxml
@@ -64,7 +64,23 @@ limitations under the License.
(applicationModel as ProductsModel).productNames.addItemAt("Wing Bats", 2);
}
private function onScrollEnd():void{
- trace("scroll end");
+ addToInfiniteList();
+ }
+
+ private function infiniteListInitCompleteHandler():void
+ {
+ infiniteList.dataProvider = new ArrayList();
+ addToInfiniteList();
+ }
+
+ private function addToInfiniteList():void
+ {
+ var dp:ArrayList = infiniteList.dataProvider as ArrayList;
+ for (var i:int = 0; i < 100; i++)
+ {
+ dp.source.push("Item " + (dp.length + 1));
+ }
+ infiniteList.dataProvider = new ArrayList(dp.source);
}
private function assignDataProvider():void{
@@ -150,5 +166,19 @@ limitations under the License.
</js:beads>
</js:List>
+ <!-- An infinite List
+ -->
+
+ <js:Label x="1180" y="20" text="An infinite List" />
+
+ <js:List x="1180" y="40" width="200" height="300" initComplete="infiniteListInitCompleteHandler()" id="infiniteList">
+ <js:beads>
+ <js:InfiniteVScroller scrollEnd="onScrollEnd()"/>
+ <js:ArrayListSelectionModel/>
+ <js:DataItemRendererFactoryForArrayList/>
+ <js:EasyDataProviderChangeNotifier/>
+ </js:beads>
+ </js:List>
+
</js:View>