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 #ifndef UI_TEST_VIEW_ZINDEX_H 17 #define UI_TEST_VIEW_ZINDEX_H 18 19 #include "components/ui_scroll_view.h" 20 #include "components/ui_label.h" 21 #include "components/ui_label_button.h" 22 #include "ui_test.h" 23 24 namespace OHOS { 25 class UITestViewZIndex : public UITest, public UIView::OnClickListener, public AnimatorCallback { 26 public: UITestViewZIndex()27 UITestViewZIndex() {} 28 ~UITestViewZIndex(); 29 void SetUp() override; 30 void TearDown() override; 31 const UIView* GetTestView() override; 32 33 void UIKitViewZIndex001(); 34 35 bool OnClick(UIView& view, const ClickEvent& event) override; 36 void Callback(UIView* view) override; 37 38 private: 39 UILabel* CreateTitleLabel() const; 40 UILabel* CreateZIndexLabel(const char* text, int16_t zIndex, ColorType color); 41 UILabelButton* CreateZIndexBtn(const char* text, const char* viewId); 42 void SetupZIndexView(); 43 void SetupZIndexBtn(); 44 void SetupChildModifyBtn(); 45 void SetupChangeView(); 46 void ClickZIndexBtn(UIView& view); 47 void ClickModifyBtn(UIView& view); 48 void UpdateClickHint(UIView& view); 49 UIScrollView* container_ = nullptr; 50 Animator* animator_ = nullptr; 51 }; 52 } // namespace OHOS 53 #endif // UI_TEST_VIEW_ZINDEX_H 54