dana-cli 0.0.0-stage → 0.0.25
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.
- package/.github/dependabot.yml +43 -0
- package/.github/labeler.yml +30 -0
- package/.github/workflows/bump.yml +51 -0
- package/.github/workflows/ci-cd.yml +110 -0
- package/.github/workflows/dependabot-automerge-call.yml +13 -0
- package/.nvmrc +1 -0
- package/.prettierignore +4 -0
- package/.prettierrc +4 -0
- package/CODEOWNERS +5 -0
- package/README.md +50 -2
- package/bin/bump.js +48 -0
- package/eslint.config.mjs +12 -0
- package/images/vodScreen1.png +0 -0
- package/package.json +53 -5
- package/sonar-project.properties +20 -0
- package/tools/cli/README.md +51 -0
- package/tools/cli/__mocks__/fs/promises.cjs +4 -0
- package/tools/cli/bin/dana.js +3 -0
- package/tools/cli/dana_completion.sh +156 -0
- package/tools/cli/eslint.config.mjs +14 -0
- package/tools/cli/package.json +66 -0
- package/tools/cli/rollup.config.mjs +26 -0
- package/tools/cli/src/commands/addComponent/addMenu/add-menu.ts +65 -0
- package/tools/cli/src/commands/addComponent/addMenu/addMenuDefinition.ts +21 -0
- package/tools/cli/src/commands/addComponent/addRail/add-rail.ts +59 -0
- package/tools/cli/src/commands/addComponent/addRail/addRailDefinition.ts +34 -0
- package/tools/cli/src/commands/addComponent/addScreen/add-screen.ts +42 -0
- package/tools/cli/src/commands/addComponent/addScreen/addScreenDefinition.ts +17 -0
- package/tools/cli/src/commands/addComponent/addScrollView/add-scrollView.ts +48 -0
- package/tools/cli/src/commands/addComponent/addScrollView/addScrollViewDefinition.ts +16 -0
- package/tools/cli/src/commands/addComponent/config/ComponentConfig.ts +169 -0
- package/tools/cli/src/commands/addComponent/config/componentTypes.ts +38 -0
- package/tools/cli/src/commands/addComponent/const/componentConst.ts +20 -0
- package/tools/cli/src/commands/addComponent/const/defaultConfig.ts +28 -0
- package/tools/cli/src/commands/addComponent/const/navigationConst.ts +36 -0
- package/tools/cli/src/commands/addComponent/createComponent.ts +45 -0
- package/tools/cli/src/commands/addComponent/helper/ComponentHelper.ts +98 -0
- package/tools/cli/src/commands/addDevice/add-device.ts +106 -0
- package/tools/cli/src/commands/addDevice/addDeviceDefinition.ts +13 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/androidtvConfig.ts +142 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/configTypes.ts +44 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/deviceConfig.ts +38 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/titanosConfig.ts +17 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/tizenConfig.ts +64 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/tvosConfig.ts +50 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/vidaaConfig.ts +17 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/webosConfig.ts +64 -0
- package/tools/cli/src/commands/addDevice/helper/addDeviceHelper.ts +121 -0
- package/tools/cli/src/commands/addDianaSkills/add-dianaSkills.ts +55 -0
- package/tools/cli/src/commands/addDianaSkills/addDianaSkillsDefinition.ts +13 -0
- package/tools/cli/src/commands/addDianaSkills/dianaDependencies.ts +15 -0
- package/tools/cli/src/commands/addModule/add-module.ts +46 -0
- package/tools/cli/src/commands/addModule/addModuleDefinition.ts +17 -0
- package/tools/cli/src/commands/addModule/moduleConst.ts +18 -0
- package/tools/cli/src/commands/authentication/AuthenticationManager.ts +255 -0
- package/tools/cli/src/commands/authentication/authDefinition.ts +51 -0
- package/tools/cli/src/commands/authentication/authHook.ts +50 -0
- package/tools/cli/src/commands/authentication/authentConst.ts +6 -0
- package/tools/cli/src/commands/authentication/commands/get-packages-token.ts +40 -0
- package/tools/cli/src/commands/authentication/commands/login.ts +63 -0
- package/tools/cli/src/commands/authentication/commands/logout.ts +26 -0
- package/tools/cli/src/commands/authentication/commands/status.ts +47 -0
- package/tools/cli/src/commands/authentication/helper/CodeArtifactHelper.ts +66 -0
- package/tools/cli/src/commands/authentication/helper/CommandHelper.ts +9 -0
- package/tools/cli/src/commands/authentication/helper/CredentialsHelper.ts +176 -0
- package/tools/cli/src/commands/authentication/helper/SPM.ts +95 -0
- package/tools/cli/src/commands/authentication/tokenHook.ts +30 -0
- package/tools/cli/src/commands/commandHelp/customHelp.ts +31 -0
- package/tools/cli/src/commands/completion/completion.ts +53 -0
- package/tools/cli/src/commands/completion/completionDefinition.ts +16 -0
- package/tools/cli/src/commands/createApp/const/createAppTasks.ts +133 -0
- package/tools/cli/src/commands/createApp/const/setupConst.ts +16 -0
- package/tools/cli/src/commands/createApp/const/templateConst.ts +10 -0
- package/tools/cli/src/commands/createApp/createApp.ts +60 -0
- package/tools/cli/src/commands/createApp/createAppDefinition.ts +26 -0
- package/tools/cli/src/commands/createApp/helpers/CreateAppHelper.ts +167 -0
- package/tools/cli/src/commands/createApp/helpers/SetupChecker.ts +98 -0
- package/tools/cli/src/commands/hooks/checkDanaProjectHook.ts +30 -0
- package/tools/cli/src/commands/zip/zip.ts +26 -0
- package/tools/cli/src/commands/zip/zipDefinition.ts +13 -0
- package/tools/cli/src/common/commonConst.ts +1 -0
- package/tools/cli/src/common/const/deviceConst.ts +110 -0
- package/tools/cli/src/common/const/exitCodeConst.ts +12 -0
- package/tools/cli/src/common/helpers/CreateArchiveHelper.ts +55 -0
- package/tools/cli/src/common/helpers/CreateFileHelper.ts +199 -0
- package/tools/cli/src/common/helpers/InputValidator.ts +58 -0
- package/tools/cli/src/common/helpers/InstallHelper.ts +202 -0
- package/tools/cli/src/common/helpers/UpdateFileHelper.ts +239 -0
- package/tools/cli/src/common/helpers/UserInputGetter.ts +145 -0
- package/tools/cli/src/common/helpers/handlebarsHelper.ts +31 -0
- package/tools/cli/src/common/helpers/stringHelper.ts +25 -0
- package/tools/cli/src/common/translation/en.json +87 -0
- package/tools/cli/src/common/translation/translation.ts +6 -0
- package/tools/cli/src/common/types/helperTypes.ts +79 -0
- package/tools/cli/src/index.ts +16 -0
- package/tools/cli/src/program.ts +59 -0
- package/tools/cli/tests/commands/addComponent/addMenu/add-menu.test.ts +96 -0
- package/tools/cli/tests/commands/addComponent/addRail/add-rail.test.ts +57 -0
- package/tools/cli/tests/commands/addComponent/addScreen/add-screen.test.ts +55 -0
- package/tools/cli/tests/commands/addComponent/addScrollView/add-scrollView.test.ts +89 -0
- package/tools/cli/tests/commands/addComponent/config/ComponentConfig.test.ts +261 -0
- package/tools/cli/tests/commands/addComponent/createComponent.test.ts +87 -0
- package/tools/cli/tests/commands/addComponent/helper/ComponentHelper.test.ts +110 -0
- package/tools/cli/tests/commands/addDevice/add-device.test.ts +117 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/androidtvConfig.test.ts +184 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/deviceConfig.test.ts +30 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/titanosConfig.test.ts +20 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/tizenConfig.test.ts +63 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/tvosConfig.test.ts +47 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/vidaaConfig.test.ts +20 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/webosConfig.test.ts +74 -0
- package/tools/cli/tests/commands/addDevice/helper/addDeviceHelper.test.ts +144 -0
- package/tools/cli/tests/commands/addDianaSkills/add-dianaSkills.test.ts +72 -0
- package/tools/cli/tests/commands/addModule/add-module.test.ts +108 -0
- package/tools/cli/tests/commands/authentication/AuthenticationManager.test.ts +756 -0
- package/tools/cli/tests/commands/authentication/commands/authDefinition.test.ts +53 -0
- package/tools/cli/tests/commands/authentication/commands/authHook.test.ts +94 -0
- package/tools/cli/tests/commands/authentication/commands/get-packages-token.test.ts +69 -0
- package/tools/cli/tests/commands/authentication/commands/login.test.ts +170 -0
- package/tools/cli/tests/commands/authentication/commands/logout.test.ts +77 -0
- package/tools/cli/tests/commands/authentication/commands/status.test.ts +73 -0
- package/tools/cli/tests/commands/authentication/helper/CredentialsHelper.test.ts +352 -0
- package/tools/cli/tests/commands/authentication/helper/SPM.test.ts +229 -0
- package/tools/cli/tests/commands/cliHelp/customHelp.test.ts +24 -0
- package/tools/cli/tests/commands/completion/completion.test.ts +76 -0
- package/tools/cli/tests/commands/createApp/const/createAppTasks.test.ts +70 -0
- package/tools/cli/tests/commands/createApp/createApp.test.ts +116 -0
- package/tools/cli/tests/commands/createApp/helpers/CreateAppHelper.test.ts +197 -0
- package/tools/cli/tests/commands/createApp/helpers/SetupChecker.test.ts +152 -0
- package/tools/cli/tests/commands/createApp/helpers/fixtures/myApp/scripts/app/ui/screens/SplashScreen.js +70 -0
- package/tools/cli/tests/commands/hooks/checkDanaProjectHook.test.ts +55 -0
- package/tools/cli/tests/commands/zip/zip.test.ts +51 -0
- package/tools/cli/tests/common/helpers/CreateArchiveHelper.test.ts +69 -0
- package/tools/cli/tests/common/helpers/CreateFileHelper.test.ts +359 -0
- package/tools/cli/tests/common/helpers/InputValidator.test.ts +93 -0
- package/tools/cli/tests/common/helpers/InstallHelper.test.ts +262 -0
- package/tools/cli/tests/common/helpers/UpdateFileHelper.test.ts +288 -0
- package/tools/cli/tests/common/helpers/UserInputGetter.test.ts +182 -0
- package/tools/cli/tests/common/helpers/handlebarsHelper.test.ts +87 -0
- package/tools/cli/tests/common/helpers/stringHelper.test.ts +35 -0
- package/tools/cli/tests/program.test.ts +215 -0
- package/tools/cli/tsconfig.json +19 -0
- package/tools/cli/tsconfig.test.json +4 -0
- package/tools/cli/vitest.config.ts +4 -0
- package/tools/templates/app-template/.dana/.gitkeep +0 -0
- package/tools/templates/app-template/Gruntfile.js +31 -0
- package/tools/templates/app-template/README.md +17 -0
- package/tools/templates/app-template/app.config.json +56 -0
- package/tools/templates/app-template/editorconfigTemplate.hbs +18 -0
- package/tools/templates/app-template/eslintrc.jsonTemplate.hbs +5 -0
- package/tools/templates/app-template/gitignoreTemplate.hbs +27 -0
- package/tools/templates/app-template/i18n/LocaleStringEnUS.json +7 -0
- package/tools/templates/app-template/i18n/README.md +32 -0
- package/tools/templates/app-template/images/dana.png +0 -0
- package/tools/templates/app-template/images/dana_logo.png +0 -0
- package/tools/templates/app-template/images/dana_logo_light.png +0 -0
- package/tools/templates/app-template/images/loading.png +0 -0
- package/tools/templates/app-template/nvmrcTemplate.hbs +1 -0
- package/tools/templates/app-template/package.json +33 -0
- package/tools/templates/app-template/profiles/app.config.browser-css.json +16 -0
- package/tools/templates/app-template/profiles/app.config.browser-lightning.json +16 -0
- package/tools/templates/app-template/scripts/app/README.md +6 -0
- package/tools/templates/app-template/scripts/app/TemplateAppRoutes.js.hbs +18 -0
- package/tools/templates/app-template/scripts/app/app.js.hbs +17 -0
- package/tools/templates/app-template/scripts/app/theme/AppTheme.js +57 -0
- package/tools/templates/app-template/scripts/app/ui/screens/AppScreen.js +106 -0
- package/tools/templates/app-template/scripts/app/ui/screens/SplashScreen.js +70 -0
- package/tools/templates/app-template/scripts/app/ui/views/LoaderView.js +31 -0
- package/tools/templates/app-template/styles/fonts/Roboto-Bold.ttf +0 -0
- package/tools/templates/app-template/styles/fonts/Roboto-Regular.ttf +0 -0
- package/tools/templates/app-template/tests/README.md +70 -0
- package/tools/templates/app-template/tests/automation/features/splash.feature +5 -0
- package/tools/templates/app-template/tests/automation/init.js +20 -0
- package/tools/templates/app-template/tests/automation/steps-definitions/dictionary.js +31 -0
- package/tools/templates/app-template/tests/automation/steps-definitions/helpers.js +9 -0
- package/tools/templates/app-template/tests/unit/README.md +7 -0
- package/tools/templates/app-template/tests/unit/app/TemplateAppRoutes.js.hbs +24 -0
- package/tools/templates/assets/fonts/fa-solid-900.ttf +0 -0
- package/tools/templates/components/ButtonItemView.js.hbs +69 -0
- package/tools/templates/components/ButtonView.js.hbs +65 -0
- package/tools/templates/components/ScrollItemView.js.hbs +53 -0
- package/tools/templates/components/ScrollView.js.hbs +43 -0
- package/tools/templates/components/TileView.js.hbs +55 -0
- package/tools/templates/components/screen.js.hbs +74 -0
- package/tools/templates/components/settings.js.hbs +74 -0
- package/tools/templates/components/vod.js.hbs +104 -0
- package/tools/templates/components/wtvMenuListView.js.hbs +38 -0
- package/tools/templates/components/wtvRailListView.js.hbs +44 -0
- package/tools/templates/index.ts +3 -0
- package/tools/templates/mocks/menuMock.json +29 -0
- package/tools/templates/mocks/railMock.json +101 -0
- package/tools/templates/mocks/scrollViewMock.json +165 -0
- package/tools/templates/modules/fip/images/12.png +0 -0
- package/tools/templates/modules/fip/images/audioD.png +0 -0
- package/tools/templates/modules/fip/package.json +5 -0
- package/tools/templates/modules/fip/scripts/FipModule.js +19 -0
- package/tools/templates/modules/fip/scripts/FipRoutes.js +19 -0
- package/tools/templates/modules/fip/scripts/services/mock/fipMock.json +12 -0
- package/tools/templates/modules/fip/scripts/ui/screens/FipScreen.js +169 -0
- package/tools/templates/modules/fip/scripts/ui/views/FipContentInfoView.js +77 -0
- package/tools/templates/modules/fip/scripts/ui/views/InfoDetailImageView.js +35 -0
- package/tools/templates/modules/fip/scripts/ui/views/InfoDetailTextView.js +39 -0
- package/tools/templates/modules/fip/scripts/ui/views/InfoListView.js +57 -0
- package/tools/templates/modules/fip/scripts/ui/views/PlayButtonView.js +63 -0
- package/tools/templates/modules/home/package.json +5 -0
- package/tools/templates/modules/home/scripts/HomeModule.js +19 -0
- package/tools/templates/modules/home/scripts/HomeRoutes.js +19 -0
- package/tools/templates/modules/home/scripts/services/mock/highlightMock.json +40 -0
- package/tools/templates/modules/home/scripts/services/mock/homeScrollViewMock.json +170 -0
- package/tools/templates/modules/home/scripts/ui/screens/HomeScreen.js +258 -0
- package/tools/templates/modules/home/scripts/ui/views/highlight/DotsListItemView.js +37 -0
- package/tools/templates/modules/home/scripts/ui/views/highlight/DotsListView.js +22 -0
- package/tools/templates/modules/home/scripts/ui/views/highlight/HighlightContentDescriptionView.js +99 -0
- package/tools/templates/modules/home/scripts/ui/views/highlight/HighlightPlayButtonView.js +63 -0
- package/tools/templates/modules/home/scripts/ui/views/highlight/HighlightRailItemView.js +186 -0
- package/tools/templates/modules/home/scripts/ui/views/scrollview/HomeMockTileView.js +67 -0
- package/tools/templates/modules/home/scripts/ui/views/scrollview/HomeRailScrollView.js +53 -0
- package/tools/templates/modules/home/scripts/ui/views/scrollview/HomeScrollView.js +22 -0
- package/tools/templates/modules/menu/images/profile.png +0 -0
- package/tools/templates/modules/menu/package.json +5 -0
- package/tools/templates/modules/menu/scripts/MenuModule.js +18 -0
- package/tools/templates/modules/menu/scripts/MenuRoutes.js +14 -0
- package/tools/templates/modules/menu/scripts/services/menuMock.json +24 -0
- package/tools/templates/modules/menu/scripts/ui/const/MenuIcons.js +16 -0
- package/tools/templates/modules/menu/scripts/ui/views/MenuButtonView.js +101 -0
- package/tools/templates/modules/menu/scripts/ui/views/MenuListView.js +60 -0
- package/tools/templates/modules/menu/scripts/ui/views/MenuView.js +87 -0
- package/tools/templates/modules/menu/scripts/ui/views/ProfileImageView.js +30 -0
- package/tools/templates/modules/player/package.json +5 -0
- package/tools/templates/modules/player/scripts/PlayerModule.js +19 -0
- package/tools/templates/modules/player/scripts/PlayerRoutes.js +19 -0
- package/tools/templates/modules/player/scripts/ui/const/PlayerIcons.js +19 -0
- package/tools/templates/modules/player/scripts/ui/screens/PlayerScreen.js +361 -0
- package/tools/templates/modules/player/scripts/ui/views/PlayerControlButtonView.js +69 -0
- package/tools/templates/modules/player/scripts/ui/views/PlayerControlsView.js +173 -0
- package/tools/templates/modules/player/scripts/ui/views/ProgressBarView.js +53 -0
- package/tools/templates/modules/search/package.json +5 -0
- package/tools/templates/modules/search/scripts/SearchModule.js +18 -0
- package/tools/templates/modules/search/scripts/SearchRoutes.js +16 -0
- package/tools/templates/modules/search/scripts/ui/const/EnglishKeyboardData.js +31 -0
- package/tools/templates/modules/search/scripts/ui/const/SearchIcons.js +14 -0
- package/tools/templates/modules/search/scripts/ui/const/SearchKeyboardLayout.js +19 -0
- package/tools/templates/modules/search/scripts/ui/primitives/SearchTextPrimitive.js +36 -0
- package/tools/templates/modules/search/scripts/ui/screens/SearchScreen.js +234 -0
- package/tools/templates/modules/search/scripts/ui/services/MockSearchService.js +39 -0
- package/tools/templates/modules/search/scripts/ui/services/SearchVirtualKeyboardService.js +33 -0
- package/tools/templates/modules/search/scripts/ui/services/mock/searchMock.json +172 -0
- package/tools/templates/modules/search/scripts/ui/views/SearchView.js +62 -0
- package/tools/templates/modules/search/scripts/ui/views/keyboard/SearchKeyboardRowItemView.js +92 -0
- package/tools/templates/modules/search/scripts/ui/views/keyboard/SearchKeyboardRowListView.js +33 -0
- package/tools/templates/modules/search/scripts/ui/views/keyboard/SearchKeyboardView.js +63 -0
- package/tools/templates/modules/search/scripts/ui/views/rail/SearchScrollRailView.js +53 -0
- package/tools/templates/modules/search/scripts/ui/views/rail/SearchScrollView.js +22 -0
- package/tools/templates/modules/search/scripts/ui/views/rail/SearchTileView.js +68 -0
- package/tools/templates/modules/search/styles/styles/fonts/fa-solid-900.ttf +0 -0
- package/tools/templates/modules/settings/package.json +5 -0
- package/tools/templates/modules/settings/scripts/SettingsModule.js +19 -0
- package/tools/templates/modules/settings/scripts/SettingsRoutes.js +19 -0
- package/tools/templates/modules/settings/scripts/ui/screens/SettingsScreen.js +200 -0
- package/tools/templates/modules/settings/scripts/ui/views/SettingsListItemView.js +85 -0
- package/tools/templates/modules/settings/scripts/ui/views/SettingsListView.js +56 -0
- package/tools/templates/modules/vod/package.json +5 -0
- package/tools/templates/modules/vod/scripts/VodModule.js +19 -0
- package/tools/templates/modules/vod/scripts/VodRoutes.js +19 -0
- package/tools/templates/modules/vod/scripts/services/mock/scrollViewMock.json +172 -0
- package/tools/templates/modules/vod/scripts/ui/screens/VodScreen.js +204 -0
- package/tools/templates/modules/vod/scripts/ui/views/MockTileView.js +69 -0
- package/tools/templates/modules/vod/scripts/ui/views/RailScrollItemView.js +53 -0
- package/tools/templates/modules/vod/scripts/ui/views/VodScrollView.js +22 -0
- package/tools/templates/package.json +14 -0
- package/tools/templates/profiles/app.config.androidtv.json +17 -0
- package/tools/templates/profiles/app.config.titanos.json +24 -0
- package/tools/templates/profiles/app.config.tizen.json +52 -0
- package/tools/templates/profiles/app.config.tvos.json +18 -0
- package/tools/templates/profiles/app.config.vidaa.json +24 -0
- package/tools/templates/profiles/app.config.webos.json +21 -0
- package/tools/templates/tutorial/modules/fip/package.json +4 -0
- package/tools/templates/tutorial/modules/fip/scripts/FipModule.js +18 -0
- package/tools/templates/tutorial/modules/fip/scripts/FipRoutes.js +19 -0
- package/tools/templates/tutorial/modules/fip/scripts/ui/screens/FipContentScreen.js +146 -0
- package/tools/templates/tutorial/modules/fip/scripts/ui/views/ElevatorView.js +66 -0
- package/tools/templates/tutorial/modules/fip/scripts/ui/views/FipContentInfoView.js +90 -0
- package/tools/templates/tutorial/modules/fip/scripts/ui/views/PlayButtonView.js +58 -0
- package/tools/templates/tutorial/vendors/customBE/package.json +5 -0
- package/tools/templates/tutorial/vendors/customBE/scripts/datas/contents.json +749 -0
- package/tools/templates/tutorial/vendors/customBE/scripts/services/CustomBEVodService.js +70 -0
- package/tsconfig.json +8 -0
- package/vitest.config.ts +19 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import $AbstractKeyboardRowItemView from "@AbstractKeyboardRowItemView";
|
|
2
|
+
|
|
3
|
+
import $TextPrimitive from "@TextPrimitive";
|
|
4
|
+
import $RectanglePrimitive from "@RectanglePrimitive";
|
|
5
|
+
// CONST
|
|
6
|
+
import $Theme from "@Theme";
|
|
7
|
+
import $TextAlign from "@TextAlign";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Search implementation of a cell in the virtual keyboard
|
|
11
|
+
*
|
|
12
|
+
* @name SearchKeyboardRowItemView
|
|
13
|
+
* @class
|
|
14
|
+
* @extends AbstractKeyboardRowItemView
|
|
15
|
+
*/
|
|
16
|
+
export default $AbstractKeyboardRowItemView.declare("SearchKeyboardRowItemView", {
|
|
17
|
+
statics: /** @lends DefaultKeyboardRowItemView */ {
|
|
18
|
+
ITEM_WIDTH: 64,
|
|
19
|
+
ITEM_HEIGHT: 31,
|
|
20
|
+
ITEM_MARGIN: 8,
|
|
21
|
+
KB_CELL_WIDTH: 64,
|
|
22
|
+
KB_CELL_HEIGHT: 40,
|
|
23
|
+
KB_CELL_MARGIN: 8
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
children: /** @lends SearchKeyboardRowItemView.prototype */ {
|
|
27
|
+
background: {
|
|
28
|
+
class: $RectanglePrimitive
|
|
29
|
+
},
|
|
30
|
+
label: {
|
|
31
|
+
class: $TextPrimitive,
|
|
32
|
+
text: ({parent}) => {
|
|
33
|
+
if (parent.data != null) {
|
|
34
|
+
if (parent.data.char != null) {
|
|
35
|
+
return parent.data.char;
|
|
36
|
+
} else {
|
|
37
|
+
return "";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return "";
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
icon: {
|
|
44
|
+
class: $TextPrimitive,
|
|
45
|
+
text: ({parent}) => {
|
|
46
|
+
if (parent.data != null) {
|
|
47
|
+
if (parent.data.icon != null) {
|
|
48
|
+
return parent.data.icon;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return "";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
states: {
|
|
57
|
+
focused: {
|
|
58
|
+
"background.fillColor": $Theme.COLOR_ACCENT,
|
|
59
|
+
"label.color": $Theme.COLOR_BACKGROUND
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
style: /** @lends DefaultKeyboardRowItemView.prototype */ {
|
|
64
|
+
width: ({data, statics}) => statics.KB_CELL_WIDTH * ((data && data.ratio) || 1) + (((data && data.ratio) || 1) - 1) * statics.KB_CELL_MARGIN,
|
|
65
|
+
height: ({statics}) => statics.KB_CELL_HEIGHT,
|
|
66
|
+
background: {
|
|
67
|
+
height: ({parent}) => parent.statics.KB_CELL_HEIGHT,
|
|
68
|
+
width: ({parent}) => parent.width,
|
|
69
|
+
fillColor: $Theme.COLOR_BACKGROUND_LIGHT,
|
|
70
|
+
borderRadius: 8
|
|
71
|
+
},
|
|
72
|
+
label: {
|
|
73
|
+
y: ({parent, height}) => (parent.height - height) / 2,
|
|
74
|
+
height: 28,
|
|
75
|
+
width: ({parent}) => parent.width,
|
|
76
|
+
size: ({parent}) => ((parent.data && parent.data.ratio) || 1) * 18,
|
|
77
|
+
align: $TextAlign.CENTER,
|
|
78
|
+
lineHeight: 28,
|
|
79
|
+
family: $Theme.RobotoBold,
|
|
80
|
+
color: $Theme.COLOR_TEXT
|
|
81
|
+
},
|
|
82
|
+
icon: {
|
|
83
|
+
y: ({parent, height}) => (parent.height - height) / 2,
|
|
84
|
+
height: 24,
|
|
85
|
+
width: ({parent}) => parent.width,
|
|
86
|
+
size: ({parent}) => ((parent.data && parent.data.ratio) || 1) * 10,
|
|
87
|
+
align: $TextAlign.CENTER,
|
|
88
|
+
family: $Theme.MockIcons,
|
|
89
|
+
color: $Theme.COLOR_TEXT
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import $AbstractKeyboardRowListView from "@AbstractKeyboardRowListView";
|
|
2
|
+
import $SearchKeyboardRowItemView from "@SearchKeyboardRowItemView";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @name SearchKeyboardRowListView
|
|
6
|
+
* @class
|
|
7
|
+
* @extends AbstractKeyboardRowListView
|
|
8
|
+
*
|
|
9
|
+
* @property {number} itemMargin
|
|
10
|
+
* @property {itemViewClass} itemViewClass
|
|
11
|
+
*/
|
|
12
|
+
export default $AbstractKeyboardRowListView.declare("SearchKeyboardRowListView", {
|
|
13
|
+
properties: /** @lends SearchKeyboardRowListView.prototype */ {
|
|
14
|
+
itemMargin: 8,
|
|
15
|
+
itemViewClass: () => $SearchKeyboardRowItemView
|
|
16
|
+
},
|
|
17
|
+
methods: {},
|
|
18
|
+
|
|
19
|
+
style: {
|
|
20
|
+
height: 31,
|
|
21
|
+
width: ({data, itemMargin}) => {
|
|
22
|
+
if (data != null && data.length > 0) {
|
|
23
|
+
const line = data;
|
|
24
|
+
const itemsSize = line.length * $SearchKeyboardRowItemView.KB_CELL_WIDTH;
|
|
25
|
+
const itemsMargin = (line.length - 1) * itemMargin;
|
|
26
|
+
|
|
27
|
+
return itemsSize + itemsMargin;
|
|
28
|
+
}
|
|
29
|
+
return 0;
|
|
30
|
+
},
|
|
31
|
+
x: 15
|
|
32
|
+
}
|
|
33
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import $DefaultKeyboardView from "@DefaultKeyboardView";
|
|
2
|
+
|
|
3
|
+
// CONST
|
|
4
|
+
import $Theme from "@Theme";
|
|
5
|
+
|
|
6
|
+
// SERVICE
|
|
7
|
+
import $VirtualKeyboardService from "@VirtualKeyboardService";
|
|
8
|
+
// VIEWS
|
|
9
|
+
import $EnglishKeyboardData from "@EnglishKeyboardData";
|
|
10
|
+
import $SearchKeyboardRowListView from "@SearchKeyboardRowListView";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @name SearchKeyboardView
|
|
14
|
+
* @class
|
|
15
|
+
* @extends DefaultKeyboardView
|
|
16
|
+
*
|
|
17
|
+
* @property {itemViewClass} itemViewClass
|
|
18
|
+
* @property {number} itemMargin - margin between rows
|
|
19
|
+
* @property {service} keyboardService - keyboard service instance
|
|
20
|
+
* @property {string} substring - substring for cursor navigation
|
|
21
|
+
* @property {boolean} cursorMoved - true if left/right keyboard navigation keys were used
|
|
22
|
+
*/
|
|
23
|
+
export default $DefaultKeyboardView.declare("SearchKeyboardView", {
|
|
24
|
+
statics: {
|
|
25
|
+
PADDING: 0
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
properties: {
|
|
29
|
+
keyboardService: {class: $VirtualKeyboardService},
|
|
30
|
+
itemViewClass: () => $SearchKeyboardRowListView,
|
|
31
|
+
itemMargin: 16,
|
|
32
|
+
substring: "",
|
|
33
|
+
cursorMoved: false
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
methods: /** @lends SearchKeyboardView.prototype */ {
|
|
37
|
+
_ok: function (cell) {
|
|
38
|
+
let hasBufferChanged = false;
|
|
39
|
+
let cursorMoved = false;
|
|
40
|
+
|
|
41
|
+
if (cell.action === $EnglishKeyboardData.BACKSPACE.action) {
|
|
42
|
+
this.buffer = this.buffer.slice(0, -1);
|
|
43
|
+
hasBufferChanged = true;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (cell.char) {
|
|
47
|
+
this.buffer += cell.char;
|
|
48
|
+
hasBufferChanged = true;
|
|
49
|
+
}
|
|
50
|
+
this.cursorMoved = cursorMoved;
|
|
51
|
+
return hasBufferChanged;
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
style: {
|
|
56
|
+
width: 890,
|
|
57
|
+
height: 170,
|
|
58
|
+
background: {
|
|
59
|
+
fillColor: $Theme.COLOR_MUTED,
|
|
60
|
+
y: -15
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import $AbstractRailView from "@AbstractRailView";
|
|
2
|
+
|
|
3
|
+
import $SearchTileView from "@SearchTileView";
|
|
4
|
+
import $Theme from "@Theme";
|
|
5
|
+
|
|
6
|
+
// TRAITS
|
|
7
|
+
import $FixedNavigationType from "@FixedNavigationType";
|
|
8
|
+
// CONSTANTS
|
|
9
|
+
import $TextPrimitive from "@TextPrimitive";
|
|
10
|
+
|
|
11
|
+
/** TODO document the view *
|
|
12
|
+
* @name SearchScrollRailView
|
|
13
|
+
* @View
|
|
14
|
+
* @extends AbstractRailView
|
|
15
|
+
* @mixes MScrollItem
|
|
16
|
+
* @property { SearchTileView } itemViewClass - Item class to be used in the list
|
|
17
|
+
* @property {number} nbViewBefore - The number of views before current to keep before recycling
|
|
18
|
+
* @property {number} nbViewAfter - The number of views after current to keep after recycling
|
|
19
|
+
* @property {number} itemMargin - Margin between items
|
|
20
|
+
* @property {Trait} navigationType - the rail's navigation type
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export default $AbstractRailView.declare("SearchScrollRailView", {
|
|
24
|
+
properties: /** @lends SearchScrollRailView.prototype */ {
|
|
25
|
+
itemViewClass: () => $SearchTileView,
|
|
26
|
+
navigationType: () => $FixedNavigationType,
|
|
27
|
+
itemMargin: 20,
|
|
28
|
+
nbViewBefore: 5, // @TODO customize according your needs
|
|
29
|
+
nbViewAfter: 5 // @TODO customize according your needs
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
children: {
|
|
33
|
+
title: {class: $TextPrimitive}
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
methods: /** @lends SearchScrollRailView.prototype */ {
|
|
37
|
+
setData: function (data) {
|
|
38
|
+
this.title.text = data[0].title || "";
|
|
39
|
+
this.data = data[0].movies;
|
|
40
|
+
this._setData(data[0].movies);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
style: {
|
|
44
|
+
title: {
|
|
45
|
+
height: 40,
|
|
46
|
+
width: 300,
|
|
47
|
+
y: -60,
|
|
48
|
+
size: $Theme.H2_SIZE,
|
|
49
|
+
family: $Theme.RobotoBold,
|
|
50
|
+
color: ({parent}) => (parent.isFocused ? $Theme.COLOR_ACCENT : $Theme.COLOR_TEXT)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import $ScrollView from "@ScrollView";
|
|
2
|
+
import $SearchScrollRailView from "@SearchScrollRailView";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* //TODO document the view
|
|
6
|
+
*
|
|
7
|
+
* @name SearchScrollView
|
|
8
|
+
* @class
|
|
9
|
+
* @extends ScrollView
|
|
10
|
+
* @property { SearchScrollRailView } itemViewClass - Item class to be used in the list
|
|
11
|
+
* @property {number} itemMargin - Margin between items
|
|
12
|
+
* @View
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export default $ScrollView.declare("SearchScrollView", {
|
|
16
|
+
properties: /** @lends SearchScrollView.prototype */ {
|
|
17
|
+
itemViewClass: () => $SearchScrollRailView,
|
|
18
|
+
itemMargin: 503
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
methods: /** @lends SearchScrollView.prototype */ {}
|
|
22
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import $AbstractTileView from "@AbstractTileView";
|
|
2
|
+
import $RectanglePrimitive from "@RectanglePrimitive";
|
|
3
|
+
import $ContainImagePrimitive from "@ContainImagePrimitive";
|
|
4
|
+
import $Theme from "@Theme";
|
|
5
|
+
import $Easing from "@Easing";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Basic Tile item
|
|
9
|
+
* @name SearchTileView
|
|
10
|
+
* @View
|
|
11
|
+
* @extends AbstractTileView
|
|
12
|
+
*/
|
|
13
|
+
export default $AbstractTileView.declare("SearchTileView", {
|
|
14
|
+
statics: {
|
|
15
|
+
ITEM_WIDTH: 216,
|
|
16
|
+
ITEM_HEIGHT: 324,
|
|
17
|
+
SCALE_FOCUS: 1.1
|
|
18
|
+
},
|
|
19
|
+
children: {
|
|
20
|
+
imageView: {class: $ContainImagePrimitive},
|
|
21
|
+
focusRectangleView: {class: $RectanglePrimitive}
|
|
22
|
+
},
|
|
23
|
+
methods: {
|
|
24
|
+
/** * @override */
|
|
25
|
+
_setData: function () {
|
|
26
|
+
this.imageView.url = this.data ? this.data.imageUrl : "";
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
states: {
|
|
31
|
+
focused: {
|
|
32
|
+
scale: ({statics}) => statics.SCALE_FOCUS,
|
|
33
|
+
"focusRectangleView.borderColor": $Theme.COLOR_ACCENT,
|
|
34
|
+
"focusRectangleView.borderWidth": 6
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
transitions: {
|
|
38
|
+
default: {
|
|
39
|
+
scale: {
|
|
40
|
+
duration: 250,
|
|
41
|
+
easing: $Easing.linear
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
focused: {
|
|
45
|
+
scale: {
|
|
46
|
+
duration: 250,
|
|
47
|
+
easing: $Easing.linear
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
style: {
|
|
52
|
+
y: 0, width: ({statics}) => statics.ITEM_WIDTH,
|
|
53
|
+
height: ({statics}) => statics.ITEM_HEIGHT,
|
|
54
|
+
scale: 1,
|
|
55
|
+
imageView: {
|
|
56
|
+
width: ({parent}) => parent.width,
|
|
57
|
+
height: ({parent}) => parent.height,
|
|
58
|
+
borderRadius: 12
|
|
59
|
+
},
|
|
60
|
+
focusRectangleView: {
|
|
61
|
+
width: ({parent}) => parent.width,
|
|
62
|
+
height: ({parent}) => parent.height,
|
|
63
|
+
borderRadius: 12,
|
|
64
|
+
borderWidth: 0
|
|
65
|
+
},
|
|
66
|
+
opacity: ({data}) => data ? 1 : 0
|
|
67
|
+
}
|
|
68
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import $AbstractModule from "@AbstractModule";
|
|
2
|
+
import $SettingsRoutes from "@SettingsRoutes";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Settings page module
|
|
6
|
+
*
|
|
7
|
+
* @name SettingsModule
|
|
8
|
+
* @class
|
|
9
|
+
* @module SettingsModule
|
|
10
|
+
* @extends AbstractModule
|
|
11
|
+
* @lazy
|
|
12
|
+
*
|
|
13
|
+
* @property {Trait[]} exports A list of trait's exported by the module
|
|
14
|
+
*/
|
|
15
|
+
export default $AbstractModule.declare("SettingsModule", {
|
|
16
|
+
properties: /** @lends SettingsModule.prototype*/ {
|
|
17
|
+
exports: [$SettingsRoutes]
|
|
18
|
+
}
|
|
19
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import $Routes from "@Routes";
|
|
2
|
+
import $SettingsScreen from "@SettingsScreen";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Settings module routes
|
|
6
|
+
* @name SettingsRoutes
|
|
7
|
+
* @class
|
|
8
|
+
* @extends Routes
|
|
9
|
+
*/
|
|
10
|
+
export default $Routes.declare("SettingsRoutes", {
|
|
11
|
+
/**
|
|
12
|
+
* @route SettingsModule
|
|
13
|
+
*/
|
|
14
|
+
methods: /** @lends SettingsRoutes.prototype */ {
|
|
15
|
+
settings: function (data) {
|
|
16
|
+
return $SettingsScreen.display(data);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import $AppScreen from "@AppScreen";
|
|
2
|
+
|
|
3
|
+
import $SettingsListView from "@SettingsListView";
|
|
4
|
+
import $TextPrimitive from "@TextPrimitive";
|
|
5
|
+
import $SystemInfoService from "@SystemInfoService";
|
|
6
|
+
import $RectanglePrimitive from "@RectanglePrimitive";
|
|
7
|
+
import $Theme from "@Theme";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @name SettingsScreen
|
|
11
|
+
* @class
|
|
12
|
+
* @extends AppScreen
|
|
13
|
+
* @screen
|
|
14
|
+
*
|
|
15
|
+
* @property {SystemInfoService} systemInfoService
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
export default $AppScreen.declare("SettingsScreen", {
|
|
19
|
+
statics: /** @lends SettingsScreen */ {
|
|
20
|
+
SETTINGS_TITLE: "Settings",
|
|
21
|
+
SERIAL_NUMBER: "Serial number",
|
|
22
|
+
HARDWARE_VERSION: "Hardware version",
|
|
23
|
+
SOFTWARE_VERSION: "Software version",
|
|
24
|
+
DEVICE_TYPE: "Device type",
|
|
25
|
+
MODEL_NAME: "Model name",
|
|
26
|
+
SYSTEM_LANGUAGE: "System language",
|
|
27
|
+
UNKNOWN_SYSTEM_INFO: "N/A",
|
|
28
|
+
TITLE_X_POSITION: 252
|
|
29
|
+
},
|
|
30
|
+
properties: {
|
|
31
|
+
systemInfoService: {class: $SystemInfoService}
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
children: /** @lends SettingsScreen.prototype */ {
|
|
35
|
+
background: {class: $RectanglePrimitive},
|
|
36
|
+
settingTitleView: {
|
|
37
|
+
class: $TextPrimitive,
|
|
38
|
+
text: ({parent}) => parent.statics.SETTINGS_TITLE
|
|
39
|
+
},
|
|
40
|
+
settingsList: {class: $SettingsListView}
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
methods: /** @lends SettingsScreen.prototype */ {
|
|
44
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
45
|
+
// EXTENSION POINTS
|
|
46
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Prepare screen data: get the business data to feed the views
|
|
50
|
+
* View should always be fulfilled with business model(s).
|
|
51
|
+
*
|
|
52
|
+
* It must returns an Object.
|
|
53
|
+
*
|
|
54
|
+
* @param {Object} [context] The context shared by the screens during display
|
|
55
|
+
* @returns {Promise<Object,Error>} returns a promise resolved with the data
|
|
56
|
+
* @override
|
|
57
|
+
*/
|
|
58
|
+
prepareData: function (context) {
|
|
59
|
+
return this._getInfo()
|
|
60
|
+
.then((infos) => {
|
|
61
|
+
return {
|
|
62
|
+
systemInfoData: infos
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Connect the data prepared by {@link prepareData} to the views.
|
|
69
|
+
* Use the data property, which is the return value of {@link prepareData}.
|
|
70
|
+
*
|
|
71
|
+
* @param {Object} [context] The context shared by the screens during display
|
|
72
|
+
* @override
|
|
73
|
+
*/
|
|
74
|
+
connectData: function (context) {
|
|
75
|
+
this.settingsList.setData(this.data.systemInfoData);
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Called before the screen is shown
|
|
80
|
+
* The flow is interrupted until the promise has been resolved/rejected
|
|
81
|
+
*
|
|
82
|
+
* @param {Object} [context] The context shared by the screens during display
|
|
83
|
+
* @override
|
|
84
|
+
*/
|
|
85
|
+
beforeShow: function (context) {},
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Called before the screen is hidden
|
|
89
|
+
* The flow is interrupted until the promise has been resolved/rejected
|
|
90
|
+
*
|
|
91
|
+
* @param {Object} [context] The context shared by the screens during display
|
|
92
|
+
* @override
|
|
93
|
+
*/
|
|
94
|
+
beforeHide: function (context) {},
|
|
95
|
+
|
|
96
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
97
|
+
// EVENT CALLBACKS
|
|
98
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Called when a screen is ready
|
|
102
|
+
* The data have been retrieved, the children are shown
|
|
103
|
+
* @override
|
|
104
|
+
*/
|
|
105
|
+
onScreenReady: function () {},
|
|
106
|
+
|
|
107
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
108
|
+
// PRIVATE METHODS
|
|
109
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* gets the system informations and filter them to only have the system infos with value
|
|
113
|
+
* @returns Promise of an array of objects
|
|
114
|
+
*/
|
|
115
|
+
_getInfo: function () {
|
|
116
|
+
const systemInfoData = Promise.all([
|
|
117
|
+
this._getSettingsItem(
|
|
118
|
+
this.statics.SERIAL_NUMBER,
|
|
119
|
+
this.systemInfoService.getSerialNumber()
|
|
120
|
+
),
|
|
121
|
+
this._getSettingsItem(
|
|
122
|
+
this.statics.HARDWARE_VERSION,
|
|
123
|
+
this.systemInfoService.getHardwareVersion()
|
|
124
|
+
),
|
|
125
|
+
this._getSettingsItem(
|
|
126
|
+
this.statics.SOFTWARE_VERSION,
|
|
127
|
+
this.systemInfoService.getSoftwareVersion()
|
|
128
|
+
),
|
|
129
|
+
this._getSettingsItem(
|
|
130
|
+
this.statics.DEVICE_TYPE,
|
|
131
|
+
this.systemInfoService.getDeviceType()
|
|
132
|
+
),
|
|
133
|
+
this._getSettingsItem(
|
|
134
|
+
this.statics.MODEL_NAME,
|
|
135
|
+
this.systemInfoService.getModelName()
|
|
136
|
+
),
|
|
137
|
+
this._getSettingsItem(
|
|
138
|
+
this.statics.SYSTEM_LANGUAGE,
|
|
139
|
+
this.systemInfoService.getSystemLanguage()
|
|
140
|
+
)
|
|
141
|
+
]);
|
|
142
|
+
|
|
143
|
+
return systemInfoData;
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* creates an object of system info with the keys systemInfoTitle and systemInfoValue
|
|
148
|
+
* @param {*} title the name of the system info
|
|
149
|
+
* @param {*} promise the promise of the system info value
|
|
150
|
+
* @returns an Object
|
|
151
|
+
*/
|
|
152
|
+
_getSettingsItem: function (title, promise) {
|
|
153
|
+
return promise.then((value) => {
|
|
154
|
+
if (!value) {
|
|
155
|
+
value = this.statics.UNKNOWN_SYSTEM_INFO;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
systemInfoTitle: title,
|
|
160
|
+
systemInfoValue: value
|
|
161
|
+
};
|
|
162
|
+
}).catch((error) => {
|
|
163
|
+
console.error(error);
|
|
164
|
+
return {
|
|
165
|
+
systemInfoTitle: title,
|
|
166
|
+
systemInfoValue: this.statics.UNKNOWN_SYSTEM_INFO
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
172
|
+
// FOCUS
|
|
173
|
+
//////////////////////////////////////////////////////////////////////////////////////////
|
|
174
|
+
|
|
175
|
+
_getChildToFocus: function (context) {
|
|
176
|
+
return this.settingsList;
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
style: {
|
|
181
|
+
background: {
|
|
182
|
+
width: $Theme.FULL_SCREEN_WIDTH,
|
|
183
|
+
height: $Theme.FULL_SCREEN_HEIGHT,
|
|
184
|
+
fillColor: $Theme.COLOR_BACKGROUND
|
|
185
|
+
},
|
|
186
|
+
settingTitleView: {
|
|
187
|
+
width: 360,
|
|
188
|
+
height: 60,
|
|
189
|
+
x: $Theme.SCREEN_LEFT_MARGIN,
|
|
190
|
+
y: $Theme.SCREEN_TOP_MARGIN,
|
|
191
|
+
family: $Theme.RobotoBold,
|
|
192
|
+
color: $Theme.COLOR_ACCENT,
|
|
193
|
+
size: $Theme.H1_SIZE
|
|
194
|
+
},
|
|
195
|
+
settingsList: {
|
|
196
|
+
x: $Theme.SCREEN_LEFT_MARGIN,
|
|
197
|
+
y: $Theme.SCREEN_TOP_MARGIN + 100
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import $RecyclingItemView from "@RecyclingItemView";
|
|
2
|
+
import $MRecyclingItem from "@MRecyclingItem";
|
|
3
|
+
|
|
4
|
+
import $TextPrimitive from "@TextPrimitive";
|
|
5
|
+
import $RectanglePrimitive from "@RectanglePrimitive";
|
|
6
|
+
|
|
7
|
+
import $Theme from "@Theme";
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @name SettingsListItemView
|
|
11
|
+
* @class
|
|
12
|
+
* @extends RecyclingItemView
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export default $RecyclingItemView.declare("SettingsListItemView", {
|
|
16
|
+
traits: [$MRecyclingItem],
|
|
17
|
+
statics: /** @lends SettingsListItemView */ {
|
|
18
|
+
ITEM_WIDTH: 1000,
|
|
19
|
+
ITEM_HEIGHT: 100,
|
|
20
|
+
PADDING_LEFT: 16,
|
|
21
|
+
PADDING_TOP: 16,
|
|
22
|
+
BORDER_RADIUS_VALUE: 12,
|
|
23
|
+
MARGIN: 24
|
|
24
|
+
},
|
|
25
|
+
children: /** @lends SettingsListItemView.prototype */ {
|
|
26
|
+
background: {
|
|
27
|
+
class: $RectanglePrimitive
|
|
28
|
+
},
|
|
29
|
+
systemInfoTitle: {
|
|
30
|
+
class: $TextPrimitive,
|
|
31
|
+
text: ({parent}) => {
|
|
32
|
+
return (
|
|
33
|
+
(parent.data && parent.data.systemInfoTitle)
|
|
34
|
+
|| ""
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
systemInfoValue: {
|
|
39
|
+
class: $TextPrimitive,
|
|
40
|
+
text: ({parent}) => (parent.data && parent.data.systemInfoValue)
|
|
41
|
+
|| ""
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
states: {
|
|
45
|
+
focused: {
|
|
46
|
+
"systemInfoTitle.color": $Theme.COLOR_ACCENT,
|
|
47
|
+
"systemInfoValue.color": $Theme.COLOR_ACCENT,
|
|
48
|
+
"systemInfoTitle.family": $Theme.RobotoBold,
|
|
49
|
+
"background.fillColor": $Theme.COLOR_TEXT,
|
|
50
|
+
"background.borderColor": $Theme.COLOR_ACCENT,
|
|
51
|
+
"background.opacity": 1,
|
|
52
|
+
"background.borderWidth": 5
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
style: {
|
|
57
|
+
width: ({statics}) => statics.ITEM_WIDTH,
|
|
58
|
+
height: ({statics}) => statics.ITEM_HEIGHT,
|
|
59
|
+
background: {
|
|
60
|
+
width: ({parent}) => parent.width,
|
|
61
|
+
height: ({parent}) => parent.height,
|
|
62
|
+
borderRadius: ({parent}) => parent.statics.BORDER_RADIUS_VALUE,
|
|
63
|
+
fillColor: $Theme.COLOR_MUTED,
|
|
64
|
+
borderColor: $Theme.COLOR_TEXT,
|
|
65
|
+
borderWidth: 0,
|
|
66
|
+
opacity: 0.3
|
|
67
|
+
},
|
|
68
|
+
systemInfoTitle: {
|
|
69
|
+
x: ({parent}) => parent.statics.PADDING_LEFT,
|
|
70
|
+
y: ({parent}) => parent.background.y + parent.statics.MARGIN,
|
|
71
|
+
size: 30,
|
|
72
|
+
height: 50,
|
|
73
|
+
isAuto_width: true, // eslint-disable-line @wiztivi/no-use-width-height-auto
|
|
74
|
+
align: "left",
|
|
75
|
+
color: $Theme.COLOR_TEXT
|
|
76
|
+
},
|
|
77
|
+
systemInfoValue: {
|
|
78
|
+
x: ({parent}) => parent.statics.PADDING_LEFT,
|
|
79
|
+
y: ({parent}) => parent.systemInfoTitle.y + 40,
|
|
80
|
+
width: ({parent}) => parent.statics.ITEM_WIDTH,
|
|
81
|
+
height: 20,
|
|
82
|
+
color: $Theme.COLOR_TEXT
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|