This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-demo/src/MultiPanelDemo.ts

70 lines
2.8 KiB
TypeScript
Raw Normal View History

2020-09-04 18:22:45 +08:00
import { Group, Panel, navbar, text, gravity, Color, LayoutSpec, vlayout, Gravity, hlayout, scroller, layoutConfig, image, modal, navigator, ViewHolder, Text, ViewModel, VMPanel } from "doric";
import { title, label, colors } from "./utils";
import { ModalDemo } from "./ModalDemo";
2020-09-04 18:51:08 +08:00
import { CounterPage } from './Counter'
2020-09-05 12:41:12 +08:00
import { PopoverDemo } from "./PopoverDemo";
2020-09-04 18:22:45 +08:00
2020-09-05 12:41:12 +08:00
@Entry
2020-09-04 18:22:45 +08:00
class MultiPanelDemo extends Panel {
build(rootView: Group): void {
scroller(
vlayout(
[
title("Multi Panel"),
2020-09-04 18:51:08 +08:00
label('ModalDemo').apply({
2020-09-04 18:22:45 +08:00
width: 200,
height: 50,
backgroundColor: colors[0],
textSize: 30,
textColor: Color.WHITE,
layoutConfig: layoutConfig().just(),
onClick: () => {
navigator(context).push(ModalDemo)
}
}),
2020-09-04 18:51:08 +08:00
label('Counter').apply({
width: 200,
height: 50,
backgroundColor: colors[0],
textSize: 30,
textColor: Color.WHITE,
layoutConfig: layoutConfig().just(),
onClick: () => {
navigator(context).push(CounterPage)
}
}),
2020-09-05 12:41:12 +08:00
label('Popover').apply({
width: 200,
height: 50,
backgroundColor: colors[0],
textSize: 30,
textColor: Color.WHITE,
layoutConfig: layoutConfig().just(),
onClick: () => {
navigator(context).push(PopoverDemo)
}
}),
2020-09-05 11:14:22 +08:00
label('Multi Panel').apply({
width: 200,
height: 50,
backgroundColor: colors[0],
textSize: 30,
textColor: Color.WHITE,
layoutConfig: layoutConfig().just(),
onClick: () => {
navigator(context).push(MultiPanelDemo)
}
}),
2020-09-04 18:22:45 +08:00
],
{
layoutConfig: layoutConfig().most().configHeight(LayoutSpec.FIT),
gravity: gravity().center(),
space: 10,
}),
{
layoutConfig: layoutConfig().most(),
backgroundColor: Color.BLUE,
}
).in(rootView)
}
}