• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 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 #ifndef OHOS_SETTING_ABOUT_ABILITY_SLICE_H
17 #define OHOS_SETTING_ABOUT_ABILITY_SLICE_H
18 
19 #include "ability_info.h"
20 #include "ability_loader.h"
21 #include "ability_slice.h"
22 #include "bundle_manager.h"
23 #include "components/ui_image_view.h"
24 #include "components/ui_label.h"
25 #include "components/ui_label_button.h"
26 #include "components/ui_list.h"
27 #include "components/ui_scroll_view.h"
28 #include "components/ui_toggle_button.h"
29 #include "element_name.h"
30 #include "event_listener.h"
31 #include "gfx_utils/list.h"
32 #include "module_info.h"
33 #include "parameter.h"
34 #include "setting_utils.h"
35 #include "want.h"
36 
37 namespace OHOS {
38 class SettingAboutAbilitySlice : public AbilitySlice {
39 public:
SettingAboutAbilitySlice()40     SettingAboutAbilitySlice()
41         : headView_(nullptr), scrollView_(nullptr), rootView_(nullptr), buttonBackListener_(nullptr) {}
42     virtual ~SettingAboutAbilitySlice();
43 protected:
44     void OnStart(const Want& want) override;
45     void OnInactive() override;
46     void OnActive(const Want& want) override;
47     void OnBackground() override;
48     void OnStop() override;
49 private:
50     void SetItemInfo();
51     void SetButtonListener();
52     void SetScrollItem(int count);
53     void SetScroll();
54     void SetHead();
55 
56     UIViewGroup* headView_;
57     UIScrollView* scrollView_;
58     RootView* rootView_;
59     EventListener *buttonBackListener_;
60     constexpr static int SCROLL_ITEM_NUM = 9;
61     const char *itemInfo_[SCROLL_ITEM_NUM][2];
62     constexpr static int ITEM_X = 0;
63     constexpr static int ITEM_INFO_X = 465;
64     constexpr static int ITEM_INFO_Y = 36;
65 };
66 } // namespace OHOS
67 #endif
68