feat:rename bgcolor to backgroundColor
This commit is contained in:
		| @@ -6,7 +6,7 @@ function thisLabel(str: string) { | ||||
|         text: str, | ||||
|         width: 60, | ||||
|         height: 50, | ||||
|         bgColor: colors[0], | ||||
|         backgroundColor: colors[0], | ||||
|         textSize: 15, | ||||
|         textColor: Color.WHITE, | ||||
|         layoutConfig: layoutConfig().exactly(), | ||||
| @@ -34,7 +34,7 @@ class AnimatorDemo extends Panel { | ||||
|                                         view.width = view.height = 20 | ||||
|                                         view.x = view.y = 0 | ||||
|                                         view.rotation = 0 | ||||
|                                         view.bgColor = colors[2] | ||||
|                                         view.backgroundColor = colors[2] | ||||
|                                         view.corners = 0 | ||||
|                                         view.scaleX = 1 | ||||
|                                         view.scaleY = 1 | ||||
| @@ -102,7 +102,7 @@ class AnimatorDemo extends Panel { | ||||
|                             onClick: () => { | ||||
|                                 animate(this)({ | ||||
|                                     animations: () => { | ||||
|                                         view.bgColor = colors[(idx++) % colors.length] | ||||
|                                         view.backgroundColor = colors[(idx++) % colors.length] | ||||
|                                     }, | ||||
|                                     duration: 1000, | ||||
|                                 }); | ||||
| @@ -174,7 +174,7 @@ class AnimatorDemo extends Panel { | ||||
|                 view, | ||||
|             ]).apply({ | ||||
|                 layoutConfig: layoutConfig().atmost(), | ||||
|                 bgColor: colors[1].alpha(0.3 * 255), | ||||
|                 backgroundColor: colors[1].alpha(0.3 * 255), | ||||
|             }), | ||||
|         ]).apply({ | ||||
|             layoutConfig: layoutConfig().atmost(), | ||||
|   | ||||
| @@ -6,7 +6,7 @@ function thisLabel(str: string) { | ||||
|         text: str, | ||||
|         width: 80, | ||||
|         height: 30, | ||||
|         bgColor: colors[0], | ||||
|         backgroundColor: colors[0], | ||||
|         textSize: 10, | ||||
|         textColor: Color.WHITE, | ||||
|         layoutConfig: layoutConfig().exactly(), | ||||
| @@ -128,7 +128,7 @@ class AnimationDemo extends Panel { | ||||
|                 view, | ||||
|             ]).apply({ | ||||
|                 layoutConfig: layoutConfig().atmost(), | ||||
|                 bgColor: colors[1].alpha(0.3 * 255), | ||||
|                 backgroundColor: colors[1].alpha(0.3 * 255), | ||||
|             }), | ||||
|         ]).apply({ | ||||
|             layoutConfig: layoutConfig().atmost(), | ||||
|   | ||||
| @@ -59,7 +59,7 @@ class CounterView extends ViewHolder<CountModel> { | ||||
|                 offsetY: 10, | ||||
|             } | ||||
|             it.corners = 20 | ||||
|             it.bgColor = Color.parse('#ff00ff') | ||||
|             it.backgroundColor = Color.parse('#ff00ff') | ||||
|         })) | ||||
|  | ||||
|         root.addChild((new Image).also(iv => { | ||||
|   | ||||
| @@ -6,7 +6,7 @@ import { colors } from "./utils"; | ||||
| function box(idx = 0) { | ||||
|     return (new Stack).also(it => { | ||||
|         it.width = it.height = 20 | ||||
|         it.bgColor = colors[idx || 0] | ||||
|         it.backgroundColor = colors[idx || 0] | ||||
|     }) | ||||
| } | ||||
|  | ||||
| @@ -15,7 +15,7 @@ function boxStr(str: string, idx = 0) { | ||||
|         it.width = it.height = 20 | ||||
|         it.text = str | ||||
|         it.textColor = Color.WHITE | ||||
|         it.bgColor = colors[idx || 0] | ||||
|         it.backgroundColor = colors[idx || 0] | ||||
|     }) | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -23,7 +23,7 @@ class FlowDemo extends Panel { | ||||
|             rowSpace: 10, | ||||
|             renderItem: (idx) => { | ||||
|                 return new FlowLayoutItem().apply({ | ||||
|                     bgColor: colors[idx % colors.length], | ||||
|                     backgroundColor: colors[idx % colors.length], | ||||
|                     height: 50 + (idx % 3) * 20, | ||||
|                     layoutConfig: layoutConfig().w(LayoutSpec.AT_MOST), | ||||
|                 }).also(it => { | ||||
|   | ||||
| @@ -13,7 +13,7 @@ class ImageDemo extends Panel { | ||||
|                 layoutConfig: layoutConfig().w(LayoutSpec.AT_MOST), | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 bgColor: colors[5], | ||||
|                 backgroundColor: colors[5], | ||||
|                 textAlignment: gravity().center(), | ||||
|                 height: 50, | ||||
|             }), | ||||
|   | ||||
| @@ -14,7 +14,7 @@ const colors = [ | ||||
| function box(idx = 0) { | ||||
|     return (new Stack).also(it => { | ||||
|         it.width = it.height = 20 | ||||
|         it.bgColor = Color.parse(colors[idx || 0]) | ||||
|         it.backgroundColor = Color.parse(colors[idx || 0]) | ||||
|     }) | ||||
| } | ||||
| function boxStr(str: string, idx = 0) { | ||||
| @@ -22,7 +22,7 @@ function boxStr(str: string, idx = 0) { | ||||
|         it.width = it.height = 20 | ||||
|         it.text = str | ||||
|         it.textColor = Color.parse('#ffffff') | ||||
|         it.bgColor = Color.parse(colors[idx || 0]) | ||||
|         it.backgroundColor = Color.parse(colors[idx || 0]) | ||||
|     }) | ||||
| } | ||||
| function label(str: string) { | ||||
| @@ -117,7 +117,7 @@ class LayoutDemo extends Panel { | ||||
|                             widthSpec: LayoutSpec.EXACTLY, | ||||
|                             heightSpec: LayoutSpec.EXACTLY, | ||||
|                         }, | ||||
|                         bgColor: Color.parse('#eeeeee'), | ||||
|                         backgroundColor: Color.parse('#eeeeee'), | ||||
|                         gravity: gravity().center(), | ||||
|                     } as IHLayout), | ||||
|                     hlayout([ | ||||
| @@ -137,7 +137,7 @@ class LayoutDemo extends Panel { | ||||
|                             widthSpec: LayoutSpec.EXACTLY, | ||||
|                             heightSpec: LayoutSpec.EXACTLY, | ||||
|                         }, | ||||
|                         bgColor: Color.parse('#eeeeee'), | ||||
|                         backgroundColor: Color.parse('#eeeeee'), | ||||
|                         gravity: gravity().center(), | ||||
|                     } as IHLayout), | ||||
|                     hlayout([ | ||||
| @@ -157,7 +157,7 @@ class LayoutDemo extends Panel { | ||||
|                             widthSpec: LayoutSpec.EXACTLY, | ||||
|                             heightSpec: LayoutSpec.EXACTLY, | ||||
|                         }, | ||||
|                         bgColor: Color.parse('#eeeeee'), | ||||
|                         backgroundColor: Color.parse('#eeeeee'), | ||||
|                         gravity: gravity().center(), | ||||
|                     } as IHLayout), | ||||
|                     hlayout([ | ||||
| @@ -183,7 +183,7 @@ class LayoutDemo extends Panel { | ||||
|                             widthSpec: LayoutSpec.EXACTLY, | ||||
|                             heightSpec: LayoutSpec.EXACTLY, | ||||
|                         }, | ||||
|                         bgColor: Color.parse('#eeeeee'), | ||||
|                         backgroundColor: Color.parse('#eeeeee'), | ||||
|                         gravity: gravity().center(), | ||||
|                     } as IHLayout), | ||||
|                     hlayout([ | ||||
| @@ -215,7 +215,7 @@ class LayoutDemo extends Panel { | ||||
|                             widthSpec: LayoutSpec.EXACTLY, | ||||
|                             heightSpec: LayoutSpec.EXACTLY, | ||||
|                         }, | ||||
|                         bgColor: Color.parse('#eeeeee'), | ||||
|                         backgroundColor: Color.parse('#eeeeee'), | ||||
|                         gravity: gravity().center(), | ||||
|                     } as IHLayout), | ||||
|                 ]).also(it => { | ||||
| @@ -315,7 +315,7 @@ class LayoutDemo extends Panel { | ||||
|                                 widthSpec: LayoutSpec.EXACTLY, | ||||
|                                 heightSpec: LayoutSpec.EXACTLY, | ||||
|                             }, | ||||
|                             bgColor: Color.parse('#eeeeee'), | ||||
|                             backgroundColor: Color.parse('#eeeeee'), | ||||
|                             gravity: gravity().center(), | ||||
|                         } as IVLayout), | ||||
|                         vlayout([ | ||||
| @@ -345,7 +345,7 @@ class LayoutDemo extends Panel { | ||||
|                                 widthSpec: LayoutSpec.EXACTLY, | ||||
|                                 heightSpec: LayoutSpec.EXACTLY, | ||||
|                             }, | ||||
|                             bgColor: Color.parse('#eeeeee'), | ||||
|                             backgroundColor: Color.parse('#eeeeee'), | ||||
|                             gravity: gravity().center(), | ||||
|                         } as IVLayout), | ||||
|                         vlayout([ | ||||
| @@ -375,7 +375,7 @@ class LayoutDemo extends Panel { | ||||
|                                 widthSpec: LayoutSpec.EXACTLY, | ||||
|                                 heightSpec: LayoutSpec.EXACTLY, | ||||
|                             }, | ||||
|                             bgColor: Color.parse('#eeeeee'), | ||||
|                             backgroundColor: Color.parse('#eeeeee'), | ||||
|                             gravity: gravity().center(), | ||||
|                         } as IVLayout), | ||||
|                         vlayout([ | ||||
| @@ -406,7 +406,7 @@ class LayoutDemo extends Panel { | ||||
|                                 widthSpec: LayoutSpec.EXACTLY, | ||||
|                                 heightSpec: LayoutSpec.EXACTLY, | ||||
|                             }, | ||||
|                             bgColor: Color.parse('#eeeeee'), | ||||
|                             backgroundColor: Color.parse('#eeeeee'), | ||||
|                             gravity: gravity().center(), | ||||
|                         } as IVLayout), | ||||
|                         vlayout([ | ||||
| @@ -438,7 +438,7 @@ class LayoutDemo extends Panel { | ||||
|                                 widthSpec: LayoutSpec.EXACTLY, | ||||
|                                 heightSpec: LayoutSpec.EXACTLY, | ||||
|                             }, | ||||
|                             bgColor: Color.parse('#eeeeee'), | ||||
|                             backgroundColor: Color.parse('#eeeeee'), | ||||
|                             gravity: gravity().center(), | ||||
|                         } as IVLayout), | ||||
|                     ]).also(it => { | ||||
|   | ||||
| @@ -14,7 +14,7 @@ class ListPanel extends Panel { | ||||
|                 }, | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.parse("#535c68"), | ||||
|                 bgColor: Color.parse("#dff9fb"), | ||||
|                 backgroundColor: Color.parse("#dff9fb"), | ||||
|                 textAlignment: gravity().center(), | ||||
|                 height: 50, | ||||
|             }), | ||||
| @@ -64,7 +64,7 @@ class ListPanel extends Panel { | ||||
|                                             } | ||||
|                                         } | ||||
|                                         it.gravity = gravity().center() | ||||
|                                         it.bgColor = colors[(idx + offset) % colors.length] | ||||
|                                         it.backgroundColor = colors[(idx + offset) % colors.length] | ||||
|                                         let clicked = 0 | ||||
|                                         it.onClick = () => { | ||||
|                                             counter.text = `Item Clicked ${++clicked}` | ||||
| @@ -107,8 +107,8 @@ class ListPanel extends Panel { | ||||
|                 widthSpec: LayoutSpec.AT_MOST, | ||||
|                 heightSpec: LayoutSpec.AT_MOST, | ||||
|             } | ||||
|             it.bgColor = Color.WHITE | ||||
|             it.backgroundColor = Color.WHITE | ||||
|         }).in(rootView) | ||||
|         refreshView.bgColor = Color.YELLOW | ||||
|         refreshView.backgroundColor = Color.YELLOW | ||||
|     } | ||||
| } | ||||
| @@ -10,7 +10,7 @@ class ModalDemo extends Panel { | ||||
|                 layoutConfig: layoutConfig().w(LayoutSpec.AT_MOST), | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 bgColor: colors[1], | ||||
|                 backgroundColor: colors[1], | ||||
|                 textAlignment: Gravity.Center, | ||||
|                 height: 50, | ||||
|             }), | ||||
| @@ -18,7 +18,7 @@ class ModalDemo extends Panel { | ||||
|             label('Click me').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
| @@ -30,7 +30,7 @@ class ModalDemo extends Panel { | ||||
|             label('Click me').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
| @@ -43,7 +43,7 @@ class ModalDemo extends Panel { | ||||
|             label('Click me').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
| @@ -56,14 +56,14 @@ class ModalDemo extends Panel { | ||||
|                 layoutConfig: layoutConfig().w(LayoutSpec.AT_MOST), | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 bgColor: colors[2], | ||||
|                 backgroundColor: colors[2], | ||||
|                 textAlignment: Gravity.Center, | ||||
|                 height: 50, | ||||
|             }), | ||||
|             label('Click me').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
| @@ -82,14 +82,14 @@ class ModalDemo extends Panel { | ||||
|                 layoutConfig: layoutConfig().w(LayoutSpec.AT_MOST), | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 bgColor: colors[3], | ||||
|                 backgroundColor: colors[3], | ||||
|                 textAlignment: Gravity.Center, | ||||
|                 height: 50, | ||||
|             }), | ||||
|             label('Click me').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
| @@ -113,14 +113,14 @@ class ModalDemo extends Panel { | ||||
|                 layoutConfig: layoutConfig().w(LayoutSpec.AT_MOST), | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 bgColor: colors[4], | ||||
|                 backgroundColor: colors[4], | ||||
|                 textAlignment: Gravity.Center, | ||||
|                 height: 50, | ||||
|             }), | ||||
|             label('Click me').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
|   | ||||
| @@ -9,7 +9,7 @@ class NavbarDemo extends Panel { | ||||
|             label('isHidden').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
| @@ -22,7 +22,7 @@ class NavbarDemo extends Panel { | ||||
|             label('setHidden').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
| @@ -37,7 +37,7 @@ class NavbarDemo extends Panel { | ||||
|             label('setTitle').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
| @@ -51,7 +51,7 @@ class NavbarDemo extends Panel { | ||||
|             label('setBgColor').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
| @@ -65,7 +65,7 @@ class NavbarDemo extends Panel { | ||||
|             label('Pop').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
|   | ||||
| @@ -9,7 +9,7 @@ class NaivgatorDemo extends Panel { | ||||
|                 layoutConfig: layoutConfig().w(LayoutSpec.AT_MOST), | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 bgColor: colors[1], | ||||
|                 backgroundColor: colors[1], | ||||
|                 textAlignment: gravity().center(), | ||||
|                 height: 50, | ||||
|             }), | ||||
| @@ -20,7 +20,7 @@ class NaivgatorDemo extends Panel { | ||||
|                 'NetworkDemo', 'ScrollerDemo', 'SliderDemo', 'Snake', 'StorageDemo'].map(e => | ||||
|                     label(e).apply({ | ||||
|                         height: 50, | ||||
|                         bgColor: colors[0], | ||||
|                         backgroundColor: colors[0], | ||||
|                         textSize: 30, | ||||
|                         textColor: Color.WHITE, | ||||
|                         layoutConfig: layoutConfig().exactly().w(LayoutSpec.AT_MOST), | ||||
| @@ -32,7 +32,7 @@ class NaivgatorDemo extends Panel { | ||||
|             label('POP').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
|   | ||||
| @@ -9,7 +9,7 @@ class NetworkDemo extends Panel { | ||||
|             label('Click me').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
|   | ||||
| @@ -9,7 +9,7 @@ class PopoverDemo extends Panel { | ||||
|             label('Popover').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
| @@ -17,14 +17,14 @@ class PopoverDemo extends Panel { | ||||
|                     popover(context).show(text({ | ||||
|                         width: 200, | ||||
|                         height: 50, | ||||
|                         bgColor: colors[0], | ||||
|                         backgroundColor: colors[0], | ||||
|                         textColor: Color.WHITE, | ||||
|                         layoutConfig: layoutConfig().exactly().a(Gravity.Center), | ||||
|                         text: "This is PopOver Window", | ||||
|                     }).also(v => { | ||||
|                         let idx = 0 | ||||
|                         v.onClick = () => { | ||||
|                             v.bgColor = colors[(++idx) % colors.length] | ||||
|                             v.backgroundColor = colors[(++idx) % colors.length] | ||||
|                         } | ||||
|                         modal(context).toast('Dismissed after 3 seconds') | ||||
|                         setTimeout(() => { | ||||
|   | ||||
| @@ -40,7 +40,7 @@ class RefreshableDemo extends Panel { | ||||
|                 label('start Refresh').apply({ | ||||
|                     width: 300, | ||||
|                     height: 50, | ||||
|                     bgColor: colors[0], | ||||
|                     backgroundColor: colors[0], | ||||
|                     textSize: 30, | ||||
|                     textColor: Color.WHITE, | ||||
|                     layoutConfig: layoutConfig().exactly(), | ||||
| @@ -51,7 +51,7 @@ class RefreshableDemo extends Panel { | ||||
|                 label('stop Refresh').apply({ | ||||
|                     width: 300, | ||||
|                     height: 50, | ||||
|                     bgColor: colors[0], | ||||
|                     backgroundColor: colors[0], | ||||
|                     textSize: 30, | ||||
|                     textColor: Color.WHITE, | ||||
|                     layoutConfig: layoutConfig().exactly(), | ||||
| @@ -63,7 +63,7 @@ class RefreshableDemo extends Panel { | ||||
|                 label('Enable Refresh').apply({ | ||||
|                     width: 300, | ||||
|                     height: 50, | ||||
|                     bgColor: colors[0], | ||||
|                     backgroundColor: colors[0], | ||||
|                     textSize: 30, | ||||
|                     textColor: Color.WHITE, | ||||
|                     layoutConfig: layoutConfig().exactly(), | ||||
| @@ -75,7 +75,7 @@ class RefreshableDemo extends Panel { | ||||
|                 label('Disable Refresh').apply({ | ||||
|                     width: 300, | ||||
|                     height: 50, | ||||
|                     bgColor: colors[0], | ||||
|                     backgroundColor: colors[0], | ||||
|                     textSize: 30, | ||||
|                     textColor: Color.WHITE, | ||||
|                     layoutConfig: layoutConfig().exactly(), | ||||
| @@ -86,7 +86,7 @@ class RefreshableDemo extends Panel { | ||||
|                 label('Rotate self').apply({ | ||||
|                     width: 300, | ||||
|                     height: 50, | ||||
|                     bgColor: colors[0], | ||||
|                     backgroundColor: colors[0], | ||||
|                     textSize: 30, | ||||
|                     textColor: Color.WHITE, | ||||
|                     layoutConfig: layoutConfig().exactly(), | ||||
| @@ -101,7 +101,7 @@ class RefreshableDemo extends Panel { | ||||
|                 space: 10, | ||||
|             } as IVLayout)) | ||||
|         }).apply({ | ||||
|             bgColor: Color.YELLOW | ||||
|             backgroundColor: Color.YELLOW | ||||
|         }).in(rootView) | ||||
|     } | ||||
| } | ||||
| @@ -12,7 +12,7 @@ class ScrollerPanel extends Panel { | ||||
|                     layoutConfig: layoutConfig().exactly(), | ||||
|                     width: 300, | ||||
|                     height: 500, | ||||
|                     bgColor: Color.RED, | ||||
|                     backgroundColor: Color.RED, | ||||
|                 }), | ||||
|                 scroller( | ||||
|                     vlayout(new Array(100).fill(1).map(e => label('Scroll Content'))) | ||||
| @@ -20,14 +20,14 @@ class ScrollerPanel extends Panel { | ||||
|                     layoutConfig: layoutConfig().exactly(), | ||||
|                     width: 300, | ||||
|                     height: 500, | ||||
|                     bgColor: Color.BLUE, | ||||
|                     backgroundColor: Color.BLUE, | ||||
|                 }) | ||||
|             ]) | ||||
|         ) | ||||
|             .apply({ | ||||
|                 layoutConfig: layoutConfig().atmost().h(LayoutSpec.EXACTLY), | ||||
|                 height: 500, | ||||
|                 bgColor: Color.YELLOW, | ||||
|                 backgroundColor: Color.YELLOW, | ||||
|             }) | ||||
|             .in(rootView) | ||||
|     } | ||||
|   | ||||
| @@ -24,7 +24,7 @@ class SliderPanel extends Panel { | ||||
|                 }, | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 bgColor: colors[1], | ||||
|                 backgroundColor: colors[1], | ||||
|                 textAlignment: gravity().center(), | ||||
|                 height: 50, | ||||
|             }), | ||||
| @@ -38,7 +38,7 @@ class SliderPanel extends Panel { | ||||
|                     })).also(it => { | ||||
|                         let start = idx | ||||
|                         it.onClick = () => { | ||||
|                             it.bgColor = (colors[++start % colors.length]) | ||||
|                             it.backgroundColor = (colors[++start % colors.length]) | ||||
|                         } | ||||
|                     }) | ||||
|                 }, | ||||
|   | ||||
| @@ -144,7 +144,7 @@ class SnakeView extends ViewHolder<SnakeModel> { | ||||
|     right?: Text | ||||
|  | ||||
|     build(root: Group): void { | ||||
|         root.bgColor = Color.parse('#000000') | ||||
|         root.backgroundColor = Color.parse('#000000') | ||||
|         vlayout([ | ||||
|             text({ | ||||
|                 text: "Snake", | ||||
| @@ -160,7 +160,7 @@ class SnakeView extends ViewHolder<SnakeModel> { | ||||
|                 }, | ||||
|             }), | ||||
|             (new Stack).also(panel => { | ||||
|                 panel.bgColor = Color.parse('#00ff00') | ||||
|                 panel.backgroundColor = Color.parse('#00ff00') | ||||
|                 this.panel = panel | ||||
|             }), | ||||
|             hlayout([ | ||||
| @@ -188,7 +188,7 @@ class SnakeView extends ViewHolder<SnakeModel> { | ||||
|                         text: "↑", | ||||
|                         textSize: 30, | ||||
|                         textAlignment: new Gravity().center(), | ||||
|                         bgColor: Color.parse('#ffff00'), | ||||
|                         backgroundColor: Color.parse('#ffff00'), | ||||
|                         layoutConfig: { | ||||
|                             widthSpec: LayoutSpec.EXACTLY, | ||||
|                             heightSpec: LayoutSpec.EXACTLY, | ||||
| @@ -207,7 +207,7 @@ class SnakeView extends ViewHolder<SnakeModel> { | ||||
|                         text: "←", | ||||
|                         textSize: 30, | ||||
|                         textAlignment: new Gravity().center(), | ||||
|                         bgColor: Color.parse('#ffff00'), | ||||
|                         backgroundColor: Color.parse('#ffff00'), | ||||
|                         layoutConfig: { | ||||
|                             widthSpec: LayoutSpec.EXACTLY, | ||||
|                             heightSpec: LayoutSpec.EXACTLY, | ||||
| @@ -219,7 +219,7 @@ class SnakeView extends ViewHolder<SnakeModel> { | ||||
|                         text: "↓", | ||||
|                         textSize: 30, | ||||
|                         textAlignment: new Gravity().center(), | ||||
|                         bgColor: Color.parse('#ffff00'), | ||||
|                         backgroundColor: Color.parse('#ffff00'), | ||||
|                         layoutConfig: { | ||||
|                             widthSpec: LayoutSpec.EXACTLY, | ||||
|                             heightSpec: LayoutSpec.EXACTLY, | ||||
| @@ -231,7 +231,7 @@ class SnakeView extends ViewHolder<SnakeModel> { | ||||
|                         text: "→", | ||||
|                         textSize: 30, | ||||
|                         textAlignment: new Gravity().center(), | ||||
|                         bgColor: Color.parse('#ffff00'), | ||||
|                         backgroundColor: Color.parse('#ffff00'), | ||||
|                         layoutConfig: { | ||||
|                             widthSpec: LayoutSpec.EXACTLY, | ||||
|                             heightSpec: LayoutSpec.EXACTLY, | ||||
| @@ -292,9 +292,9 @@ class SnakeView extends ViewHolder<SnakeModel> { | ||||
|                 this.panel.addChild(item) | ||||
|             } | ||||
|             if (index === nodes.length - 1) { | ||||
|                 item.bgColor = Color.parse('#ffff00') | ||||
|                 item.backgroundColor = Color.parse('#ffff00') | ||||
|             } else { | ||||
|                 item.bgColor = Color.parse('#ff0000') | ||||
|                 item.backgroundColor = Color.parse('#ff0000') | ||||
|             } | ||||
|             item.x = e.x * 10 | ||||
|             item.y = e.y * 10 | ||||
|   | ||||
| @@ -20,7 +20,7 @@ class StorageDemo extends Panel { | ||||
|                 layoutConfig: layoutConfig().w(LayoutSpec.AT_MOST), | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 bgColor: colors[1], | ||||
|                 backgroundColor: colors[1], | ||||
|                 textAlignment: gravity().center(), | ||||
|                 height: 50, | ||||
|             }), | ||||
| @@ -29,14 +29,14 @@ class StorageDemo extends Panel { | ||||
|                 layoutConfig: layoutConfig().w(LayoutSpec.AT_MOST), | ||||
|                 textSize: 20, | ||||
|                 textColor: Color.WHITE, | ||||
|                 bgColor: colors[3], | ||||
|                 backgroundColor: colors[3], | ||||
|                 textAlignment: gravity().center(), | ||||
|                 height: 50, | ||||
|             }).also(it => this.stored = it), | ||||
|             label('store a value').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
| @@ -57,7 +57,7 @@ class StorageDemo extends Panel { | ||||
|             label('remove value').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
| @@ -70,7 +70,7 @@ class StorageDemo extends Panel { | ||||
|             label('clear values').apply({ | ||||
|                 width: 200, | ||||
|                 height: 50, | ||||
|                 bgColor: colors[0], | ||||
|                 backgroundColor: colors[0], | ||||
|                 textSize: 30, | ||||
|                 textColor: Color.WHITE, | ||||
|                 layoutConfig: layoutConfig().exactly(), | ||||
|   | ||||
| @@ -24,7 +24,7 @@ export function label(str: string) { | ||||
| export function box(idx = 0) { | ||||
|     return (new Stack).also(it => { | ||||
|         it.width = it.height = 20 | ||||
|         it.bgColor = colors[idx || 0] | ||||
|         it.backgroundColor = colors[idx || 0] | ||||
|     }) | ||||
| } | ||||
| export function boxStr(str: string, idx = 0) { | ||||
| @@ -32,7 +32,7 @@ export function boxStr(str: string, idx = 0) { | ||||
|         it.width = it.height = 20 | ||||
|         it.text = str | ||||
|         it.textColor = Color.WHITE | ||||
|         it.bgColor = colors[idx || 0] | ||||
|         it.backgroundColor = colors[idx || 0] | ||||
|     }) | ||||
| } | ||||
|  | ||||
| @@ -42,7 +42,7 @@ export function title(str: string) { | ||||
|         layoutConfig: layoutConfig().w(LayoutSpec.AT_MOST), | ||||
|         textSize: 30, | ||||
|         textColor: Color.WHITE, | ||||
|         bgColor: colors[1], | ||||
|         backgroundColor: colors[1], | ||||
|         textAlignment: gravity().center(), | ||||
|         height: 50, | ||||
|     }) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user