@zeppos/zeus-cli 1.6.5 → 1.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/modules/create.js +3 -0
  2. package/package.json +2 -2
  3. package/private-modules/zeppos-app-utils/dist/modules/create/index.js +3 -2
  4. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/_package.json +17 -0
  5. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/app.js +27 -0
  6. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/app.json +52 -0
  7. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/consume.png +0 -0
  8. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/beer.png +0 -0
  9. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/cake.png +0 -0
  10. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/chocolate.png +0 -0
  11. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/coffee.png +0 -0
  12. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/cookies.png +0 -0
  13. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/ham.png +0 -0
  14. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/hamburger.png +0 -0
  15. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/ice cream.png +0 -0
  16. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/pizza.png +0 -0
  17. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/food/sausage.png +0 -0
  18. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/icon.png +0 -0
  19. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/multiply.png +0 -0
  20. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/selected.png +0 -0
  21. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.r/unselected.png +0 -0
  22. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/consume.png +0 -0
  23. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/beer.png +0 -0
  24. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/cake.png +0 -0
  25. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/chocolate.png +0 -0
  26. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/coffee.png +0 -0
  27. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/cookies.png +0 -0
  28. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/ham.png +0 -0
  29. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/hamburger.png +0 -0
  30. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/ice cream.png +0 -0
  31. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/pizza.png +0 -0
  32. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/food/sausage.png +0 -0
  33. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/icon.png +0 -0
  34. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/multiply.png +0 -0
  35. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/selected.png +0 -0
  36. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/assets/gt.s/unselected.png +0 -0
  37. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/global.d.ts +1 -0
  38. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/jsconfig.json +9 -0
  39. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/gt/food-list.js +107 -0
  40. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/gt/food-list.r.layout.js +48 -0
  41. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/gt/food-list.s.layout.js +33 -0
  42. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/gt/index.js +127 -0
  43. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/gt/index.r.layout.js +110 -0
  44. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/gt/index.s.layout.js +98 -0
  45. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/i18n/en-US.po +42 -0
  46. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/page/i18n/zh-CN.po +42 -0
  47. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/utils/constants.js +62 -0
  48. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/calories/utils/storage.js +40 -0
  49. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/_package.json +14 -0
  50. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/app-side/i18n/en-US.po +2 -0
  51. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/app-side/index.js +13 -0
  52. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/app.js +10 -0
  53. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/app.json +60 -0
  54. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/assets/default.b/icon.png +0 -0
  55. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/assets/default.r/icon.png +0 -0
  56. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/assets/default.s/icon.png +0 -0
  57. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/global.d.ts +1 -0
  58. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/jsconfig.json +9 -0
  59. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/page/i18n/en-US.po +2 -0
  60. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/page/index.b.layout.js +6 -0
  61. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/page/index.js +7 -0
  62. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/page/index.r.layout.js +6 -0
  63. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/page/index.s.layout.js +6 -0
  64. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/setting/i18n/en-US.po +2 -0
  65. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/empty/setting/index.js +7 -0
  66. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/_package.json +17 -0
  67. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/app-side/i18n/en-US.po +2 -0
  68. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/app-side/index.js +56 -0
  69. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/app.js +14 -0
  70. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/app.json +51 -0
  71. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/assets/common.r/icon.png +0 -0
  72. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/assets/common.s/icon.png +0 -0
  73. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/global.d.ts +1 -0
  74. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/jsconfig.json +9 -0
  75. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/page/i18n/en-US.po +2 -0
  76. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/page/index.js +45 -0
  77. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/page/index.r.layout.js +32 -0
  78. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/page/index.s.layout.js +32 -0
  79. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/utils/config/constants.js +2 -0
  80. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/fetch-api/utils/config/device.js +2 -0
  81. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/_package.json +17 -0
  82. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/app.js +10 -0
  83. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/app.json +51 -0
  84. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/assets/gt.r/icon.png +0 -0
  85. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/assets/gt.r/image/logo.png +0 -0
  86. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/assets/gt.s/icon.png +0 -0
  87. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/assets/gt.s/image/logo.png +0 -0
  88. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/global.d.ts +1 -0
  89. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/jsconfig.json +9 -0
  90. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/page/gt/home/index.page.js +17 -0
  91. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/page/gt/home/index.page.r.layout.js +19 -0
  92. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/page/gt/home/index.page.s.layout.js +19 -0
  93. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/page/i18n/en-US.po +2 -0
  94. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/page/i18n/zh-CN.po +2 -0
  95. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/hello-world/utils/index.js +3 -0
  96. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/_package.json +17 -0
  97. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/app.js +16 -0
  98. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/app.json +71 -0
  99. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/assets/default.b/icon.png +0 -0
  100. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/assets/default.r/icon.png +0 -0
  101. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/assets/default.r/images/icons/ic_moon.png +0 -0
  102. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/assets/default.s/icon.png +0 -0
  103. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/global.d.ts +1 -0
  104. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/jsconfig.json +9 -0
  105. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/TC/TC_01/index.js +205 -0
  106. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/TC/TC_01/index.r.layout.js +106 -0
  107. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/TC/TC_02/index.js +88 -0
  108. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/TC/TC_02/index.r.layout.js +74 -0
  109. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/TC/TC_03/index.js +98 -0
  110. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/TC/TC_03/index.r.layout.js +80 -0
  111. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/i18n/en-US.po +2 -0
  112. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/index.js +53 -0
  113. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/showcase/page/index.r.layout.js +75 -0
  114. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/.prettierrc.js +6 -0
  115. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/_package.json +17 -0
  116. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/app-side/index.js +47 -0
  117. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/app.js +17 -0
  118. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/app.json +55 -0
  119. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/assets/gt.r/add.png +0 -0
  120. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/assets/gt.r/delete.png +0 -0
  121. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/assets/gt.r/icon.png +0 -0
  122. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/assets/gt.s/add.png +0 -0
  123. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/assets/gt.s/delete.png +0 -0
  124. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/assets/gt.s/icon.png +0 -0
  125. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/global.d.ts +1 -0
  126. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/jsconfig.json +9 -0
  127. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/page/home/index.page.js +177 -0
  128. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/page/home/index.page.r.layout.js +112 -0
  129. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/page/home/index.page.s.layout.js +112 -0
  130. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/page/i18n/en-US.po +21 -0
  131. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/setting/i18n/en-US.po +5 -0
  132. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/setting/index.js +143 -0
  133. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/utils/constants.js +3 -0
  134. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/utils/fs.js +34 -0
  135. package/private-modules/zeppos-app-utils/dist/public/template/os4.0/app/todo-list/utils/index.js +38 -0
  136. package/private-modules/zeppos-app-utils/package.json +1 -1
