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-04 18:22:45 +08:00
|
|
|
|
2020-09-04 18:51:08 +08:00
|
|
|
@Entry(exports = [ModalDemo, CounterPage])
|
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-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)
|
|
|
|
}
|
|
|
|
}
|