• 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 '../../../../../../../../common/src/main/ets/default/CommonStyleManager';
17import Constants from './Constants';
18
19const TAG = 'statusBar-StyleConfiguration';
20
21export class VerticalStatusBarItemLoadComponentStyle {
22  statusBarVerticalComponentHeight: number = vp2px(Constants.VERTICAL_COMPONENT_HEIGHT_VP);
23}
24
25export class StatusBarNotificationIconStyle {
26  iconWidth: Length = $r('app.float.status_bar_notification_icon_width');
27  iconHeight: Length = $r('app.float.status_bar_notification_icon_height');
28  iconSpace: Length = $r('app.float.status_bar_notification_icon_space');
29}
30
31export class IconItemComponentStyle {
32  stackHeight: Length = $r('app.float.status_bar_icon_item_stack_height');
33  stackPadding: Length = $r('app.float.status_bar_icon_item_stack_padding');
34  stackBorderRadius: Length = $r('app.float.status_bar_icon_item_stack_border_radius');
35  stackBgColorSelected: ResourceColor = $r('app.color.status_bar_icon_item_stack_bg_color_selected');
36  stackBgColorUnSelected: ResourceColor = $r('app.color.status_bar_icon_item_stack_bg_color_un_selected');
37  componentSpace: Length = $r('app.float.status_bar_icon_item_component_space');
38  iconWidth: Length = $r('app.float.status_bar_icon_item_icon_width');
39  iconHeight: Length = $r('app.float.status_bar_icon_item_icon_height');
40  marginLeft: Length = $r('app.float.status_bar_icon_item_margin_left');
41  marginRight: Length = $r('app.float.status_bar_icon_item_margin_right');
42}
43
44export class PluginIconItemComponentStyle {
45  iconWidth: number = vp2px(Constants.PLUGIN_COMPONENT_ICON_WIDTH);
46}
47
48export default class StyleConfiguration {
49  static getVerticalStatusBarItemLoadComponentStyle(): VerticalStatusBarItemLoadComponentStyle {
50    const key: string = TAG + '-VerticalStatusBarItemLoadComponent';
51    return CommonStyleManager.getStyle(key, VerticalStatusBarItemLoadComponentStyle);
52  }
53
54  static getStatusBarNotificationIconStyle(): StatusBarNotificationIconStyle {
55    const key: string = TAG + '-StatusBarNotificationIcon';
56    return CommonStyleManager.getStyle(key, StatusBarNotificationIconStyle);
57  }
58
59  static getIconItemComponentStyle(): IconItemComponentStyle {
60    const key: string = TAG + '-IconItemComponent';
61    return CommonStyleManager.getStyle(key, IconItemComponentStyle);
62  }
63
64  static getPluginIconItemComponentStyle(): PluginIconItemComponentStyle {
65    const key: string = TAG + '-PluginIconItemComponent';
66    return CommonStyleManager.getStyle(key, PluginIconItemComponentStyle);
67  }
68}