• 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
16@Component
17export default struct EntryComponent {
18  @Prop appIcon: string = '';
19  @Prop appTitle: string = '';
20
21  build() {
22    Flex({ justifyContent: FlexAlign.SpaceBetween }) {
23      Row() {
24        Image(this.appIcon)
25          .width($r('app.float.wh_value_40'))
26          .height($r('app.float.wh_value_40'))
27          .margin({
28            left: $r('app.float.wh_value_36'),
29            right: $r('app.float.wh_value_16')
30          })
31          .visibility('' === this.appIcon ? Visibility.None : Visibility.Visible)
32          .objectFit(ImageFit.Contain);
33
34        Text(this.appTitle)
35          .fontColor($r('sys.color.ohos_id_color_text_primary'))
36          .fontSize($r('app.float.font_16'))
37          .fontWeight(FontWeight.Medium)
38          .textAlign(TextAlign.Start)
39          .maxLines(3)
40          .textOverflow({ overflow: TextOverflow.Ellipsis })
41      }
42      .alignItems(VerticalAlign.Center)
43      .align(Alignment.Start)
44      .height($r('app.float.wh_value_64'))
45      .width('100%')
46    }
47  }
48}