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 */ 15export class RecentsStyleConstants { 16 17 // image resources 18 static readonly DEFAULT_BG_COLOR = '#00000000'; 19 static readonly DEFAULT_APP_ICON_IMAGE: Resource = $r('app.media.icon'); 20 static readonly DEFAULT_APP_IMAGE: Resource = $r('app.media.img_app_default'); 21 static readonly DEFAULT_APP_IMAGE_PATH: string = '/common/pics/img_app_default.png'; 22 static readonly DEFAULT_DELETE_IMAGE = '/common/pics/ic_public_delete.svg'; 23 static readonly DEFAULT_DELETE_IMAGE_FULL = '/common/pics/ic_public_delete_full.svg'; 24 static readonly DEFAULT_RECENT_BACKGROUND_IMAGE = '/common/pics/ic_wallpaper_recent.jpg'; 25 static readonly DEFAULT_LOCKED_IMAGE = '/common/pics/ic_public_lock.svg'; 26 27 // font style resources 28 static readonly DEFAULT_FONT_COLOR = '#ffffff'; 29 static readonly DEFAULT_FONT_SIZE = 20; 30 static readonly DEFAULT_APP_NAME_SIZE = 16; 31 static readonly SINGLE_LIST_DEFAULT_APP_ICON_SIZE = 28; 32 static readonly DOUBLE_LIST_DEFAULT_APP_ICON_SIZE = 28; 33 static readonly SINGLE_LIST_DEFAULT_APP_ICON_SIZE_NEW = 22; 34 35 // layout percentage adaptation resources 36 static readonly DEFAULT_LAYOUT_PERCENTAGE = '100%'; 37 static readonly RECENT_MISSION_CARD_IMAGE_HEIGHT_PERCENTAGE = '70%'; 38 static readonly RECENT_MISSION_CARD_MISSION_HEIGHT_PERCENTAGE = '75%'; 39 static readonly SINGLE_LIST_DELETE_HEIGHT_PERCENTAGE = '15%'; 40 static readonly SINGLE_LIST_SCROLL_HEIGHT_PERCENTAGE = '85%'; 41 static readonly DOUBLE_LIST_GRID_HEIGHT_PERCENTAGE = '80%'; 42 static readonly DOUBLE_LIST_DELETE_HEIGHT_PERCENTAGE = '10%'; 43 44 // layout size 45 static readonly SINGLE_LIST_MIDDLE_AERA_HEIGHT: number = 604; 46 47 // image size resources 48 static readonly SINGLE_LIST_APP_IMAGE_WIDTH = 216; 49 static readonly SINGLE_LIST_APP_IMAGE_HEIGHT = 453; 50 static readonly SINGLE_LIST_MISSION_HEIGHT: number = 497; 51 static readonly DOUBLE_LIST_APP_IMAGE_WIDTH = 282; 52 static readonly DOUBLE_LIST_APP_IMAGE_HEIGHT = 176; 53 static readonly DOUBLE_LIST_MISSION_HEIGHT = 214; 54 55 // style resources 56 static readonly APP_NAME_MARGIN = 5; 57 static readonly DEFAULT_DELETE_IMAGE_OPACITY = 0.5; 58 static readonly RECENT_IMAGE_RADIUS = 20; 59 static readonly RECENT_DELETE_IMAGE_RADIUS = 24; 60 static readonly RECENT_DELETE_IMAGE_SIZE = 24; 61 static readonly RECENT_DELETE_IMAGE_COLUMN_SIZE = 48; 62 static readonly SINGLE_LIST_APP_INFO_LAYOUT_WEIGHT: number = 1; 63 static readonly SINGLE_LIST_LAYOUT_MARGIN = 10; 64 static readonly DOUBLE_LIST_APP_INFO_LAYOUT_WEIGHT: number = 2; 65 static readonly DOUBLE_LIST_LAYOUT_MARGIN = 20; 66 static readonly DOUBLE_LIST_LAYOUT_COLUMNSGAP = 38; 67 static readonly DOUBLE_LIST_LAYOUT_ROWSGAP = 40; 68 static readonly DOUBLE_LIST_RIGHT_MARGIN = 72; 69 static readonly DOUBLE_LIST_TOP_MARGIN = 54; 70 static readonly SINGLE_LIST_LOCKED_IMAGE_RIGHT_MARGIN = 24; 71 static readonly DOUBLE_LIST_LOCKED_IMAGE_RIGHT_MARGIN = 12; 72 static readonly SINGLE_LIST_APP_INFO_TOP_MARGIN = 6; 73 static readonly SINGLE_LIST_APP_INFO_BOTTOM_MARGIN = 10; 74 static readonly DOUBLE_LIST_APP_INFO_BOTTOM_MARGIN = 8; 75 static readonly SINGLE_LIST_MIDDLE_AREA_SPACE = 16; 76 static readonly SINGLE_LIST_APP_INFO_LEFT_MARGIN = 8; 77 static readonly SINGLE_LIST_MIDDLE_AREA_TOP_MARGIN = 107; 78 static readonly SINGLE_LIST_DELETE_IMAGE_FULL_BOTTOM_MARGIN = 49; 79 80 81 82 // the dpi of phone should be 480, but it is 320 currently. 83 // so all dimensions have to be multiplied by 1.5 84 static readonly DPI_RATIO = 1; 85}