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 EnvironmentProp from '../../feature/EnvironmentProp'; 17 18@Component 19export struct CallLogTabs { 20 private controller: TabsController 21 @Link bottomTabIndex: number 22 @LocalStorageProp('breakpoint') curBp: string = 'sm' 23 24 build() { 25 Row() { 26 Column() { 27 Text($r("app.string.all_call_logs")) 28 .fontSize($r("app.float.contact_text_size_body1")) 29 .lineHeight('22vp') 30 .fontColor(this.bottomTabIndex == 0 ? 31 $r('sys.color.ohos_id_color_connected') : $r('sys.color.ohos_id_color_text_secondary')) 32 .fontWeight(this.bottomTabIndex == 0 ? FontWeight.Medium : FontWeight.Regular) 33 .margin({ top: 17, bottom: 6 }) 34 35 Row() 36 .width($r("app.float.id_item_height_max")) 37 .height($r("app.float.id_card_margin_sm")) 38 .backgroundColor($r('sys.color.ohos_id_color_connected')) 39 .visibility(this.bottomTabIndex == 0 ? Visibility.Visible : Visibility.None) 40 .borderRadius($r("app.float.id_card_margin_sm")) 41 } 42 .width(this.curBp === 'lg' ? '84vp' : '78vp') 43 .height($r("app.float.id_item_height_large")) 44 .margin(this.curBp === 'lg' ? { right: 50 } : { right: 31 }) 45 .onClick(() => { 46 if (this.bottomTabIndex != 0) { 47 this.controller.changeIndex(0) 48 } 49 }) 50 51 Column() { 52 Text($r("app.string.missed_call")) 53 .fontSize($r("app.float.contact_text_size_body1")) 54 .lineHeight('22vp') 55 .fontColor(this.bottomTabIndex == 1 ? 56 $r('sys.color.ohos_id_color_connected') : $r('sys.color.ohos_id_color_text_secondary')) 57 .fontWeight(this.bottomTabIndex == 1 ? FontWeight.Medium : FontWeight.Regular) 58 .margin({ top: 17, bottom: 6 }) 59 60 Row() 61 .width($r("app.float.id_item_height_max")) 62 .height($r("app.float.id_card_margin_sm")) 63 .backgroundColor($r('sys.color.ohos_id_color_connected')) 64 .visibility(this.bottomTabIndex == 1 ? Visibility.Visible : Visibility.None) 65 .borderRadius($r("app.float.id_card_margin_sm")) 66 } 67 .width(this.curBp === 'lg' ? '84vp' : '78vp') 68 .height($r("app.float.id_item_height_large")) 69 .onClick(() => { 70 if (this.bottomTabIndex != 1) { 71 this.controller.changeIndex(1) 72 } 73 }) 74 } 75 .justifyContent(FlexAlign.Center) 76 .width('100%') 77 .height($r("app.float.id_item_height_large")) 78 .zIndex(3) 79 } 80}