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