• 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 Logger from './Logger'
17
18const TAG = '[MyInfoModule]'
19
20@Component
21export default struct MyInfoModule {
22  @State selectContent: Resource = $r("app.string.my_low_mode")
23  @Link vibrationIntensity: string
24
25  build() {
26    Column({ space: 30 }) {
27      Column({ space: 10 }) {
28        Row({ space: 10 }) {
29          Image($r("app.media.set"))
30            .height(20)
31            .width(20)
32          Text($r("app.string.my_settings"))
33            .fontColor(Color.White)
34            .fontSize(20)
35          Text(this.selectContent)
36            .fontSize(16)
37            .fontColor("#ffcbc2c2")
38        }
39        .id('intensitySelect')
40        .height("100%")
41        .width("80%")
42        .onClick(() => {
43          ActionSheet.show({
44            title: $r("app.string.my_settings"),
45            message: $r("app.string.my_select_msg"),
46            autoCancel: true,
47            confirm: {
48              value: $r("app.string.cancel"),
49              action: () => {
50                Logger.info(TAG, 'Get Alert Dialog handled')
51              }
52            },
53            cancel: () => {
54              Logger.info(TAG, 'actionSheet canceled')
55            },
56            alignment: DialogAlignment.Bottom,
57            offset: { dx: 0, dy: -10 },
58            sheets: [
59              {
60                icon: $r("app.media.app_icon"),
61                title: $r("app.string.my_high_mode"),
62                action: () => {
63                  this.selectContent = $r("app.string.my_high_mode")
64                  this.vibrationIntensity = 'H'
65                  Logger.info(TAG, 'Vibration intensity is high')
66                }
67              },
68              {
69                icon: $r("app.media.app_icon"),
70                title: $r("app.string.my_middle_mode"),
71                action: () => {
72                  this.selectContent = $r("app.string.my_middle_mode")
73                  this.vibrationIntensity = 'M'
74                  Logger.info(TAG, 'Vibration intensity is middle')
75                }
76              },
77              {
78                icon: $r("app.media.app_icon"),
79                title: $r("app.string.my_low_mode"),
80                action: () => {
81                  this.selectContent = $r("app.string.my_low_mode")
82                  this.vibrationIntensity = 'L'
83                  Logger.info(TAG, 'Vibration intensity is low')
84                }
85              }
86            ]
87          })
88        })
89        .width("80%")
90
91        Row() {
92        }
93        .height(1)
94        .width("85%")
95        .backgroundColor('#ff404048')
96      }
97
98      Column({ space: 10 }) {
99        Row({ space: 10 }) {
100          Image($r("app.media.Verison"))
101            .width(20)
102            .height(20)
103          Text($r("app.string.my_version"))
104            .fontColor(Color.White)
105            .fontSize(20)
106            .backgroundColor('#cc191a32')
107          Text('v1.0')
108            .fontSize(20)
109            .fontColor("#ff706666")
110        }
111        .width("80%")
112
113        Row() {
114        }
115        .height(1)
116        .width("85%")
117        .backgroundColor("#ff404048")
118      }
119
120      Column({ space: 10 }) {
121        Row({ space: 10 }) {
122          Image($r("app.media.bangzhu"))
123            .width(20)
124            .height(20)
125          Text($r("app.string.my_help"))
126            .fontColor(Color.White)
127            .fontSize(20)
128            .backgroundColor('#cc191a32')
129          Text('Please Waiting!')
130            .fontSize(20)
131            .fontColor("#ff706666")
132        }
133        .width("80%")
134
135        Row() {
136        }
137        .height(1)
138        .width("85%")
139        .backgroundColor("#ff404048")
140      }
141
142      Column({ space: 10 }) {
143        Row({ space: 10 }) {
144          Image($r("app.media.xinxi"))
145            .width(20)
146            .height(20)
147          Text($r("app.string.my_develop"))
148            .fontColor(Color.White)
149            .fontSize(20)
150            .backgroundColor('#cc191a32')
151          Text('Please Waiting!')
152            .fontSize(20)
153            .fontColor("#ff706666")
154        }
155        .width("80%")
156
157        Row() {
158        }
159        .height(1)
160        .width("85%")
161        .backgroundColor("#ff404048")
162      }
163    }
164  }
165}
166