• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1@Preview
2@Component
3export default struct ApnInfoItem {
4  @Link networkMode: number;
5  title: ResourceStr = '';
6  thisNetworkMode: number = 5
7
8  build() {
9    Column() {
10      Row() {
11        Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
12          Column() {
13            Text(this.title)
14              .fontFamily('HarmonyHeiTi')
15              .fontSize($r('sys.float.ohos_id_text_size_body1'))
16              .fontWeight(FontWeight.Medium)
17              .fontColor($r('sys.color.ohos_id_color_text_primary'))
18              .opacity(this.networkMode == this.thisNetworkMode ? 0.9 : 0.6)
19              .letterSpacing(1)
20              .lineHeight(22)
21              .textAlign(TextAlign.Start)
22          }
23          .width('100%')
24          .alignItems(HorizontalAlign.Start)
25          .margin({ right: 26 })
26
27          Image(this.networkMode == this.thisNetworkMode ? $r('app.media.ic_redio_check') : '')
28            .width(24)
29            .height(24)
30        }
31      }
32    }
33    .height(50)
34    .justifyContent(FlexAlign.Center)
35    .borderRadius(16)
36    .margin({ top: 5, left: 10, right: 10, bottom: 5 })
37    .padding({ left: 10, right: 10 })
38    .onClick(() => {
39      this.networkMode = this.thisNetworkMode
40    })
41  }
42}