• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 ? $r('sys.color.ohos_id_color_connected') : $r('sys.color.ohos_id_color_text_secondary'))
31          .fontWeight(this.bottomTabIndex == 0 ? FontWeight.Medium : FontWeight.Regular)
32          .margin({ top: 17, bottom: 6 })
33
34        Row()
35          .width($r("app.float.id_item_height_max"))
36          .height($r("app.float.id_card_margin_sm"))
37          .backgroundColor($r('sys.color.ohos_id_color_connected'))
38          .visibility(this.bottomTabIndex == 0 ? Visibility.Visible : Visibility.None)
39          .borderRadius($r("app.float.id_card_margin_sm"))
40      }
41      .width(this.curBp === 'lg' ? '84vp' : '78vp')
42      .height($r("app.float.id_item_height_large"))
43      .margin(this.curBp === 'lg' ? { right: 50 } : { right: 31 })
44      .onClick(() => {
45        if (this.bottomTabIndex != 0) {
46          this.controller.changeIndex(0)
47        }
48      })
49
50      Column() {
51        Text($r("app.string.missed_call"))
52          .fontSize($r("app.float.contact_text_size_body1"))
53          .lineHeight('22vp')
54          .fontColor(this.bottomTabIndex == 1 ? $r('sys.color.ohos_id_color_connected') : $r('sys.color.ohos_id_color_text_secondary'))
55          .fontWeight(this.bottomTabIndex == 1 ? FontWeight.Medium : FontWeight.Regular)
56          .margin({ top: 17, bottom: 6 })
57
58        Row()
59          .width($r("app.float.id_item_height_max"))
60          .height($r("app.float.id_card_margin_sm"))
61          .backgroundColor($r('sys.color.ohos_id_color_connected'))
62          .visibility(this.bottomTabIndex == 1 ? Visibility.Visible : Visibility.None)
63          .borderRadius($r("app.float.id_card_margin_sm"))
64      }
65      .width(this.curBp === 'lg' ? '84vp' : '78vp')
66      .height($r("app.float.id_item_height_large"))
67      .onClick(() => {
68        if (this.bottomTabIndex != 1) {
69          this.controller.changeIndex(1)
70        }
71      })
72    }
73    .justifyContent(FlexAlign.Center)
74    .width('100%')
75    .height($r("app.float.id_item_height_large"))
76    .zIndex(3)
77  }
78}