• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-2023 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_NG_PATTERNS_TEXT_PICKER_TEXT_PICKER_COLUMN_PATTERN_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_TEXT_PICKER_TEXT_PICKER_COLUMN_PATTERN_H
18 
19 #include <optional>
20 
21 #include "adapter/ohos/entrance/picker/picker_haptic_interface.h"
22 #include "core/components/common/properties/color.h"
23 #include "core/components/picker/picker_theme.h"
24 #include "core/components_ng/pattern/linear_layout/linear_layout_pattern.h"
25 #include "core/components_ng/pattern/picker/picker_type_define.h"
26 #include "core/components_ng/pattern/picker_utils/picker_column_pattern_utils.h"
27 #include "core/components_ng/pattern/text/text_layout_property.h"
28 #include "core/components_ng/pattern/text_picker/textpicker_accessibility_property.h"
29 #include "core/components_ng/pattern/text_picker/textpicker_event_hub.h"
30 #include "core/components_ng/pattern/text_picker/textpicker_layout_algorithm.h"
31 #include "core/components_ng/pattern/text_picker/textpicker_layout_property.h"
32 #include "core/components_ng/pattern/text_picker/textpicker_overscroll.h"
33 #include "core/components_ng/pattern/text_picker/textpicker_paint_method.h"
34 #include "core/components_ng/pattern/text_picker/toss_animation_controller.h"
35 #ifdef SUPPORT_DIGITAL_CROWN
36 #include "core/event/crown_event.h"
37 #endif
38 
39 namespace OHOS::Ace::NG {
40 using EventCallback = std::function<void(bool)>;
41 using ColumnChangeCallback = std::function<void(const RefPtr<FrameNode>&, bool, uint32_t, bool)>;
42 
43 struct TextProperties {
44     Dimension upFontSize;
45     Dimension fontSize;
46     Dimension downFontSize;
47     Color upColor;
48     Color currentColor;
49     Color downColor;
50     FontWeight upFontWeight;
51     FontWeight fontWeight;
52     FontWeight downFontWeight;
53 };
54 
55 struct TextPickerOptionProperty {
56     float height = 0.0f;
57     float fontheight = 0.0f;
58     float prevDistance = 0.0f; // between the prev item and itself when scroll up
59     float nextDistance = 0.0f; // between the next item and itself when scroll down
60 };
61 
62 class EventParam : public virtual AceType {
63     DECLARE_ACE_TYPE(EventParam, AceType);
64 
65 public:
66     WeakPtr<FrameNode> instance;
67     int32_t itemIndex = 0;
68     int32_t itemTotalCounts = 0;
69 };
70 
71 enum class ScrollDirection {
72     UP = 0,
73     DOWN,
74 };
75 
76 enum class OptionIndex {
77     COLUMN_INDEX_0 = 0,
78     COLUMN_INDEX_1,
79     COLUMN_INDEX_2,
80     COLUMN_INDEX_3,
81     COLUMN_INDEX_4,
82     COLUMN_INDEX_5,
83     COLUMN_INDEX_6
84 };
85 
86 
87 class TextPickerColumnPattern : public LinearLayoutPattern {
88     DECLARE_ACE_TYPE(TextPickerColumnPattern, LinearLayoutPattern);
89 
90 public:
TextPickerColumnPattern()91     TextPickerColumnPattern() : LinearLayoutPattern(true) {};
~TextPickerColumnPattern()92     ~TextPickerColumnPattern() override
93     {
94         if (circleUtils_) {
95             delete circleUtils_;
96         }
97     }
98 
IsAtomicNode()99     bool IsAtomicNode() const override
100     {
101         return true;
102     }
103 
CreateLayoutAlgorithm()104     RefPtr<LayoutAlgorithm> CreateLayoutAlgorithm() override
105     {
106         auto layoutAlgorithm = MakeRefPtr<TextPickerLayoutAlgorithm>();
107         if (algorithmOffset_.size() == 0) {
108             ResetAlgorithmOffset();
109         }
110         layoutAlgorithm->SetCurrentOffset(algorithmOffset_);
111         layoutAlgorithm->SetDefaultPickerItemHeight(defaultPickerItemHeight_);
112         return layoutAlgorithm;
113     }
114 
CreateLayoutProperty()115     RefPtr<LayoutProperty> CreateLayoutProperty() override
116     {
117         return MakeRefPtr<LinearLayoutProperty>(true);
118     }
119 
120     void FlushCurrentOptions(bool isDown = false, bool isUpdateTextContentOnly = false, bool isDirectlyClear = false,
121         bool isUpdateAnimationProperties = false);
122 
123     void InitilaScorllEvent();
124 
125     void UpdateCurrentOffset(float offset);
126 
127     void UpdateColumnChildPosition(double offsetY);
128 
GetOverscroller()129     TextPickerOverscroller& GetOverscroller()
130     {
131         return overscroller_;
132     }
133 
134     bool CanMove(bool isDown) const;
135 
136     bool NotLoopOptions() const;
137 
138     bool InnerHandleScroll(bool isDown, bool isUpdatePropertiesOnly = false, bool isUpdateAnimationProperties = false);
139 
SetDefaultPickerItemHeight(double defaultPickerItemHeight)140     void SetDefaultPickerItemHeight(double defaultPickerItemHeight)
141     {
142         defaultPickerItemHeight_ = defaultPickerItemHeight;
143     }
144 
145     uint32_t GetShowOptionCount() const;
146 
147     std::string GetSelectedObject(bool isColumnChange, int32_t status = 0) const;
148 
SetSelected(uint32_t value)149     void SetSelected(uint32_t value)
150     {
151         selectedIndex_ = value;
152     }
GetSelected()153     uint32_t GetSelected() const
154     {
155         return selectedIndex_;
156     }
157 
SetRange(const std::vector<std::string> & value)158     void SetRange(const std::vector<std::string>& value)
159     {
160         if (value.empty()) {
161             return;
162         }
163         range_ = value;
164     }
165 
GetRange()166     const std::vector<std::string>& GetRange() const
167     {
168         return range_;
169     }
170 
GetCurrentText()171     std::string GetCurrentText() const
172     {
173         return GetOption(GetCurrentIndex());
174     }
175 
GetCurrentIndex()176     uint32_t GetCurrentIndex() const
177     {
178         return currentIndex_;
179     }
SetCurrentIndex(uint32_t value)180     void SetCurrentIndex(uint32_t value)
181     {
182         if (value != currentIndex_) {
183             isIndexChanged_ = true;
184             currentIndex_ = value;
185         }
186     }
187 
GetOptionCount()188     uint32_t GetOptionCount() const
189     {
190         return options_.size();
191     }
192 
GetOption(uint32_t index)193     std::string GetOption(uint32_t index) const
194     {
195         if (index >= GetOptionCount()) {
196             return "";
197         }
198         return options_[index].text_;
199     }
200 
SetOptions(std::vector<NG::RangeContent> & value)201     void SetOptions(std::vector<NG::RangeContent>& value)
202     {
203         options_.clear();
204         for (auto& content : value) {
205             options_.emplace_back(content);
206         }
207     }
208 
ClearOptions()209     void ClearOptions()
210     {
211         options_.clear();
212     }
213 
SetColumnKind(int32_t kind)214     void SetColumnKind(int32_t kind)
215     {
216         columnKind_ = kind;
217     }
218 
GetCurrentOffset()219     float GetCurrentOffset() const
220     {
221         return deltaSize_;
222     }
223 
SetCurrentOffset(float deltaSize)224     void SetCurrentOffset(float deltaSize)
225     {
226         deltaSize_ = deltaSize;
227     }
228 
GetToss()229     const RefPtr<TextPickerTossAnimationController>& GetToss() const
230     {
231         return tossAnimationController_;
232     }
233 
HandleEventCallback(bool refresh)234     void HandleEventCallback(bool refresh)
235     {
236         if (EventCallback_) {
237             EventCallback_(refresh);
238         }
239     }
240 
GetEventCallback()241     const EventCallback& GetEventCallback() const
242     {
243         return EventCallback_;
244     }
245 
SetEventCallback(EventCallback && value)246     void SetEventCallback(EventCallback&& value)
247     {
248         EventCallback_ = value;
249     }
250 
HandleScrollStopEventCallback(bool refresh)251     void HandleScrollStopEventCallback(bool refresh)
252     {
253         if (scrollStopEventCallback_) {
254             scrollStopEventCallback_(refresh);
255         }
256     }
257 
GetScrollStopEventCallback()258     const EventCallback& GetScrollStopEventCallback() const
259     {
260         return scrollStopEventCallback_;
261     }
262 
SetScrollStopEventCallback(EventCallback && value)263     void SetScrollStopEventCallback(EventCallback&& value)
264     {
265         scrollStopEventCallback_ = value;
266     }
267 
GetEnterText()268     std::string GetEnterText() const
269     {
270         return GetOption(GetEnterIndex());
271     }
272 
GetEnterIndex()273     uint32_t GetEnterIndex() const
274     {
275         return currentEnterIndex_;
276     }
277 
SetEnterIndex(uint32_t value)278     void SetEnterIndex(uint32_t value)
279     {
280         if (value != currentEnterIndex_) {
281             currentEnterIndex_ = value;
282         }
283     }
284 
HandleEnterSelectedAreaEventCallback(bool refresh)285     void HandleEnterSelectedAreaEventCallback(bool refresh)
286     {
287         if (enterSelectedAreaEventCallback_) {
288             enterSelectedAreaEventCallback_(refresh);
289         }
290     }
291 
GetEnterSelectedAreaEventCallback()292     const EventCallback& GetEnterSelectedAreaEventCallback() const
293     {
294         return enterSelectedAreaEventCallback_;
295     }
296 
SetEnterSelectedAreaEventCallback(EventCallback && value)297     void SetEnterSelectedAreaEventCallback(EventCallback&& value)
298     {
299         enterSelectedAreaEventCallback_ = value;
300     }
301 
SetLocalDownDistance(float value)302     void SetLocalDownDistance(float value)
303     {
304         localDownDistance_ = value;
305     }
306 
GetLocalDownDistance()307     float GetLocalDownDistance() const
308     {
309         return localDownDistance_;
310     }
311 
312     void UpdateToss(double offsetY);
313 
314     void TossStoped();
315 
316     void UpdateScrollDelta(double delta);
317 
CreateAccessibilityProperty()318     RefPtr<AccessibilityProperty> CreateAccessibilityProperty() override
319     {
320         return MakeRefPtr<TextPickerAccessibilityProperty>();
321     }
322 
SetChangeCallback(ColumnChangeCallback && value)323     void SetChangeCallback(ColumnChangeCallback&& value)
324     {
325         changeCallback_ = value;
326     }
327 
HandleChangeCallback(bool isAdd,bool needNotify)328     void HandleChangeCallback(bool isAdd, bool needNotify)
329     {
330         if (changeCallback_) {
331             changeCallback_(GetHost(), isAdd, GetCurrentIndex(), needNotify);
332         }
333     }
334 
GetHalfDisplayCounts()335     int32_t GetHalfDisplayCounts() const
336     {
337         return halfDisplayCounts_;
338     }
339 
GetOffset()340     double GetOffset() const
341     {
342         return offsetCurSet_;
343     }
344 
SetYLast(double value)345     void SetYLast(double value)
346     {
347         yLast_ = value;
348     }
349 
350     void TossAnimationStoped();
351 
352     void PlayResetAnimation();
353 
GetMidShiftDistance()354     std::vector<TextPickerOptionProperty> GetMidShiftDistance() const
355     {
356         return optionProperties_;
357     }
358 
SetMainVelocity(double mainVelocity)359     void SetMainVelocity(double mainVelocity)
360     {
361         mainVelocity_ = mainVelocity;
362     }
363 
GetMainVelocity()364     double GetMainVelocity() const
365     {
366         return mainVelocity_;
367     }
368 
SetTossStatus(bool status)369     void SetTossStatus(bool status)
370     {
371         isTossStatus_ = status;
372         if (!status && NotLoopOptions() && !pressed_ && !isReboundInProgress_ && overscroller_.IsOverScroll()) {
373             // Start rebound animation when toss stoped
374             CreateReboundAnimation(overscroller_.GetOverScroll(), 0.0);
375             HandleScrollStopEventCallback(true);
376         }
377     }
378 
GetTossStatus()379     bool GetTossStatus() const
380     {
381         return isTossStatus_;
382     }
383 
SetYOffset(double value)384     void SetYOffset(double value)
385     {
386         yOffset_ = value;
387     }
388 
GetTouchBreakStatus()389     bool GetTouchBreakStatus() const
390     {
391         return touchBreak_;
392     }
393 
NeedResetOptionPropertyHeight(bool needOptionPropertyHeightReset)394     void NeedResetOptionPropertyHeight(bool needOptionPropertyHeightReset)
395     {
396         needOptionPropertyHeightReset_ = needOptionPropertyHeightReset;
397     }
398 
isHover()399     bool isHover() const
400     {
401         return isHover_;
402     }
403 
404     int32_t GetOverScrollDeltaIndex() const;
405     void SetCanLoop(bool isLoop);
406 
407     void ResetOptionPropertyHeight();
408     void ResetTotalDelta();
409     void InitHapticController(const RefPtr<FrameNode>& host);
410 
SetDisableTextStyleAnimation(bool value)411     void SetDisableTextStyleAnimation(bool value)
412     {
413         isDisableTextStyleAnimation_ = value;
414     }
415     void UpdateColumnButtonFocusState(bool haveFocus, bool needMarkDirty);
416     void StopHapticController();
417     void SetSelectedMarkListener(std::function<void(int& selectedColumnId)>& listener);
418     void SetSelectedMark(bool focus = true, bool notify = true, bool reRender = true);
419     void SetSelectedMarkId(const int strColumnId);
420     void UpdateUserSetSelectColor(void);
421     void StopHaptic();
422     void HandleAccessibilityTextChange();
423 #ifdef SUPPORT_DIGITAL_CROWN
424     int32_t& GetSelectedColumnId();
425     bool IsCrownEventEnded();
426     int32_t GetDigitalCrownSensitivity();
427     void SetDigitalCrownSensitivity(int32_t crownSensitivity);
428     bool OnCrownEvent(const CrownEvent& event);
429 #endif
430 
431 private:
432     void OnModifyDone() override;
433     void OnAttachToFrameNode() override;
434     void OnDetachFromFrameNode(FrameNode* frameNode) override;
435     void OnAttachToMainTree() override;
436     void OnDetachFromMainTree() override;
437 
OnAttachToFrameNodeMultiThread()438     void OnAttachToFrameNodeMultiThread() {}
OnDetachFromFrameNodeMultiThread(FrameNode * frameNode)439     void OnDetachFromFrameNodeMultiThread(FrameNode* frameNode) {}
440     void OnAttachToMainTreeMultiThread();
441     void OnDetachFromMainTreeMultiThread();
442 
443     bool OnDirtyLayoutWrapperSwap(const RefPtr<LayoutWrapper>& dirty, const DirtySwapConfig& config) override;
444     void InitSelectorButtonProperties(const RefPtr<PickerTheme>& pickerTheme);
445     void UpdateSelectorButtonProps(bool haveFocus, bool needMarkDirty);
446     const Color& GetButtonHoverColor() const;
447     void UpdateTextAreaPadding(const RefPtr<PickerTheme>& pickerTheme,
448         const RefPtr<TextLayoutProperty>& textLayoutProperty);
449 
450     bool OnKeyEvent(const KeyEvent& event);
451     bool HandleDirectionKey(KeyCode code);
452     void SetSelectedMarkPaint(bool paint);
453     void UpdateSelectedTextColor(const RefPtr<PickerTheme>& pickerTheme);
454     void InitTextHeightAndFontHeight(uint32_t childIndex, uint32_t midIndex, TextPickerOptionProperty &prop);
455     void UpdateAnimationColor(const RefPtr<PickerTheme>& pickerTheme);
456 #ifdef SUPPORT_DIGITAL_CROWN
457     void HandleCrownBeginEvent(const CrownEvent& event);
458     void HandleCrownMoveEvent(const CrownEvent& event);
459     void HandleCrownEndEvent(const CrownEvent& event);
460 #endif
461     void InitPanEvent(const RefPtr<GestureEventHub>& gestureHub);
462     void HandleDragStart(const GestureEvent& event);
463     void HandleDragMove(const GestureEvent& event);
464     void HandleDragEnd();
465     void CreateAnimation();
466     void CreateAnimation(double from, double to);
467     void CreateReboundAnimation(double from, double to);
468     void ScrollOption(double delta);
469     std::vector<TextPickerOptionProperty> optionProperties_;
470     std::vector<int32_t> algorithmOffset_;
471     void ResetAlgorithmOffset();
472     void CalcAlgorithmOffset(ScrollDirection dir, double distancePercent);
473     void SetOptionShiftDistance();
474     void SetOptionShiftDistanceByIndex(int32_t index, const bool isLandscape);
475     double GetShiftDistanceForLandscape(int32_t index, ScrollDirection dir);
476     double GetShiftDistance(int32_t index, ScrollDirection dir);
477     double GetSelectedDistance(int32_t index, int32_t nextIndex, ScrollDirection dir);
478     double GetUpCandidateDistance(int32_t index, int32_t nextIndex, ScrollDirection dir);
479     double GetDownCandidateDistance(int32_t index, int32_t nextIndex, ScrollDirection dir);
480     void OnTouchDown();
481     void OnTouchUp();
482     void ParseTouchListener();
483     void ParseMouseEvent();
484     void InitMouseAndPressEvent();
485     void HandleMouseEvent(bool isHover);
486     void SetButtonBackgroundColor(const Color& pressColor);
487     void PlayPressAnimation(const Color& pressColor);
488     void FlushCurrentTextOptions(const RefPtr<TextPickerLayoutProperty>& textPickerLayoutProperty,
489         bool isUpdateTextContentOnly, bool isDirectlyClear);
490     void FlushCurrentImageOptions();
491     void FlushCurrentMixtureOptions(
492         const RefPtr<TextPickerLayoutProperty>& textPickerLayoutProperty, bool isUpdateTextContentOnly);
493     void UpdatePickerTextProperties(const RefPtr<TextLayoutProperty>& textLayoutProperty,
494         const RefPtr<TextPickerLayoutProperty>& textPickerLayoutProperty, uint32_t currentIndex, uint32_t middleIndex,
495         uint32_t showCount);
496     void UpdateSelectedTextProperties(const RefPtr<PickerTheme>& pickerTheme,
497         const RefPtr<TextLayoutProperty>& textLayoutProperty,
498         const RefPtr<TextPickerLayoutProperty>& textPickerLayoutProperty);
499     void UpdateCandidateTextProperties(const RefPtr<PickerTheme>& pickerTheme,
500         const RefPtr<TextLayoutProperty>& textLayoutProperty,
501         const RefPtr<TextPickerLayoutProperty>& textPickerLayoutProperty);
502     void UpdateDisappearTextProperties(const RefPtr<PickerTheme>& pickerTheme,
503         const RefPtr<TextLayoutProperty>& textLayoutProperty,
504         const RefPtr<TextPickerLayoutProperty>& textPickerLayoutProperty);
505     void AddAnimationTextProperties(uint32_t currentIndex, const RefPtr<TextLayoutProperty>& textLayoutProperty);
506     void UpdateTextPropertiesLinear(bool isDown, double scale);
507     void TextPropertiesLinearAnimation(const RefPtr<TextLayoutProperty>& textLayoutProperty, uint32_t index,
508         uint32_t showCount, bool isDown, double scale);
509     void SetSelectColor(const RefPtr<TextLayoutProperty>& textLayoutProperty,
510         const Color& startColor, const Color& endColor, const float& percent, bool isEqual);
511     void FlushAnimationTextProperties(bool isDown);
512     Dimension LinearFontSize(const Dimension& startFontSize, const Dimension& endFontSize, double percent);
513     void ClearCurrentTextOptions(const RefPtr<TextPickerLayoutProperty>& textPickerLayoutProperty,
514         bool isUpdateTextContentOnly, bool isDirectlyClear);
515     void UpdateDefaultTextProperties(const RefPtr<TextLayoutProperty>& textLayoutProperty,
516         const RefPtr<TextPickerLayoutProperty>& textPickerLayoutProperty, uint32_t currentIndex, uint32_t middleIndex);
517 
518     RefPtr<TextPickerLayoutProperty> GetParentLayout() const;
519     RefPtr<TouchEventImpl> CreateItemTouchEventListener();
520     void OnAroundButtonClick(RefPtr<EventParam> param);
521     void OnMiddleButtonTouchDown();
522     void OnMiddleButtonTouchMove();
523     void OnMiddleButtonTouchUp();
524     int32_t GetMiddleButtonIndex();
525 
526     bool touchEventInit_ = false;
527     RefPtr<InputEvent> CreateMouseHoverEventListener(RefPtr<EventParam> param);
528     RefPtr<ClickEvent> CreateItemClickEventListener(RefPtr<EventParam> param);
529     void SetAccessibilityAction();
530 
531     void InitTextFontFamily();
532     bool SpringCurveTailMoveProcess(bool useRebound, double& dragDelta);
533     void SpringCurveTailEndProcess(bool useRebound, bool stopMove);
534     void UpdateTextAccessibilityProperty(
535         int32_t virtualIndex, std::list<RefPtr<UINode>>::iterator& iter, bool virtualIndexValidate);
536     void OnWindowHide() override;
537     void OnWindowShow() override;
538 
539     void InitTextFadeOut();
540     void UpdateTextOverflow(bool isSel, const RefPtr<TextLayoutProperty>& textLayoutProperty);
541     double GetDragDeltaLessThanJumpInterval(
542         double offsetY, float originalDragDelta, bool useRebound, float shiftDistance);
543     void RegisterWindowStateChangedCallback();
544     void UnregisterWindowStateChangedCallback(FrameNode* frameNode);
545 
546     void HandleEnterSelectedArea(double scrollDelta, float shiftDistance, ScrollDirection dir);
547     bool IsDisableTextStyleAnimation() const;
548 
549     bool isFocusColumn_ = false;
550     bool isTextFadeOut_ = false;
551     float localDownDistance_ = 0.0f;
552     Color pressColor_;
553     Color hoverColor_;
554     Color buttonBgColor_ = Color::TRANSPARENT;
555     Color buttonDefaultBgColor_ = Color::TRANSPARENT;
556     Color buttonFocusBgColor_ = Color::TRANSPARENT;
557     Color buttonDefaultBorderColor_ = Color::TRANSPARENT;
558     Color buttonFocusBorderColor_ = Color::TRANSPARENT;
559     Color selectorTextFocusColor_ = Color::WHITE;
560     Dimension buttonDefaultBorderWidth_ = 0.0_vp;
561     Dimension buttonFocusBorderWidth_ = 0.0_vp;
562     bool isFirstTimeUpdateButtonProps_ = true;
563     bool useButtonFocusArea_ = false;
564     EventCallback EventCallback_;
565     EventCallback scrollStopEventCallback_;
566     EventCallback enterSelectedAreaEventCallback_;
567     RefPtr<ClickEvent> clickEventListener_;
568     bool enabled_ = true;
569     int32_t focusKeyID_ = 0;
570     RefPtr<TouchEventImpl> touchListener_;
571     bool isPress_ = false;
572     bool isHover_ = false;
573     RefPtr<InputEvent> mouseEvent_;
574     double defaultPickerItemHeight_ = 0.0;
575     uint32_t selectedIndex_ = 0;
576     std::string selectedValue_;
577     std::vector<std::string> range_ { "" };
578     uint32_t currentIndex_ = 0;
579     std::vector<NG::RangeContent> options_;
580     int32_t columnKind_ = TEXT;
581     int32_t currentChildIndex_ = 0;
582     float deltaSize_ = 0.0f;
583     double totalDragDelta_ = 0.0;
584     double yLast_ = 0.0;
585     double yOffset_ = 0.0;
586     double jumpInterval_ = 0.0;
587     Size optionSize_;
588     Dimension fixHeight_;
589     bool isIndexChanged_ = false;
590 
591     RefPtr<PanEvent> panEvent_;
592     bool pressed_ = false;
593     double scrollDelta_ = 0.0;
594     bool animationCreated_ = false;
595     RefPtr<TextPickerTossAnimationController> tossAnimationController_ =
596         AceType::MakeRefPtr<TextPickerTossAnimationController>();
597     RefPtr<NodeAnimatablePropertyFloat> scrollProperty_;
598     RefPtr<NodeAnimatablePropertyFloat> aroundClickProperty_;
599     std::shared_ptr<AnimationUtils::Animation> animation_;
600     std::shared_ptr<AnimationUtils::Animation> reboundAnimation_;
601     std::vector<TextProperties> animationProperties_;
602     float dividerSpacing_ = 0.0f;
603     float gradientHeight_ = 0.0f;
604     bool isReboundInProgress_ = false;
605     TextPickerOverscroller overscroller_;
606     ColumnChangeCallback changeCallback_;
607 
608     int32_t halfDisplayCounts_ = 0;
609 
610     double mainVelocity_ = 0.0;
611     float offsetCurSet_ = 0.0f;
612     float distancePercent_ = 0.0f;
613     bool isTossStatus_ = false;
614     bool clickBreak_ = false;
615     bool touchBreak_ = false;
616     bool animationBreak_ = false;
617     bool needOptionPropertyHeightReset_ = false;
618     bool isLoop_ = true;
619 
620     bool hasAppCustomFont_ = false;
621     bool hasUserDefinedDisappearFontFamily_ = false;
622     bool hasUserDefinedNormalFontFamily_ = false;
623     bool hasUserDefinedSelectedFontFamily_ = false;
624 
625     bool isDisableTextStyleAnimation_ = false;
626     bool isShow_ = true;
627     bool isEnableHaptic_ = true;
628     bool stopHaptic_ = false;
629     bool isHapticPlayOnce_ = true;
630     bool selectedMarkPaint_ = false;
631     std::shared_ptr<IPickerAudioHaptic> hapticController_ = nullptr;
632 
633     uint32_t currentEnterIndex_ = 0;
634     double enterDelta_ = 0.0;
635 
636     ACE_DISALLOW_COPY_AND_MOVE(TextPickerColumnPattern);
637 
638     friend class PickerColumnPatternCircleUtils<TextPickerColumnPattern>;
639     PickerColumnPatternCircleUtils<TextPickerColumnPattern> *circleUtils_ = nullptr;
640     int32_t selectedColumnId_ = -1;
641     std::function<void(int& selectedColumnId)> focusedListerner_ = nullptr;
642     bool isUserSetSelectColor_ = false;
643 #ifdef SUPPORT_DIGITAL_CROWN
644     bool isCrownEventEnded_ = true;
645     int32_t crownSensitivity_ = INVALID_CROWNSENSITIVITY;
646 #endif
647 };
648 } // namespace OHOS::Ace::NG
649 
650 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_TEXT_PICKER_TEXT_PICKER_COLUMN_PATTERN_H
651