• 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 Log from '../../../../../../../../common/src/main/ets/default/Log';
17import {FASlotName} from '../../../../../../../../common/src/main/ets/default/Constants';
18import AirPlaneComponent from "../../../../../../../airplanecomponent/src/main/ets/default/pages/airplaneComponent";
19import WifiComponent from '../../../../../../../wificomponent/src/main/ets/default/pages/wifiComponent';
20import BluetoothComponent from '../../../../../../../bluetoothcomponent/src/main/ets/com/ohos/pages/ControlCenterComplexToggleBluetoothComponent';
21import ComplexToggleComponent from './ComplexToggleComponent';
22
23const TAG = 'ComplexToggleLoadComponent';
24
25@Component
26export default struct ComplexToggleLoadComponent {
27  @State keyId: string = '';
28
29  aboutToAppear() {
30    Log.showInfo(TAG, `aboutToAppear Start, keyId: ${this.keyId}`);
31  }
32
33  aboutToDisappear() {
34    Log.showInfo(TAG, `aboutToDisappear`);
35  }
36
37  build() {
38    Column() {
39      if (this.keyId == FASlotName.WIFI) {
40        WifiComponent()
41      } else if (this.keyId == FASlotName.BLUETOOTH) {
42        BluetoothComponent()
43      } else if (this.keyId == FASlotName.AIR_PLANE) {
44        AirPlaneComponent()
45      } else {
46        ComplexToggleComponent({
47          keyId: this.keyId
48        })
49      }
50    }.width('100%')
51    .height('100%')
52  }
53}