add navigator demo & stack view

This commit is contained in:
王劲鹏 2021-06-08 10:25:36 +08:00 committed by osborn
parent 59bd3ea1ab
commit 7cdef00c34
3 changed files with 34 additions and 20 deletions

View File

@ -56,33 +56,36 @@ void DoricDemoBridge::navigate(QVariant route) {
name = "ModularDemo.js"; name = "ModularDemo.js";
break; break;
case 12: case 12:
name = "NetworkDemo.js"; name = "NavigatorDemo.js";
break; break;
case 13: case 13:
name = "NotificationDemo.js"; name = "NetworkDemo.js";
break; break;
case 14: case 14:
name = "PopoverDemo.js"; name = "NotificationDemo.js";
break; break;
case 15: case 15:
name = "ScrollerDemo.js"; name = "PopoverDemo.js";
break; break;
case 16: case 16:
name = "SimpleDemo.js"; name = "ScrollerDemo.js";
break; break;
case 17: case 17:
name = "SliderDemo.js"; name = "SimpleDemo.js";
break; break;
case 18: case 18:
name = "Snake.js"; name = "SliderDemo.js";
break; break;
case 19: case 19:
name = "StorageDemo.js"; name = "Snake.js";
break; break;
case 20: case 20:
name = "SwitchDemo.js"; name = "StorageDemo.js";
break; break;
case 21: case 21:
name = "SwitchDemo.js";
break;
case 22:
name = "TextDemo.js"; name = "TextDemo.js";
break; break;
} }

View File

@ -5,9 +5,17 @@ ApplicationWindow {
visible: true visible: true
width: 600 width: 600
height: 800 height: 800
title: qsTr("Scroll") title: qsTr("Doric Demo")
StackView {
id: stack
initialItem: entry
anchors.fill: parent
}
ScrollView { ScrollView {
id: entry
anchors.fill: parent anchors.fill: parent
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
@ -15,7 +23,7 @@ ApplicationWindow {
ListView { ListView {
width: parent.width width: parent.width
model: 22 model: 23
delegate: Rectangle { delegate: Rectangle {
Column { Column {
anchors.centerIn: parent anchors.centerIn: parent
@ -47,24 +55,26 @@ ApplicationWindow {
case 11: case 11:
return "ModularDemo.js" return "ModularDemo.js"
case 12: case 12:
return "NetworkDemo.js" return "NavigatorDemo.js"
case 13: case 13:
return "NotificationDemo.js" return "NetworkDemo.js"
case 14: case 14:
return "PopoverDemo.js" return "NotificationDemo.js"
case 15: case 15:
return "ScrollerDemo.js" return "PopoverDemo.js"
case 16: case 16:
return "SimpleDemo.js" return "ScrollerDemo.js"
case 17: case 17:
return "SliderDemo.js" return "SimpleDemo.js"
case 18: case 18:
return "Snake.js" return "SliderDemo.js"
case 19: case 19:
return "StorageDemo.js" return "Snake.js"
case 20: case 20:
return "SwitchDemo.js" return "StorageDemo.js"
case 21: case 21:
return "SwitchDemo.js"
case 22:
return "TextDemo.js" return "TextDemo.js"
} }
} }

View File

@ -21,6 +21,7 @@
<file alias="LayoutTestDemo.js">../../../doric-demo/bundle/src/LayoutTestDemo.js</file> <file alias="LayoutTestDemo.js">../../../doric-demo/bundle/src/LayoutTestDemo.js</file>
<file alias="ModalDemo.js">../../../doric-demo/bundle/src/ModalDemo.js</file> <file alias="ModalDemo.js">../../../doric-demo/bundle/src/ModalDemo.js</file>
<file alias="ModularDemo.js">../../../doric-demo/bundle/src/ModularDemo.js</file> <file alias="ModularDemo.js">../../../doric-demo/bundle/src/ModularDemo.js</file>
<file alias="NavigatorDemo.js">../../../doric-demo/bundle/src/NavigatorDemo.js</file>
<file alias="NetworkDemo.js">../../../doric-demo/bundle/src/NetworkDemo.js</file> <file alias="NetworkDemo.js">../../../doric-demo/bundle/src/NetworkDemo.js</file>
<file alias="NotificationDemo.js">../../../doric-demo/bundle/src/NotificationDemo.js</file> <file alias="NotificationDemo.js">../../../doric-demo/bundle/src/NotificationDemo.js</file>
<file alias="PopoverDemo.js">../../../doric-demo/bundle/src/PopoverDemo.js</file> <file alias="PopoverDemo.js">../../../doric-demo/bundle/src/PopoverDemo.js</file>