mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 23:21:05 +00:00
!42016 修复链式动效边缘回弹问题
Merge pull request !42016 from yeyinglong/listtest4
This commit is contained in:
commit
32aaf2524d
@ -2016,6 +2016,13 @@ void ListPattern::ProcessDragUpdate(float dragOffset, int32_t source)
|
|||||||
}
|
}
|
||||||
bool overDrag = (source == SCROLL_FROM_UPDATE) && (IsAtTop() || IsAtBottom());
|
bool overDrag = (source == SCROLL_FROM_UPDATE) && (IsAtTop() || IsAtBottom());
|
||||||
chainAnimation_->SetDelta(-dragOffset, overDrag);
|
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
|
float ListPattern::GetChainDelta(int32_t index) const
|
||||||
|
@ -760,6 +760,9 @@ protected:
|
|||||||
return scrollOriginChild_.Upgrade();
|
return scrollOriginChild_.Upgrade();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetCanOverScroll(bool val);
|
||||||
|
bool GetCanOverScroll() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void OnScrollEndCallback() {};
|
virtual void OnScrollEndCallback() {};
|
||||||
|
|
||||||
@ -828,9 +831,6 @@ private:
|
|||||||
|
|
||||||
void ExecuteScrollFrameBegin(float& mainDelta, ScrollState state);
|
void ExecuteScrollFrameBegin(float& mainDelta, ScrollState state);
|
||||||
|
|
||||||
void SetCanOverScroll(bool val);
|
|
||||||
bool GetCanOverScroll() const;
|
|
||||||
|
|
||||||
void OnScrollEnd();
|
void OnScrollEnd();
|
||||||
void ProcessSpringEffect(float velocity, bool needRestart = false);
|
void ProcessSpringEffect(float velocity, bool needRestart = false);
|
||||||
void SetEdgeEffect(EdgeEffect edgeEffect);
|
void SetEdgeEffect(EdgeEffect edgeEffect);
|
||||||
|
Loading…
Reference in New Issue
Block a user