• 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 Player {
18  @StorageProp('fontSize') fontSize: number = 0
19
20  build() {
21    Row() {
22      Image($r('app.media.pic_music_cover'))
23        .height(32)
24        .width(32)
25        .borderRadius(5)
26        .margin({ right: 12 })
27      Column() {
28        Text($r('app.string.song_name'))
29          .fontColor('#000000')
30          .fontSize(this.fontSize - 1)
31        Row() {
32          Image($r('app.media.ic_vip'))
33            .height(16)
34            .width(16)
35            .margin({ right: 4 })
36          Text($r('app.string.singer'))
37            .fontColor('#000000')
38            .fontSize(this.fontSize - 4)
39            .opacity(0.38)
40        }
41      }
42      .alignItems(HorizontalAlign.Start)
43
44      Blank()
45      Image($r('app.media.icon_pause'))
46        .height(26)
47        .width(26)
48        .margin({ right: 16 })
49      Image($r('app.media.ic_next'))
50        .height(24)
51        .width(24)
52        .margin({ right: 16 })
53      Image($r('app.media.ic_Music_list'))
54        .height(24)
55        .width(24)
56    }
57    .width('100%')
58    .height(48)
59    .backgroundColor('#F6F9FC')
60    .padding({ left: 16, right: 16 })
61    .position({x: 0,y: '100%'})
62    .translate({x: 0,y: '-100%'})
63  }
64}