修复链式动效边缘回弹问题

Signed-off-by: yeyinglong_admin <yeyinglong@hisilicon.com>
This commit is contained in:
yeyinglong_admin 2024-08-31 17:16:36 +08:00
parent c35afa8d10
commit c0426aeb6b
2 changed files with 10 additions and 3 deletions

View File

@ -2007,6 +2007,13 @@ void ListPattern::ProcessDragUpdate(float dragOffset, int32_t source)
}
bool overDrag = (source == SCROLL_FROM_UPDATE) && (IsAtTop() || IsAtBottom());
chainAnimation_->SetDelta(-dragOffset, overDrag);
if (source == SCROLL_FROM_UPDATE && GetCanOverScroll()) {
float tempDelta = currentDelta_;
currentDelta_ -= dragOffset;
bool isAtEdge = IsAtTop() || IsAtBottom();
currentDelta_ = tempDelta;
SetCanOverScroll(isAtEdge);
}
}
float ListPattern::GetChainDelta(int32_t index) const

View File

@ -752,6 +752,9 @@ protected:
return scrollOriginChild_.Upgrade();
}
void SetCanOverScroll(bool val);
bool GetCanOverScroll() const;
private:
virtual void OnScrollEndCallback() {};
@ -820,9 +823,6 @@ private:
void ExecuteScrollFrameBegin(float& mainDelta, ScrollState state);
void SetCanOverScroll(bool val);
bool GetCanOverScroll() const;
void OnScrollEnd();
void ProcessSpringEffect(float velocity, bool needRestart = false);
void SetEdgeEffect(EdgeEffect edgeEffect);