• 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@Component
19export struct BackgroundTaskHomeView {
20  build() {
21    Row() {
22      Column() {
23        Text($r('app.string.background_task'))
24          .fontSize(30)
25          .fontWeight(FontWeight.Bold)
26          .margin({ top: 30 })
27
28        Button($r('app.string.transient_task'))
29          .width('80%')
30          .fontSize(18)
31          .margin({ top: 30 })
32          .onClick(() => {
33            router.pushUrl({ url: 'pages/backgroundTask/TransientTask' });
34          })
35        Button($r('app.string.long_term_task'))
36          .width('80%')
37          .fontSize(18)
38          .margin({ top: 30 })
39          .onClick(() => {
40            router.pushUrl({ url: 'pages/backgroundTask/LongTermTask' });
41          })
42      }
43      .width('100%')
44      .height('100%')
45    }
46    .height('100%')
47  }
48}