• 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 { ItemComponentData, FilterData
17} from '../../../../../../../../common/src/main/ets/plugindatasource/common/Constants';
18
19export default class Constants {
20  static readonly TOUCHTYPE_DOWN = 0;
21  static readonly TOUCHTYPE_UP = 1;
22  static readonly TOUCHTYPE_MOVE = 2;
23  static readonly TOGGLE_TYPE_COMPLEX = 'complex';
24  static readonly TOGGLE_TYPE_SIMPLE = 'simple';
25  static readonly COMPLEX_TOGGLE_GRID_ROW_HEIGHT = vp2px(132);
26  static readonly COMPLEX_TOGGLE_GRID_ROW_GAP = vp2px(24);
27  static readonly SIMPLE_TOGGLE_GRID_ROW_HEIGHT = vp2px(162);
28  static readonly SIMPLE_TOGGLE_GRID_ROW_GAP = vp2px(0);
29  static readonly DEFAULT_SIMPLE_TOGGLE_COLUMN_COUNT = 4;
30  static readonly SIMPLE_TOGGLE_LAYOUT_MAX_TOGGLE_COUNT = 12;
31  static readonly SIMPLE_TOGGLE_LAYOUT_MIN_TOGGLE_COUNT = 1;
32  static readonly CONTROL_CENTER_TITLE_ICON_HOVER_WIDTH = '64vp';
33  static readonly CONTROL_CENTER_TITLE_ICON_HOVER_HEIGHT = '64vp';
34  static readonly CONTROL_CENTER_TITLE_ICON_HOVER_RADIUS = '16vp';
35  static readonly SIMPLE_TOGGLE_EDIT_DIALOG_DIVIDER_WIDTH = '1vp';
36  static readonly PLUGIN_COMPONENT_OWNER_WANT_KEY = 'ControlCenter_PluginComponentOwnerWant';
37}
38
39export type ControlComponentData = ItemComponentData & {
40  toggleType?: string;
41}
42
43export interface ControlCenterConfig {
44  ComplexToggleLayout: string[];
45  DefaultSimpleToggleLayout: string[];
46  LocalToggles: {
47    ComplexToggles: string[];
48    SimpleToggles: string[];
49  };
50  MetaToggles: FilterData[];
51}
52