@@ -0,0 +1,106 @@
1
+ import { align, text_style } from '@zos/ui';
2
+
3
+ export const TEXT_LAYOUT_INFO_STYLE = {
4
+ x: 0,
5
+ y: 60,
6
+ w: "100vw".toPixel(),
7
+ h: "120".toPixel(),
8
+ text: "flex layout information:",
9
+ color: 0x34e073,
10
+ align_h: align.CENTER_H,
11
+ align_v: align.TOP,
12
+ text_style: text_style.WRAP,
13
+ }
14
+
15
+ export const BUTTON_ROOT_CONTAINER_STYLE = {
16
+ "x": "10vw",
17
+ "y": "10vh",
18
+ "width": "80vw",
19
+ "height": "50vh"
20
+ }
21
+
22
+ export const BACKGROUND_FILL_STYLE = {
23
+ color: 0xFFFFFF,
24
+ alpha: 100,
25
+ layout: { "width": "100%", "height": "100%" },
26
+ }
27
+
28
+ export const GROUP_BUTTON_ROOT_STYLE = {
29
+ "display": "flex",
30
+ "flex-flow": "row wrap",
31
+ "column-gap": "20",
32
+ "row-gap": "10",
33
+ "justify-content": "start",
34
+ "align-items": "space-evenly",
35
+ "width": "100%",
36
+ "height": "100%",
37
+ "align-content": "center",
38
+ }
39
+
40
+ export const ORIGINAL_BUTTON_POS_STYLE = {
41
+ "width": "70",
42
+ "height": "40",
43
+ "radius": "2.5vw",
44
+ "font-size": "swdpi(25)",
45
+ }
46
+
47
+ export const ORINGAL_BUTTON_STYLE = {
48
+ press_color: 0x1976d2,
49
+ normal_color: 0x0000FF,
50
+ layout: ORIGINAL_BUTTON_POS_STYLE,
51
+ }
52
+
53
+ export const BIGGER_BUTTON_POS_STYLE = {
54
+ "width": "80",
55
+ "height": "60",
56
+ "radius": "2.6vw",
57
+ "font-size": "swdpi(25)",
58
+ }
59
+
60
+ export const BIGGER_BUTTON_STYLE = {
61
+ press_color: 0x1976d2,
62
+ normal_color: 0x0000FF,
63
+ layout: BIGGER_BUTTON_POS_STYLE,
64
+ }
65
+
66
+
67
+
68
+ export const TEST_BUTTON_ROOT_CONTAINER_STYLE = {
69
+ "x": "15vw",
70
+ "y": "60vh",
71
+ "width": "70vw",
72
+ "height": "35vh"
73
+ }
74
+
75
+ export const TEST_BUTTON_SUB_ROOT_CONTAINER_STYLE = {
76
+ "width": "100%",
77
+ "height": "100%",
78
+ "display": "flex",
79
+ "flex-flow": "row wrap",
80
+ "column-gap": "5",
81
+ "row-gap": "10",
82
+ "justify-content": "space-evenly",
83
+ "align-content": "start",
84
+ "align-items": "start",
85
+ "padding-top": "10",
86
+ }
87
+
88
+ export const TEST_BUTTON_ITEM_STYLE = {
89
+ layout: {
90
+ "width": "30%",
91
+ "height": "20%",
92
+ "radius": "2.6vw",
93
+ "font-size": "10",
94
+ },
95
+ press_src: "images/test/normalbtn_h.png",
96
+ normal_src: "images/test/normalbtn_n.png",
97
+ press_color: 0x1976d2,
98
+ normal_color: 0x0000FF,
99
+ }
100
+
101
+
102
+
103
+
104
+
105
+
106
+
@@ -0,0 +1,88 @@
1
+ import * as Styles from 'zosLoader:./index.[pf].layout.js'
2
+ import { createWidget, widget, updateLayout, dumpLayout, deleteWidget } from '@zos/ui';
3
+
4
+ var fill_rect_list = new Array(20);
5
+
6
+ Page({
7
+ build() {
8
+
9
+ let root_container = createWidget(widget.VIRTUAL_CONTAINER, { layout: Styles.FILL_RECT_ROOT_CONTAINER_STYLE });
10
+
11
+ createWidget(widget.FILL_RECT, { parent: root_container, ...Styles.BACKGROUND_FILL_STYLE });
12
+
13
+ let group_root = createWidget(widget.GROUP, {
14
+ parent: root_container,
15
+ layout: Styles.GROUP_FILL_RECT_ROOT_STYLE,
16
+ })
17
+
18
+ for (let i = 0; i < 5; i++) {
19
+ let fill_rect_widget = group_root.createWidget(widget.FILL_RECT, {
20
+ color: 0x0000FF,
21
+ layout: Styles.FILL_RECT_ITEM_STYLE,
22
+ });
23
+ fill_rect_list.push(fill_rect_widget);
24
+ }
25
+
26
+ var button_container = createWidget(widget.VIRTUAL_CONTAINER, {
27
+ layout: Styles.TEST_BUTTON_ROOT_CONTAINER_STYLE
28
+ });
29
+
30
+ createWidget(widget.FILL_RECT, {
31
+ parent: button_container,
32
+ ...Styles.BACKGROUND_FILL_STYLE,
33
+ color: 0x333333,
34
+ });
35
+
36
+ var button_sub_container = createWidget(widget.VIRTUAL_CONTAINER, {
37
+ parent: button_container,
38
+ layout: Styles.TEST_BUTTON_SUB_ROOT_CONTAINER_STYLE
39
+ });
40
+
41
+ createWidget(widget.BUTTON, {
42
+ parent: button_sub_container,
43
+ ...Styles.TEST_BUTTON_ITEM_STYLE,
44
+ text: "add widget",
45
+ click_func: () => {
46
+ let fill_rect_widget = group_root.createWidget(widget.FILL_RECT, {
47
+ color: 0x0000FF,
48
+ layout: Styles.FILL_RECT_ITEM_STYLE,
49
+ });
50
+ fill_rect_list.push(fill_rect_widget);
51
+ updateLayout();
52
+ },
53
+ });
54
+
55
+ createWidget(widget.BUTTON, {
56
+ parent: button_sub_container,
57
+ ...Styles.TEST_BUTTON_ITEM_STYLE,
58
+ text: "delete widget",
59
+ click_func: () => {
60
+ let fill_rect_widget = fill_rect_list.pop();
61
+ deleteWidget(fill_rect_widget);
62
+ updateLayout();
63
+ },
64
+ });
65
+
66
+ createWidget(widget.BUTTON, {
67
+ parent: button_sub_container,
68
+ ...Styles.TEST_BUTTON_ITEM_STYLE,
69
+ text: "zoom in",
70
+ click_func: () => {
71
+ root_container.updateLayoutStyle({ "x": "0", "y": "0", "width": "100vw", "height": "50vh" });
72
+ updateLayout(root_container);
73
+ },
74
+ });
75
+
76
+ createWidget(widget.BUTTON, {
77
+ parent: button_sub_container,
78
+ ...Styles.TEST_BUTTON_ITEM_STYLE,
79
+ text: "zoom out",
80
+ click_func: () => {
81
+ root_container.updateLayoutStyle({ "x": "20vw", "y": "10vh", "width": "60vw", "height": "25vh" });
82
+ updateLayout(root_container);
83
+ dumpLayout("layout.txt");
84
+ },
85
+ });
86
+ // updateLayout(); no need call by user when screen loadupdateLayout();
87
+ }
88
+ })
@@ -0,0 +1,74 @@
1
+ import { align, text_style } from '@zos/ui';
2
+
3
+
4
+
5
+ export const FILL_RECT_ROOT_CONTAINER_STYLE = {
6
+ "x": "10vw",
7
+ "y": "10vh",
8
+ "width": "80vw",
9
+ "height": "50vh"
10
+ }
11
+
12
+ export const BACKGROUND_FILL_STYLE = {
13
+ color: 0xFFFFFF,
14
+ layout: { "width": "100%", "height": "100%" },
15
+ }
16
+
17
+ export const GROUP_FILL_RECT_ROOT_STYLE = {
18
+ "display": "flex",
19
+ "flex-flow": "row wrap",
20
+ "column-gap": "20",
21
+ "row-gap": "10",
22
+ "justify-content": "start",
23
+ "align-items": "space-evenly",
24
+ "width": "100%",
25
+ "height": "100%",
26
+ "align-content": "center",
27
+ }
28
+
29
+ export const FILL_RECT_ITEM_STYLE = {
30
+ "width": "10%",
31
+ "height": "20%",
32
+ // "radius": "5.25vw",
33
+ "corner-radius": "10",
34
+ }
35
+
36
+ export const TEST_BUTTON_ROOT_CONTAINER_STYLE = {
37
+ "x": "15vw",
38
+ "y": "60vh",
39
+ "width": "70vw",
40
+ "height": "40vh"
41
+ }
42
+
43
+ export const TEST_BUTTON_SUB_ROOT_CONTAINER_STYLE = {
44
+ "width": "100%",
45
+ "height": "100%",
46
+ "display": "flex",
47
+ "flex-flow": "row wrap",
48
+ "column-gap": "5",
49
+ "row-gap": "10",
50
+ "justify-content": "space-evenly",
51
+ "align-content": "start",
52
+ "align-items": "start",
53
+ "padding-top": "10",
54
+ }
55
+
56
+ export const TEST_BUTTON_ITEM_STYLE = {
57
+ layout: {
58
+ "width": "35%",
59
+ "height": "20%",
60
+ "corner-radius": "3vw",
61
+ "font-size": "10",
62
+ },
63
+ press_src: "images/test/normalbtn_h.png",
64
+ normal_src: "images/test/normalbtn_n.png",
65
+ press_color: 0x1976d2,
66
+ normal_color: 0x0000FF,
67
+ }
68
+
69
+
70
+
71
+
72
+
73
+
74
+
@@ -0,0 +1,98 @@
1
+ import * as Styles from 'zosLoader:./index.[pf].layout.js'
2
+ import { createWidget, widget, updateLayout, dumpLayout, deleteWidget, align } from '@zos/ui';
3
+
4
+ var fill_rect_list = new Array(20);
5
+
6
+ Page({
7
+ build() {
8
+
9
+ let root_container = createWidget(widget.VIRTUAL_CONTAINER, { layout: Styles.FILL_RECT_ROOT_CONTAINER_STYLE });
10
+
11
+ createWidget(widget.FILL_RECT, { parent: root_container, ...Styles.BACKGROUND_FILL_STYLE });
12
+
13
+ let group_root = createWidget(widget.GROUP, {
14
+ parent: root_container,
15
+ layout: Styles.GROUP_FILL_RECT_ROOT_STYLE,
16
+ })
17
+
18
+ for (let i = 0; i < 5; i++) {
19
+ let fill_rect_widget = group_root.createWidget(widget.IMG, {
20
+ src: "images/icons/ic_moon.png",
21
+ layout: Styles.IMAGE_ITEM_STYLE,
22
+ });
23
+ fill_rect_list.push(fill_rect_widget);
24
+ }
25
+
26
+ for (let i = 0; i < 3; i++) {
27
+ let text_widget = group_root.createWidget(widget.TEXT, {
28
+ text: "hello zepp os",
29
+ color: 0x34e073,
30
+ align_v: align.CENTER_V,
31
+ layout: Styles.TEXT_ITEM_STYLE,
32
+ });
33
+ fill_rect_list.push(text_widget);
34
+ }
35
+
36
+ var button_container = createWidget(widget.VIRTUAL_CONTAINER, {
37
+ layout: Styles.TEST_BUTTON_ROOT_CONTAINER_STYLE
38
+ });
39
+
40
+ createWidget(widget.FILL_RECT, {
41
+ parent: button_container,
42
+ ...Styles.BACKGROUND_FILL_STYLE,
43
+ color: 0x333333,
44
+ });
45
+
46
+ var button_sub_container = createWidget(widget.VIRTUAL_CONTAINER, {
47
+ parent: button_container,
48
+ layout: Styles.TEST_BUTTON_SUB_ROOT_CONTAINER_STYLE
49
+ });
50
+
51
+ createWidget(widget.BUTTON, {
52
+ parent: button_sub_container,
53
+ ...Styles.TEST_BUTTON_ITEM_STYLE,
54
+ text: "add widget",
55
+ click_func: () => {
56
+ let img_widget = group_root.createWidget(widget.IMG, {
57
+ src: "images/icons/ic_moon.png",
58
+ layout: Styles.IMAGE_ITEM_STYLE,
59
+ });
60
+ fill_rect_list.push(img_widget);
61
+ updateLayout();
62
+ },
63
+ });
64
+
65
+ createWidget(widget.BUTTON, {
66
+ parent: button_sub_container,
67
+ ...Styles.TEST_BUTTON_ITEM_STYLE,
68
+ text: "delete widget",
69
+ click_func: () => {
70
+ let fill_rect_widget = fill_rect_list.pop();
71
+ deleteWidget(fill_rect_widget);
72
+ updateLayout();
73
+ },
74
+ });
75
+
76
+ createWidget(widget.BUTTON, {
77
+ parent: button_sub_container,
78
+ ...Styles.TEST_BUTTON_ITEM_STYLE,
79
+ text: "zoom in",
80
+ click_func: () => {
81
+ root_container.updateLayoutStyle({ "x": "0", "y": "0", "width": "100vw", "height": "50vh" });
82
+ updateLayout(root_container);
83
+ },
84
+ });
85
+
86
+ createWidget(widget.BUTTON, {
87
+ parent: button_sub_container,
88
+ ...Styles.TEST_BUTTON_ITEM_STYLE,
89
+ text: "zoom out",
90
+ click_func: () => {
91
+ root_container.updateLayoutStyle({ "x": "20vw", "y": "10vh", "width": "60vw", "height": "25vh" });
92
+ updateLayout(root_container);
93
+ dumpLayout("layout.txt");
94
+ },
95
+ });
96
+ // updateLayout(); no need call by user when screen load updateLayout();
97
+ }
98
+ })
@@ -0,0 +1,80 @@
1
+ import { align, text_style } from '@zos/ui';
2
+
3
+
4
+
5
+ export const FILL_RECT_ROOT_CONTAINER_STYLE = {
6
+ "x": "10vw",
7
+ "y": "10vh",
8
+ "width": "80vw",
9
+ "height": "50vh"
10
+ }
11
+
12
+ export const BACKGROUND_FILL_STYLE = {
13
+ color: 0xFFFFFF,
14
+ layout: { "width": "100%", "height": "100%" },
15
+ }
16
+
17
+ export const GROUP_FILL_RECT_ROOT_STYLE = {
18
+ "display": "flex",
19
+ "flex-flow": "row wrap",
20
+ "column-gap": "20",
21
+ "row-gap": "10",
22
+ "justify-content": "start",
23
+ "align-items": "space-evenly",
24
+ "width": "100%",
25
+ "height": "100%",
26
+ "align-content": "center",
27
+ }
28
+
29
+ export const IMAGE_ITEM_STYLE = {
30
+ "width": "15%",
31
+ "height": "25%",
32
+ // "radius": "5.25vw",
33
+ // "corner-radius": "10",
34
+ }
35
+
36
+ export const TEXT_ITEM_STYLE = {
37
+ "width": "30%",
38
+ "height": "25%",
39
+ "font-size": "15",
40
+ }
41
+
42
+ export const TEST_BUTTON_ROOT_CONTAINER_STYLE = {
43
+ "x": "15vw",
44
+ "y": "60vh",
45
+ "width": "70vw",
46
+ "height": "40vh"
47
+ }
48
+
49
+ export const TEST_BUTTON_SUB_ROOT_CONTAINER_STYLE = {
50
+ "width": "100%",
51
+ "height": "100%",
52
+ "display": "flex",
53
+ "flex-flow": "row wrap",
54
+ "column-gap": "5",
55
+ "row-gap": "10",
56
+ "justify-content": "space-evenly",
57
+ "align-content": "start",
58
+ "align-items": "start",
59
+ "padding-top": "10",
60
+ }
61
+
62
+ export const TEST_BUTTON_ITEM_STYLE = {
63
+ layout: {
64
+ "width": "35%",
65
+ "height": "20%",
66
+ "corner-radius": "3vw",
67
+ "font-size": "10",
68
+ },
69
+ press_src: "images/test/normalbtn_h.png",
70
+ normal_src: "images/test/normalbtn_n.png",
71
+ press_color: 0x1976d2,
72
+ normal_color: 0x0000FF,
73
+ }
74
+
75
+
76
+
77
+
78
+
79
+
80
+
@@ -0,0 +1,2 @@
1
+ msgid "example"
2
+ msgstr "This is an example in device"
@@ -0,0 +1,53 @@
1
+ import * as Styles from 'zosLoader:./index.[pf].layout.js'
2
+ import { createWidget, widget, updateLayout } from '@zos/ui';
3
+ import { push, exit, replace, } from '@zos/router';
4
+ import { sysUIFocusIsEnable } from './index.r.layout';
5
+
6
+ const page_list = [
7
+ { name: "4.0 Flex Layout" },
8
+ { number: "01", name: "Functional Test" },
9
+ { number: "02", name: "FillRect & Button" },
10
+ { number: "03", name: "Text & Image" },
11
+ ]
12
+
13
+ let common_focus_flag = false;
14
+
15
+ Page({
16
+
17
+ state: {
18
+ scroll_list
19
+ },
20
+ build() {
21
+ if (sysUIFocusIsEnable) {
22
+ common_focus_flag = true;
23
+ }
24
+ this.state.scroll_list = createWidget(widget.SCROLL_LIST, {
25
+ ...Styles.SCROLL_LIST_CONFIG_STYLE,
26
+ data_array: page_list,
27
+ data_count: page_list.length,
28
+ item_common_focus: common_focus_flag,
29
+ data_type_config: [
30
+ {
31
+ start: 0,
32
+ end: 0,
33
+ type_id: 0,
34
+ },
35
+ {
36
+ start: 1,
37
+ end: page_list.length - 1,
38
+ type_id: 1,
39
+ },
40
+ ],
41
+ data_type_config_count: 2,
42
+ item_click_func: (list, index, data_key) => {
43
+ if (index > 0) {
44
+ push({
45
+ url: "page/TC/TC_" + String(index).padStart(2, '0') + "/index"
46
+ });
47
+ }
48
+
49
+ },
50
+ });
51
+ // updateLayout(); no need call by user when screen load
52
+ }
53
+ })
@@ -0,0 +1,75 @@
1
+ import { SCROLL_LIST, align } from '@zos/ui';
2
+ import { getDeviceInfo, SCREEN_SHAPE_SQUARE } from '@zos/device';
3
+
4
+ export const SCROLL_LIST_POS_STYLE = {
5
+ layout: {
6
+ "x": "10vw",
7
+ "y": "0",
8
+ "width": "80vw",
9
+ "height": "100vh",
10
+ }
11
+ }
12
+
13
+ export const SCROLL_LIST_CONFIG_STYLE = {
14
+ ...SCROLL_LIST_POS_STYLE,
15
+ item_space: "8".toPixel(),
16
+ snap_type: SCROLL_LIST.snap_type.SNAPCENTER_EXCEPTTITLE,
17
+ enable_scroll_bar: true,
18
+ item_config: [
19
+ {
20
+ type_id: 0,
21
+ item_bg_color: 0x00000,
22
+ item_bg_radius: 0,
23
+ text_view: [{
24
+ x: "10vw".toPixel(),
25
+ y: 0,
26
+ w: "60vw".toPixel(),
27
+ h: "180".toPixel(),
28
+ key: "name",
29
+ color: 0xFFFFFF,
30
+ text_size: "45".toPixel(),
31
+ align_h: align.CENTER_H,
32
+ align_v: align.CENTER_V,
33
+ },],
34
+ text_view_count: 1,
35
+ item_height: "180".toPixel(),
36
+ },
37
+ {
38
+ type_id: 1,
39
+ item_bg_color: 0x383838,
40
+ item_bg_radius: 20,
41
+ item_press_effect: true,
42
+ text_view: [
43
+ {
44
+ x: 0,
45
+ y: 0,
46
+ w: "10vw".toPixel(),
47
+ h: "80".toPixel(),
48
+ key: "number",
49
+ color: 0xFFFFFF,
50
+ text_size: "20".toPixel(),
51
+ action: true,
52
+ align_h: align.CENTER_H,
53
+ align_v: align.CENTER_V,
54
+ },
55
+ {
56
+ x: "10vw".toPixel(),
57
+ y: 0,
58
+ w: "70vw".toPixel(),
59
+ h: "80".toPixel(),
60
+ key: "name",
61
+ color: 0xFFFFFF,
62
+ text_size: "20".toPixel(),
63
+ action: true,
64
+ },
65
+ ],
66
+ text_view_count: 2,
67
+ item_height: "80".toPixel(),
68
+ }
69
+
70
+ ],
71
+ item_config_count: 2,
72
+ }
73
+
74
+ export const sysUIFocusIsEnable = ((getDeviceInfo().keyType.indexOf('sport') !== -1) || (getDeviceInfo().keyNumber === 4));
75
+ export const sysScreenIsSquare = (getDeviceInfo().screenShape == SCREEN_SHAPE_SQUARE)
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ printWidth: 100,
3
+ semi: false,
4
+ singleQuote: true,
5
+ trailingComma: 'none'
6
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "todolist",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "app.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC",
11
+ "devDependencies": {
12
+ "@zeppos/device-types": "^3.0.0"
13
+ },
14
+ "dependencies": {
15
+ "@zeppos/zml": "^0.0.38"
16
+ }
17
+ }
@@ -0,0 +1,47 @@
1
+ import { BaseSideService } from '@zeppos/zml/base-side'
2
+ import { settingsLib } from '@zeppos/zml/base-side'
3
+
4
+ import { DEFAULT_TODO_LIST } from './../utils/constants'
5
+
6
+ function getTodoList() {
7
+ return settingsLib.getItem('todoList')
8
+ ? JSON.parse(settingsLib.getItem('todoList'))
9
+ : [...DEFAULT_TODO_LIST]
10
+ }
11
+ AppSideService(
12
+ BaseSideService({
13
+ onInit() {},
14
+ onRequest(req, res) {
15
+ if (req.method === 'GET_TODO_LIST') {
16
+ res(null, {
17
+ result: getTodoList()
18
+ })
19
+ } else if (req.method === 'ADD') {
20
+ // 这里补充一个
21
+ const todoList = getTodoList()
22
+ const newTodoList = [...todoList, String(Math.floor(Math.random() * 100))]
23
+ settingsLib.setItem('todoList', JSON.stringify(newTodoList))
24
+
25
+ res(null, {
26
+ result: newTodoList
27
+ })
28
+ } else if (req.method === 'DELETE') {
29
+ const { index } = req.params
30
+ const todoList = getTodoList()
31
+ const newTodoList = todoList.filter((_, i) => i !== index)
32
+ settingsLib.setItem('todoList', JSON.stringify(newTodoList))
33
+
34
+ res(null, {
35
+ result: newTodoList
36
+ })
37
+ }
38
+ },
39
+ onSettingsChange({ key, newValue, oldValue }) {
40
+ this.call({
41
+ result: getTodoList()
42
+ })
43
+ },
44
+ onRun() {},
45
+ onDestroy() {}
46
+ })
47
+ )
@@ -0,0 +1,17 @@
1
+ import { BaseApp } from '@zeppos/zml/base-app'
2
+ import { log as Logger } from '@zos/utils'
3
+
4
+ const logger = Logger.getLogger('todo-list-app')
5
+
6
+ App(
7
+ BaseApp({
8
+ globalData: {},
9
+ onCreate() {
10
+ logger.log('app onCreate invoked')
11
+ },
12
+
13
+ onDestroy() {
14
+ logger.log('app onDestroy invoked')
15
+ }
16
+ })
17
+ )