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 UIKit_View_Scale_Rotate_Test_Label_001(); 48 void UIKit_View_Scale_Rotate_Test_LabelButton_002(); 49 void UIKit_View_Scale_Rotate_Test_Canvas_003(); 50 void UIKit_View_Scale_Rotate_Test_UIBoxProgress_004(); 51 void UIKit_View_Scale_Rotate_Test_UICircleProgress_005(); 52 void UIKit_View_Scale_Rotate_Test_UIDigitalClock_006(); 53 void UIKit_View_Scale_Rotate_Test_Group_007(); 54 private: 55 const int GROUP_WIDHT = 454; 56 const int GROUP_HEIGHT = 300; 57 const Vector2<float> VIEW_CENTER = {75, 75}; 58 const Vector2<float> GROUP_CENTER = {200, 200}; 59 60 void SetUpLabel(const char* title) const; 61 62 UIScrollView* container_ = nullptr; 63 ListLayout* list_ = nullptr; 64 int16_t angleValue_ = 0; 65 Vector2<float> scaleValue_ = {1.0f, 1.0f}; 66 float scaleStep_ = 0.01f; 67 68 Animator animator_; 69 UILabel* label_ = nullptr; 70 UICanvas* canvas_ = nullptr; 71 UILabelButton* button1_ = nullptr; 72 UIBoxProgress* boxProgress_ = nullptr; 73 UICircleProgress* circleProgress_ = nullptr; 74 UIDigitalClock* dClock_ = nullptr; 75 UIViewGroup* group1_ = nullptr; 76 }; 77 } // namespace OHOS 78 #endif // UI_TEST_BOX_PROGRESS_H 79