1/* 2 * Copyright (c) 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 { Action } from '../../redux/actions/Action' 17import { Log } from '../../utils/Log' 18import { EventBus } from '../../worker/eventbus/EventBus' 19import EventBusManager from '../../worker/eventbus/EventBusManager' 20import getStore from '../../redux/store' 21//import { TabBarOther } from './TabBarTablet/TabBarOther' 22//import { TabBarSame } from './TabBarTablet/TabBarSame' 23 24let tabBarLandState = (state) => { 25 return { 26// widthTabBar: state.PreviewReducer.widthTabBar, 27// opacityValueForTabBar: state.SettingReducer.opacityValueForTabBar 28 isThirdPartyCall: state.ContextReducer.isThirdPartyCall 29 } 30} 31 32let tabBarLandDispatcher = (dispatch) => { 33 return { 34 showSettingView: () => { 35 dispatch(Action.showSettingView(true)) 36 }, 37 } 38} 39 40@Component 41export struct TabBarLand { 42 private TAG: string = '[TabBarLand]' 43 @State state: any = {} 44 @State opacityTabBar: number = 0 45 @State isShowTabBarOther: boolean= false 46 @Link screenSize: any 47 private onBackClicked:Function 48 appEventBus: EventBus = EventBusManager.getInstance().getEventBus() 49 50 aboutToAppear(): void { 51 Log.info(`${this.TAG} aboutToAppear invoke E`) 52 getStore().connect(tabBarLandState, tabBarLandDispatcher)(this.state) 53 Log.info(`${this.TAG} aboutToAppear invoke X`) 54 } 55 56 build() { 57 Flex({ direction: FlexDirection.ColumnReverse, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Start }) { 58 if (this.state.isThirdPartyCall) { 59 Row() { 60 Image($r("app.media.ic_public_back")).width(24).height(24) 61 .onClick(() => { 62 this.onBackClicked() 63 }) 64 }.width(48).height(48) 65 .padding({left: 12}) 66 .margin({ bottom: 12 }) 67 } 68 69 Row() { 70 Image($r("app.media.setting")).width(24).height(24) 71 .onClick(() => { 72 this.state.showSettingView() 73 }) 74 }.width(48).height(48) 75 .padding({ left: 12 }) 76 .position(this.state.isThirdPartyCall ? {x:0,y:12} : {x:0,y: this.screenSize.height - 144}) 77 // Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { 78 // TabBarOther() 79 // }.width('100%').height('20%') 80 // .opacity(this.state.opacityValueForTabBar) 81 // .animation({ 82 // duration: 2000, 83 // curve: Curve.Sharp, 84 // delay: 0, 85 // iterations: 1, 86 // playMode: PlayMode.Normal 87 // }) 88 // 89 // Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { 90 // TabBarSame() 91 // } 92 // .position({ y: this.state.widthTabBar }) 93 // .width('100%') 94 // .height('20%') 95 // .animation({ 96 // duration: 2000, 97 // curve: Curve.Sharp, 98 // delay: 0, 99 // iterations: 1, 100 // playMode: PlayMode.Normal 101 // }) 102 }.width(48).height('100%') 103 } 104}