18779efd5Sopenharmony_ci/**
28779efd5Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
38779efd5Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
48779efd5Sopenharmony_ci * you may not use this file except in compliance with the License.
58779efd5Sopenharmony_ci * You may obtain a copy of the License at
68779efd5Sopenharmony_ci *
78779efd5Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
88779efd5Sopenharmony_ci *
98779efd5Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
108779efd5Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
118779efd5Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
128779efd5Sopenharmony_ci * See the License for the specific language governing permissions and
138779efd5Sopenharmony_ci * limitations under the License.
148779efd5Sopenharmony_ci */
158779efd5Sopenharmony_ci
168779efd5Sopenharmony_ciimport EnvironmentProp from '../../feature/EnvironmentProp';
178779efd5Sopenharmony_ci
188779efd5Sopenharmony_ci@Component
198779efd5Sopenharmony_ciexport struct CallLogTabs {
208779efd5Sopenharmony_ci  private controller: TabsController
218779efd5Sopenharmony_ci  @Link bottomTabIndex: number
228779efd5Sopenharmony_ci  @LocalStorageProp('breakpoint') curBp: string = 'sm'
238779efd5Sopenharmony_ci
248779efd5Sopenharmony_ci  build() {
258779efd5Sopenharmony_ci    Row() {
268779efd5Sopenharmony_ci      Column() {
278779efd5Sopenharmony_ci        Text($r("app.string.all_call_logs"))
288779efd5Sopenharmony_ci          .fontSize($r("app.float.contact_text_size_body1"))
298779efd5Sopenharmony_ci          .lineHeight('22vp')
308779efd5Sopenharmony_ci          .fontColor(this.bottomTabIndex == 0 ?
318779efd5Sopenharmony_ci          $r('sys.color.ohos_id_color_connected') : $r('sys.color.ohos_id_color_text_secondary'))
328779efd5Sopenharmony_ci          .fontWeight(this.bottomTabIndex == 0 ? FontWeight.Medium : FontWeight.Regular)
338779efd5Sopenharmony_ci          .margin({ top: 17, bottom: 6 })
348779efd5Sopenharmony_ci
358779efd5Sopenharmony_ci        Row()
368779efd5Sopenharmony_ci          .width($r("app.float.id_item_height_max"))
378779efd5Sopenharmony_ci          .height($r("app.float.id_card_margin_sm"))
388779efd5Sopenharmony_ci          .backgroundColor($r('sys.color.ohos_id_color_connected'))
398779efd5Sopenharmony_ci          .visibility(this.bottomTabIndex == 0 ? Visibility.Visible : Visibility.None)
408779efd5Sopenharmony_ci          .borderRadius($r("app.float.id_card_margin_sm"))
418779efd5Sopenharmony_ci      }
428779efd5Sopenharmony_ci      .width(this.curBp === 'lg' ? '84vp' : '78vp')
438779efd5Sopenharmony_ci      .height($r("app.float.id_item_height_large"))
448779efd5Sopenharmony_ci      .margin(this.curBp === 'lg' ? { right: 50 } : { right: 31 })
458779efd5Sopenharmony_ci      .onClick(() => {
468779efd5Sopenharmony_ci        if (this.bottomTabIndex != 0) {
478779efd5Sopenharmony_ci          this.controller.changeIndex(0)
488779efd5Sopenharmony_ci        }
498779efd5Sopenharmony_ci      })
508779efd5Sopenharmony_ci
518779efd5Sopenharmony_ci      Column() {
528779efd5Sopenharmony_ci        Text($r("app.string.missed_call"))
538779efd5Sopenharmony_ci          .fontSize($r("app.float.contact_text_size_body1"))
548779efd5Sopenharmony_ci          .lineHeight('22vp')
558779efd5Sopenharmony_ci          .fontColor(this.bottomTabIndex == 1 ?
568779efd5Sopenharmony_ci          $r('sys.color.ohos_id_color_connected') : $r('sys.color.ohos_id_color_text_secondary'))
578779efd5Sopenharmony_ci          .fontWeight(this.bottomTabIndex == 1 ? FontWeight.Medium : FontWeight.Regular)
588779efd5Sopenharmony_ci          .margin({ top: 17, bottom: 6 })
598779efd5Sopenharmony_ci
608779efd5Sopenharmony_ci        Row()
618779efd5Sopenharmony_ci          .width($r("app.float.id_item_height_max"))
628779efd5Sopenharmony_ci          .height($r("app.float.id_card_margin_sm"))
638779efd5Sopenharmony_ci          .backgroundColor($r('sys.color.ohos_id_color_connected'))
648779efd5Sopenharmony_ci          .visibility(this.bottomTabIndex == 1 ? Visibility.Visible : Visibility.None)
658779efd5Sopenharmony_ci          .borderRadius($r("app.float.id_card_margin_sm"))
668779efd5Sopenharmony_ci      }
678779efd5Sopenharmony_ci      .width(this.curBp === 'lg' ? '84vp' : '78vp')
688779efd5Sopenharmony_ci      .height($r("app.float.id_item_height_large"))
698779efd5Sopenharmony_ci      .onClick(() => {
708779efd5Sopenharmony_ci        if (this.bottomTabIndex != 1) {
718779efd5Sopenharmony_ci          this.controller.changeIndex(1)
728779efd5Sopenharmony_ci        }
738779efd5Sopenharmony_ci      })
748779efd5Sopenharmony_ci    }
758779efd5Sopenharmony_ci    .justifyContent(FlexAlign.Center)
768779efd5Sopenharmony_ci    .width('100%')
778779efd5Sopenharmony_ci    .height($r("app.float.id_item_height_large"))
788779efd5Sopenharmony_ci    .zIndex(3)
798779efd5Sopenharmony_ci  }
808779efd5Sopenharmony_ci}