• 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 = 'volumepanel-StyleConfiguration';
20
21export class VolumePanelComponentStyle {
22  volumePanelSliderMarginTop: Length = $r('app.float.volume_panel_component_slider_margin_top');
23  volumePanSliderWidth: Length = $r('app.float.volume_panel_component_slider_width');
24  volumePanSliderHeight: Length = $r('app.float.volume_panel_component_slider_height');
25  volumePanelSliderMarginBottom: Length = $r('app.float.volume_panel_component_slider_margin_bottom');
26  volumePanelMutBtnIconSize: Length = $r('app.float.volume_panel_component_mute_btn_icon_size');
27  volumePanelMutBtnIconMarginBottom: Length = $r('app.float.volume_panel_component_mute_btn_icon_margin_bottom');
28  volumePanelMuteBtnHeight: Length = $r('app.float.volume_panel_component_mute_btn_height');
29  volumePanelSettingIconSize: Length = $r('app.float.volume_panel_component_setting_icon_size');
30  volumePanelBackground: ResourceColor = $r('app.color.panel_background');
31  volumePanelSliderBlockColor: ResourceColor = $r('app.color.volume_slider_block_color');
32  volumePanelDividerHeight: number | string = Constants.VOLUME_PANEL_DIVIDER_HEIGHT;
33  volumePanelBorderRadius: Length = $r('app.float.volume_panel_border_radius');
34  volumeDividerWidth: Length = $r('app.float.volume_divider_width');
35  volumeSliderTrackColor: ResourceColor = $r('app.color.volume_slider_track_color');
36  volumeSelectedColor: ResourceColor = $r('app.color.volume_slider_selected_color');
37  volumeButtonBackgroundColor: ResourceColor = $r('app.color.volume_button_background_color');
38  volumePanelRingModeColor: ResourceColor = $r('app.color.volume_ring_mode_color');
39  volumePanelDividerColor: ResourceColor = $r('app.color.volume_divider_color');
40  volumePanelSettingColor: ResourceColor = $r('sys.color.ohos_id_color_secondary');
41  volumePanelSettingButtonSize: Length = $r('app.float.volume_panel_component_setting_btn_icon_size');
42}
43
44export default class StyleConfiguration {
45  static getVolumePanelComponentStyle(): VolumePanelComponentStyle {
46    const key: string = TAG + '-VolumePanelComponent';
47    return CommonStyleManager.getStyle(key, VolumePanelComponentStyle);
48  }
49}