• 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@CustomDialog
17export struct RemoveDialog {
18  private cardName: string = ''
19  private controller: CustomDialogController
20  private confirm: () => void = () => {
21  }
22
23  build() {
24    Column() {
25      Row() {
26        Text($r('app.string.whether_to_remove'))
27          .fontSize(17)
28          .fontColor(Color.Black)
29          .fontWeight(FontWeight.Bold)
30        Text(this.cardName)
31          .fontSize(17)
32          .fontColor(Color.Black)
33          .fontWeight(FontWeight.Bold)
34        Text($r('app.string.card'))
35          .fontSize(17)
36          .fontColor(Color.Black)
37          .fontWeight(FontWeight.Bold)
38      }
39      .margin({ top: 10 })
40
41      Text($r('app.string.card_remove_message'))
42        .fontSize(16)
43        .fontColor(Color.Black)
44        .fontWeight(FontWeight.Medium)
45        .margin({ top: 10 })
46      Row() {
47        Button($r('app.string.cancel'))
48          .layoutWeight(7)
49          .fontColor(Color.Blue)
50          .backgroundColor(Color.White)
51          .margin(5)
52          .onClick(() => {
53            this.controller.close()
54          })
55        Divider()
56          .width(1).height(35)
57          .backgroundColor('#8F8F8F')
58        Button($r('app.string.remove'))
59          .layoutWeight(7)
60          .fontColor(Color.Red)
61          .backgroundColor(Color.White)
62          .margin(5)
63          .onClick(() => {
64            this.controller.close()
65            this.confirm()
66          })
67      }
68      .margin({ top: 10 })
69    }
70    .width('80%')
71    .borderRadius(15)
72    .padding(16)
73    .backgroundColor(Color.White)
74  }
75}