1 /*
2  * Copyright (c) 2020-2021 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 UI_TEST_VIEW_SCALE_ROTATE_H
17 #define UI_TEST_VIEW_SCALE_ROTATE_H
18 
19 #include <cstdio>
20 #include "components/ui_arc_label.h"
21 #include "components/ui_box_progress.h"
22 #include "components/ui_button.h"
23 #include "components/ui_canvas.h"
24 #include "components/ui_circle_progress.h"
25 #include "components/ui_digital_clock.h"
26 #include "components/ui_image_view.h"
27 #include "components/ui_label_button.h"
28 #include "components/ui_scroll_view.h"
29 #include "components/ui_slider.h"
30 #include "components/ui_swipe_view.h"
31 #include "gfx_utils/sys_info.h"
32 #include "layout/list_layout.h"
33 #include "ui_test.h"
34 
35 namespace OHOS {
36 class UITestViewScaleRotate : public UITest, public AnimatorCallback {
37 public:
UITestViewScaleRotate()38     UITestViewScaleRotate() : animator_(this, nullptr, 1000, true) // 1000: the animator duration time is 1000ms
39     {
40     }
~UITestViewScaleRotate()41     virtual ~UITestViewScaleRotate() {}
42     void SetUp() override;
43     void TearDown() override;
44     const UIView* GetTestView() override;
45     void Callback(UIView* view) override;
46 
47     void UIKitViewScaleRotateTestLabel001();
48     void UIKitViewScaleRotateTestLabelButton002();
49     void UIKitViewScaleRotateTestCanvas003();
50     void UIKitViewScaleRotateTestUIBoxProgress004();
51     void UIKitViewScaleRotateTestUICircleProgress005();
52     void UIKitViewScaleRotateTestUIDigitalClock006();
53     void UIKitViewScaleRotateTestGroup007();
54 
55 private:
56     const int16_t GROUP_WIDHT = 454;
57     const int16_t GROUP_HEIGHT = 300;
58     const Vector2<float> VIEW_CENTER = {75, 75};
59     const Vector2<float> GROUP_CENTER = {200, 200};
60 
61     void SetUpLabel(const char* title) const;
62 
63     UIScrollView* container_ = nullptr;
64     ListLayout* list_ = nullptr;
65     int16_t angleValue_ = 0;
66     Vector2<float> scaleValue_ = {1.0f, 1.0f};
67     float scaleStep_ = 0.01f;
68 
69     Animator animator_;
70     UILabel* label_ = nullptr;
71     UICanvas* canvas_ = nullptr;
72     UILabelButton* button1_ = nullptr;
73     UIBoxProgress* boxProgress_ = nullptr;
74     UICircleProgress* circleProgress_ = nullptr;
75     UIDigitalClock* dClock_ = nullptr;
76     UIViewGroup* group1_ = nullptr;
77 };
78 } // namespace OHOS
79 #endif // UI_TEST_BOX_PROGRESS_H
80