1/** 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16export class StyleConstants { 17 static readonly DEFAULT_FONT_COLOR = '#ffffff'; 18 static readonly DEFAULT_BG_COLOR = '#00000000'; 19 static readonly DEFAULT_SYSTEM_UI_COLOR = '#00ffffff'; 20 static readonly FOLDER_ADD_APP_FONT_COLOR = '#000000'; 21 static readonly TEXT_COLOR_PRIMARY = '#E6000000'; 22 static readonly BUTTON_FONT_COLOR = '#007DFF'; 23 static readonly DEFAULT_BUTTON_FONT_SIZE = '16fp'; 24 static readonly DEFAULT_DIALOG_BOTTOM_MARGIN = '16vp'; 25 static readonly DEFAULT_DIALOG_RADIUS = '24vp'; 26 static readonly DEFAULT_DIALOG_WIDTH = '395vp'; 27 static readonly DEFAULT_BUTTON_HEIGHT = '40vp'; 28 static readonly DEFAULT_DIVIDER_HEIGHT = '24vp'; 29 static readonly DEFAULT_BUTTON_WIDTH = '120vp'; 30 static readonly DEFAULT_COLOR_ERROR = '#FFE84026'; 31 static readonly DEFAULT_ICON = '/common/pics/icon.png'; 32 static readonly DEFAULT_BACKGROUND_IMAGE = '/common/pics/img_wallpaper.jpg'; 33 static readonly DEFAULT_APP_GRID_COLUMN = 7; 34 static readonly DEFAULT_APP_GRID_ROW = 4; 35 static readonly DEFAULT_APP_GRID_COLUMN_GAP = 50; 36 static readonly DEFAULT_APP_GRID_ROW_GAP = 24; 37 static readonly DEFAULT_APP_ICON_SIZE_WIDTH = 70; 38 static readonly DEFAULT_APP_NAME_SIZE= 12; 39 static readonly DEFAULT_APP_NAME_HEIGHT = 25; 40 static readonly DEFAULT_APP_ITEM_WIDTH = 72; 41 static readonly DEFAULT_APP_ITEM_HEIGHT = 64; 42 static readonly DEFAULT_APP_MARGIN = 10; 43 static readonly DEFAULT_FOLDER_GRID_SIZE= 136; 44 static readonly DEFAULT_FOLDER_APP_SIZE= 44; 45 static readonly DEFAULT_FOLDER_GRID_MARGIN= 10; 46 static readonly DEFAULT_FOLDER_GRID_GAP= 2; 47 static readonly DEFAULT_OPEN_FOLDER_GRID_ROW= 4; 48 static readonly DEFAULT_OPEN_FOLDER_GRID_COLUMN= 4; 49 static readonly DEFAULT_OPEN_FOLDER_APP_SIZE= 60; 50 static readonly DEFAULT_ADD_APP_SIZE= 54; 51 static readonly DEFAULT_OPEN_FOLDER_APP_NAME_SIZE= 14; 52 static readonly DEFAULT_OPEN_FOLDER_APP_NAME_HEIGHT= 36; 53 static readonly DEFAULT_OPEN_FOLDER_GRID_WIDTH= 444; 54 static readonly DEFAULT_OPEN_FOLDER_GRID_HEIGHT= 455; 55 static readonly DEFAULT_OPEN_FOLDER_SWIPER_HEIGHT= 480; 56 static readonly DEFAULT_OPEN_FOLDER_GRID_GAP= 6; 57 static readonly DEFAULT_OPEN_FOLDER_TITLE_HEIGHT = 130; 58 static readonly DEFAULT_OPEN_FOLDER_TITLE_TOP = 130; 59 static readonly DEFAULT_APP_ADD_TITLE_SIZE = 56; 60 static readonly DEFAULT_DIALOG_BOTTOM_MARGIN_NUMBER = 16; 61 static readonly DEFAULT_BUTTON_HEIGHT_NUMBER = 40; 62 static readonly DEFAULT_MENU_HEIGHT = 76; 63 static readonly PERCENTAGE_100 = '100%'; 64 static readonly PERCENTAGE_85 = '85%'; 65 static readonly PERCENTAGE_80 = '80%'; 66 static readonly PERCENTAGE_80_number = 0.8; 67 static readonly PERCENTAGE_75 = '75%'; 68 static readonly PERCENTAGE_70 = '70%'; 69 static readonly PERCENTAGE_15 = '15%'; 70 static readonly DEFAULT_APP_IMAGE = '/common/pics/img_app_default.png'; 71 static readonly DEFAULT_DELETE_IMAGE = '/common/pics/ic_public_delete.svg'; 72 static readonly DEFAULT_BACKGROUND_IMAGE_RECENT = '/common/pics/ic_wallpaper_recent.jpg'; 73 static readonly DEFAULT_RENAME_IMAGE = '/common/pics/ic_rename.svg'; 74 static readonly APP_IMAGE_WIDTH = 240; 75 static readonly APP_IMAGE_HEIGHT = 430; 76 static readonly DEFAULT_NUMBER = 20; 77 static readonly DEFAULT_APP_LIST_ITEM_WIDTH = 90; 78 static readonly DEFAULT_APP_LIST_ITEM_HEIGHT = 90; 79 static readonly DEFAULT_ITEM_RADIUS = 8; 80 static readonly DEFAULT_BUTTON_TEXT_SIZE= 23; 81 static readonly PIXEL_50 = 50; 82 static readonly PIXEL_200 = 200; 83 static readonly PIXEL_150 = 150; 84 static readonly LIGHT_BLACK = '#3c000000'; 85 static readonly DEFAULT_0 = 0; 86 static readonly DEFAULT_1 = 1; 87 static readonly DEFAULT_4 = 4; 88 static readonly DEFAULT_5 = 5; 89 static readonly DEFAULT_8 = 8; 90 static readonly DEFAULT_10 = 10; 91 static readonly DEFAULT_12 = 12; 92 static readonly DEFAULT_14 = 14; 93 static readonly DEFAULT_15 = 15; 94 static readonly DEFAULT_16 = 16; 95 static readonly DEFAULT_20 = 20; 96 static readonly DEFAULT_24 = 24; 97 static readonly DEFAULT_25 = 25; 98 static readonly DEFAULT_28 = 28; 99 static readonly DEFAULT_30 = 30; 100 static readonly DEFAULT_40 = 40; 101 static readonly DEFAULT_56 = 56; 102 static readonly DEFAULT_60 = 60; 103 static readonly DEFAULT_80 = 80; 104 static readonly WINDOW_SHOW_DELAY: number = 150; 105 static readonly DEFAULT_DIVIDER_COLOR = 'rgb(207, 195, 195)'; 106 static readonly DEFAULT_FOLDER_APP_ITEM_WIDTH = 36; 107 static readonly DEFAULT_FOLDER_APP_ITEM_WIDTH_SMALL = 45; 108 static readonly DEFAULT_BADGE_FONT_SIZE = 16; 109 static readonly DEFAULT_BADGE_SIZE = 20; 110 static readonly MAX_BADGE_COUNT = 99; 111 static readonly DEFAULT_BROAD_COLOR = 'rgba(0,0,0,0.15)'; 112 static readonly DEFAULT_TRANSPARENT_COLOR = 'rgba(0,0,0,0)'; 113 static readonly CONTEXT_MENU_WIDTH = 243; 114 static readonly DEFAULT_FORM_ITEM_WIDTH = 78; 115 static readonly DEFAULT_FORM_ITEM_HEIGHT = 78; 116 static readonly DEFAULT_FORM_FONT_TITLE_SIZE= 16; 117 static readonly DEFAULT_FORM_FONT_CONTENT_SIZE= 20; 118 static readonly DEFAULT_FORM_FONT_TITLE_WEIGHT= 500; 119 static readonly DEFAULT_FORM_FONT_CONTENT_WEIGHT= 400; 120 static readonly DEFAULT_FORM_REMOVE_DIALOG_WIDTH= 336; 121 static readonly DEFAULT_FORM_REMOVE_DIALOG_HEIGHT= 170; 122 static readonly DEFAULT_FORM_REMOVE_DIALOG_BUTTON_WIDTH= 136; 123 static readonly DEFAULT_FORM_REMOVE_DIALOG_BUTTON_HEIGHT= 22; 124 static readonly DEFAULT_SMART_DOCK_MISSION_HEIGHT = 132; 125 static readonly DEFAULT_SMART_DOCK_MISSION_MERGIN_BOTTOM = 6; 126 static readonly DEFAULT_SMART_DOCK_MISSION_MERGIN_RIGHT = 2; 127 static readonly DEFAULT_SMART_DOCK_MISSION_IMAGE_HEIGHT = 80; 128 129 //image resources 130 static readonly DEFAULT_FORM_MGR_BACKGROUND_IMAGE = '/common/pics/ic_wallpaper_form_manager.jpg'; 131 static readonly DEFAULT_FORM_MGR_BACK_IMAGE = '/common/pics/ic_form_mgr_back.png'; 132 static readonly DEFAULT_ARROW_RIGHT_IMAGE = '/common/pics/ic_arrow_right.svg'; 133 134 // style 135 static readonly DEFAULT_FORM_MARGIN = 10; 136 static readonly FORM_MANAGER_VIEW_CARD_WIDTH = 75; 137 static readonly FORM_MANAGER_VIEW_CARD_HEIGHT = 75; 138 static readonly FORM_MANAGER_VIEW_WIDTH = 402; 139 static readonly FORM_MANAGER_VIEW_HEIGHT = 528; 140 static readonly FORM_MANAGER_VIEW_FORM_NAME_HEIGHT = 28; 141 static readonly FORM_MANAGER_VIEW_FORM_SUB_NAME_HEIGHT = 22; 142 143 // font resources 144 static readonly DEFAULT_FORM_MGR_TEXT_FONT_SIZE = 20; 145 static readonly DEFAULT_FORM_MGR_FONT_COLOR = '#e5ffffff'; 146 static readonly DEFAULT_FORM_DIALOG_BUTTON_COLOR = '#007dff'; 147 148 // layout percentage adaptation resources 149 static readonly DEFAULT_LAYOUT_PERCENTAGE = '100%'; 150 static readonly FORM_MGR_BOTTOM_WIDTH_PERCENTAGE = '80%'; 151 static readonly FORM_MGR_BOTTOM_HEIGHT_PERCENTAGE = '10%'; 152 static readonly FORM_MGR_SWIPER_WIDTH_PERCENTAGE = '80%'; 153 static readonly FORM_MGR_SWIPER_HEIGHT_PERCENTAGE = '50%'; 154 static readonly FORM_MGR_TEXT_HEIGHT_PERCENTAGE = '20%'; 155 static readonly FORM_MGR_TOP_HEIGHT_PERCENTAGE = '10%'; 156 157 // parameters for form manager page in phone 158 static readonly FORM_MGR_STATUS_BAR_HEIGHT = 24; 159 static readonly FORM_MGR_APP_BAR_HEIGHT = 56; 160 static readonly FORM_MGR_BACK_ICON_HEIGHT = 18; 161 static readonly FORM_MGR_BACK_ICON_WIDTH = 20; 162 static readonly FORM_MGR_BACK_ICON_LEFT_MARGIN = 26; 163 static readonly FORM_MGR_ADD_TO_DESKTOP_BUTTON_HEIGHT = 40; 164 static readonly FORM_MGR_ADD_TO_DESKTOP_BUTTON_WIDTH = 305; 165 static readonly FORM_MGR_ADD_TO_DESKTOP_BUTTON_LEFT_MARGIN = 27; 166 static readonly FORM_MGR_ADD_TO_DESKTOP_BUTTON_RIGHT_MARGIN = 27; 167 static readonly FORM_MGR_ADD_TO_DESKTOP_BUTTON_BOTTOM_MARGIN = 48; 168 static readonly FORM_MGR_FORM_SIZE = 67.5; 169 static readonly FORM_MGR_ADD_TO_DESKTOP_TEXT_SIZE = 18; 170 static readonly FORM_MGR_APP_LABEL_TEXT_SIZE = 20; 171 static readonly FORM_MGR_DESCRIPTION_TEXT_SIZE = 16; 172 173 174 // the dpi of phone should be 480, but it is 320 currently. 175 // so all dimensions have to be multiplied by 1.5 176 static readonly DPI_RATIO = 1; 177}