• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
16import CommonStyleManager from '../../default/CommonStyleManager';
17
18const TAG = 'CommonTemplate-StyleConfiguration';
19
20export class IconTitleBaseStyle {
21  marginLeft: Length = '24vp';
22  marginRight: Length = '16vp';
23  componentGap: Length = '8vp';
24  titleSize: Length = '24vp';
25  titleColor: ResourceColor = $r('sys.color.ohos_id_color_text_secondary');
26  borderRadius: Length= '48vp';
27  backgroundColor: ResourceColor= '#ffffff';
28  textMargin: Length = '8vp';
29  textHoverHeight: Length = '52vp';
30  textHoverWidth: Length = '136vp';
31  textHoverRadius: Length = '8vp';
32  hoverColor: ResourceColor = 'rgba(0, 0, 0, 0.05)';
33  transparentColor: ResourceColor = 'rgba(255, 255, 255, 0)';
34}
35
36export class IconComponentStyle {
37  circleWidth: number | string = '96vp';
38  circleHeight: number | string = '96vp';
39  iconWidth: Length = '48vp';
40  iconHeight: Length = '48vp';
41  iconOffBG: ResourceColor = '#1A000000';
42  iconOnBG: ResourceColor = '#FF007DFF';
43  iconOnColor: ResourceColor = '#FFFFFFFF';
44  iconOffColor: ResourceColor = $r('sys.color.ohos_id_color_secondary');
45  hoverColor: ResourceColor = 'rgba(0, 0, 0, 0.05)';
46  transparentColor: ResourceColor = 'rgba(255, 255, 255, 0)';
47}
48
49export class SimpleToggleBaseStyle {
50  circleWidth: number | string = '96vp';
51  circleHeight: number | string = '96vp';
52  iconWidth: Length = '48vp';
53  iconHeight: Length = '48vp';
54  dragCircleWidth: number | string = '120vp';
55  dragCircleHeight: number | string = '120vp';
56  dragIconWidth: Length = '72vp';
57  dragIconHeight: Length = '72vp';
58  iconOffBG: ResourceColor = '#1A000000';
59  iconOnBG: ResourceColor = '#FF007DFF';
60  iconOnColor: ResourceColor = '#FFFFFFFF';
61  iconOffColor: ResourceColor = $r('sys.color.ohos_id_color_secondary');
62  componentGap: Length = '10vp';
63  titleSize: Length = '24fp';
64  titleColor: ResourceColor = $r('sys.color.ohos_id_color_text_secondary');
65  textHoverWidth: number | string = '136vp';
66  textHoverHeight: number | string = '36vp';
67  textHoverRadius: number | string = '8vp';
68  hoverColor: ResourceColor = 'rgba(0, 0, 0, 0.05)';
69  transparentColor: ResourceColor = 'rgba(255, 255, 255, 0)';
70}
71
72export default class StyleConfiguration {
73  static getIconTitleBaseStyle(): IconTitleBaseStyle {
74    const key: string = TAG + '-IconTitleBase';
75    return CommonStyleManager.getStyle(key, IconTitleBaseStyle);
76  }
77
78  static getIconComponentStyle(): IconComponentStyle {
79    const key: string = TAG + '-IconComponent';
80    return CommonStyleManager.getStyle(key, IconComponentStyle);
81  }
82
83  static getSimpleToggleBaseStyle(): SimpleToggleBaseStyle {
84    const key: string = TAG + '-SimpleToggleBase';
85    return CommonStyleManager.getStyle(key, SimpleToggleBaseStyle);
86  }
87}