• 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@Component
17export struct LoadingPanel {
18    @Consume isLoading: boolean;
19
20    build() {
21        if (this.isLoading) {
22            Column() {
23                Column() {
24                    LoadingProgress().width($r('app.float.loading_panel_icon_w'))
25                        .height($r('app.float.loading_panel_icon_w'))
26                        .margin({ bottom: $r('app.float.loading_panel_icon_margin') })
27                    Text($r('app.string.image_loading'))
28                        .fontSize($r('sys.float.ohos_id_text_size_body2'))
29                        .fontFamily($r('app.string.id_text_font_family_regular'))
30                        .fontColor($r('sys.color.ohos_id_color_text_secondary'))
31                }
32            }
33            .width('100%')
34            .height('100%')
35            .padding({ top: $r('app.float.loading_panel_item_gap') })
36            .alignItems(HorizontalAlign.Center)
37            .justifyContent(FlexAlign.Center)
38        }
39    }
40}