• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023 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 router from '@ohos.router'
17
18@Entry
19@Component
20struct VideoListModule {
21  private php: string = (router.getParams() as Record<string, string>)['php']
22  build() {
23    Column({ space: 20 }) {
24      Row() {
25        Button({ type: ButtonType.Normal }) {
26          Text("<")
27            .fontColor(Color.White)
28            .fontSize(28)
29        }
30        .backgroundColor('#00191a32')
31        .padding({ left: 5 })
32        .layoutWeight(1)
33        .onClick(() => {
34          router.pushUrl({
35            url: 'pages/Index'
36          })
37        })
38
39        Text($r("app.string.back"))
40          .fontColor(Color.White)
41          .fontSize(24)
42          .layoutWeight(7)
43          .padding({ right: 10 })
44      }
45      .padding({ top: 5 })
46
47      Column({ space: 20 }) {
48        List({ space: 10 }) {
49          ListItem() {
50            Row() {
51              Image($r("app.media.HapticVideoPreview"))
52                .width("50%")
53                .height(100)
54                .borderRadius(10)
55              Column() {
56                Text($r("app.string.video_list_haptic_video"))
57                  .fontSize(18)
58                  .fontColor(Color.White)
59                Text($r("app.string.video_list_haptic_video_msg"))
60                  .fontSize(16)
61                  .fontColor("#ff837979")
62              }
63              .alignItems(HorizontalAlign.Start)
64              .padding({ left: 5 })
65              .height(100)
66            }
67            .width("95%")
68            .padding({ left: 10 })
69            .backgroundColor("#00002222")
70            .onClick(() => {
71              router.pushUrl({
72                url: "module/VideoPlayModule",
73                params: {
74                  vibrateFileName: "HapticVideo.json",
75                  videoName: 'HapticVideo',
76                  videoSrc: $r("app.media.HapticVideo"),
77                  previewUri: $r("app.media.HapticVideoPreview"),
78                  pages: "VideoListPage",
79                  php: this.php
80                }
81              })
82            })
83          }
84        }
85        .listDirection(Axis.Vertical)
86        .divider({ strokeWidth: 10, color: "#00f3f3f3", startMargin: 20, endMargin: 20 })
87        .height("60%")
88      }
89    }
90    .width('100%')
91    .height('100%')
92    .backgroundColor('#f2191a32')
93  }
94}
95