• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022-2023 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 router from '@ohos.router';
17import { BrowserConstants } from '@ohos/common';
18import { BrowserController } from '@ohos/common/CommonComponents';
19import { ThirdSelectPhotoBrowserBase } from '@ohos/thirdselect';
20
21// third selection photoBrowser
22@Entry
23@Component
24struct ThirdSelectPhotoBrowser {
25  @State pageStatus: boolean = false;
26  @State isRunningAnimation: boolean = false;
27  @State browserController: BrowserController = new BrowserController(false);
28
29  aboutToAppear() {
30    this.browserController.browserParam = router.getParams();
31  }
32
33  onPageShow() {
34    this.pageStatus = true;
35  }
36
37  onPageHide() {
38    this.pageStatus = false;
39  }
40
41  build() {
42    Column() {
43      ThirdSelectPhotoBrowserBase({
44        pageStatus: this.pageStatus,
45        geometryTransitionEnable: false,
46        isRunningAnimation: $isRunningAnimation,
47        browserController: this.browserController
48      })
49    }
50  }
51
52  pageTransition() {
53    PageTransitionEnter({ type: RouteType.None, duration: BrowserConstants.PAGE_SHOW_ANIMATION_DURATION })
54      .opacity(0)
55    PageTransitionExit({ duration: BrowserConstants.PAGE_SHOW_ANIMATION_DURATION })
56      .opacity(0)
57  }
58}
59