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