1 /* 2 * Copyright (c) 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 FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_LIST_LIST_WATCH_LAYOUT_MANAGER_H 17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_LIST_LIST_WATCH_LAYOUT_MANAGER_H 18 19 #include <functional> 20 #include <vector> 21 22 #include "core/components/common/layout/constants.h" 23 #include "core/components/list/list_layout_manager.h" 24 #include "core/components/list/render_list.h" 25 26 namespace OHOS::Ace { 27 28 class ListWatchLayoutManager : public ListLayoutManager { 29 DECLARE_ACE_TYPE(ListWatchLayoutManager, ListLayoutManager); 30 31 public: 32 explicit ListWatchLayoutManager(RenderList& renderList); 33 ~ListWatchLayoutManager() override = default; 34 void PerformLayout() override; 35 36 double AdjustLayoutSize(double size) override; 37 38 protected: 39 void SetChildPosition(const RefPtr<RenderNode>& child, int32_t index, double mainSize) override; 40 41 private: 42 void HandleItemStateAndEffect(); 43 void CalculateItemState(RefPtr<RenderNode>& item); 44 void MarkAllItemBlur(); 45 double GetFirstChildSize(RefPtr<RenderNode>& itemChild); 46 bool IsPlatformFive(); 47 48 double firstChildSize_ = 0.0; 49 double lastChildSize_ = 0.0; 50 }; 51 52 } // namespace OHOS::Ace 53 54 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_LIST_LIST_WATCH_LAYOUT_MANAGER_H 55