@@ -26,12 +26,6 @@ class Component;
26
26
27
27
/* *
28
28
* Scroll or page to bring a target component into view.
29
- *
30
- * This action results in either a kEventScrollTo or kEventPageTo event being fired.
31
- * The following properties are passed with the event:
32
- *
33
- * kCommandPropertyDirection Set to forward/back (only for PageTo)
34
- * kCommandPropertyPosition The scroll position or the page number.
35
29
*/
36
30
class ScrollToAction : public AnimatedScrollAction {
37
31
public:
@@ -62,7 +56,7 @@ class ScrollToAction : public AnimatedScrollAction {
62
56
/* *
63
57
* Called from rootcontext by viewhost during line karaoke.
64
58
* @param timers Timer reference.
65
- * @param align Scroll slignment .
59
+ * @param align Scroll alignment .
66
60
* @param subBounds Bounds within the target to scroll to.
67
61
* @param context Target context.
68
62
* @param target Component to scroll to.
@@ -74,6 +68,25 @@ class ScrollToAction : public AnimatedScrollAction {
74
68
const ContextPtr& context,
75
69
const CoreComponentPtr& target = nullptr );
76
70
71
+ /* *
72
+ * @param timers Timer reference.
73
+ * @param align Scroll alignment.
74
+ * @param subBounds Bounds within the target to scroll to.
75
+ * @param context Target context.
76
+ * @param scrollToSubBounds Scroll to sub-bounds.
77
+ * @param target Component to scroll to.
78
+ * @param duration Scrolling duration.
79
+ * @return The scroll to action or null if it is not needed.
80
+ */
81
+ static std::shared_ptr<ScrollToAction> make (const TimersPtr& timers,
82
+ const CommandScrollAlign& align,
83
+ const Rect & subBounds,
84
+ const ContextPtr& context,
85
+ bool scrollToSubBounds,
86
+ const CoreComponentPtr& target = nullptr ,
87
+ apl_duration_t duration = -1 ,
88
+ bool useSnap = false );
89
+
77
90
/* *
78
91
* Called in order to bring child into view, utilizing snap setting if exists.
79
92
* @param timers Timer reference.
@@ -94,16 +107,10 @@ class ScrollToAction : public AnimatedScrollAction {
94
107
const CoreComponentPtr& scrollableParent,
95
108
apl_duration_t duration);
96
109
97
- private:
98
- static std::shared_ptr<ScrollToAction> make (const TimersPtr& timers,
99
- const CommandScrollAlign& align,
100
- const Rect & subBounds,
101
- const ContextPtr& context,
102
- bool scrollToSubBounds,
103
- const CoreComponentPtr& target = nullptr ,
104
- apl_duration_t duration = 0 ,
105
- bool useSnap = false );
110
+ void freeze () override ;
111
+ bool rehydrate (const RootContext& context) override ;
106
112
113
+ private:
107
114
void start ();
108
115
void pageTo ();
109
116
void scrollTo ();
@@ -113,6 +120,10 @@ class ScrollToAction : public AnimatedScrollAction {
113
120
Rect mSubBounds ;
114
121
bool mScrollToSubBounds ;
115
122
CoreComponentPtr mTarget ;
123
+
124
+ std::string mFrozenContainerId ;
125
+ std::string mFrozenTargetId ;
126
+ size_t mFrozenTargetIndex = -1 ;
116
127
};
117
128
118
129
0 commit comments