issueNo: I477T8

Description:fix scoll bug.
Feature or Bugfix:Bugfix
Binary Source:No

Signed-off-by: youzhi92 <chenyouzhi@huawei.com>
Change-Id: I27586969e5b610149c5c32a106df2c14dff3708d
This commit is contained in:
youzhi92
2021-08-25 17:24:07 +08:00
parent 8dd107b413
commit 01e4b7154f
5 changed files with 16 additions and 2 deletions
@@ -408,6 +408,13 @@ void Component::AlignDimensions(const ConstrainedParameter &param)
OnDimensionsAligned();
}
void Component::EnableTransmitSwipe()
{
if (onSwipeListener_ != nullptr) {
onSwipeListener_->SetStopPropagation(false);
}
}
void Component::GetConstrainedParam(ConstrainedParameter &param) const
{
param.maxWidth = width_.value.pixel;
+2 -1
View File
@@ -178,7 +178,7 @@ public:
*/
virtual void OnViewAttached() {}
virtual void LayoutChildren() {}
static void BuildViewTree(Component *currComponent, Component *parent, ConstrainedParameter &alignParameter);
static void BuildViewTree(Component *currComponent, Component *parent, ConstrainedParameter &parentParameter);
const Component *GetParent() const
{
@@ -227,6 +227,7 @@ public:
*/
bool AdaptBoxSizing(uint16_t attrKeyId = K_UNKNOWN) const;
void AlignDimensions(const ConstrainedParameter &param);
void EnableTransmitSwipe();
protected:
void SetComponentName(uint16_t name)
@@ -115,6 +115,11 @@ bool ViewOnTouchCancelListener::OnCancel(UIView &view, const CancelEvent &event)
}
#endif // JS_TOUCH_EVENT_SUPPORT
void ViewOnSwipeListener::SetStopPropagation(bool isStopPropogation)
{
isStopPropagation_ = isStopPropogation;
}
bool ViewOnSwipeListener::OnDragStart(UIView& view, const DragEvent &event)
{
UNUSED(view);
@@ -223,6 +223,7 @@ public:
jerry_release_value(fn_);
}
void SetStopPropagation(bool isStopPropogation);
bool OnDragStart(UIView& view, const DragEvent& event) override;
bool OnDrag(UIView& view, const DragEvent& event) override;
bool OnDragEnd(UIView& view, const DragEvent &event) override;
@@ -59,7 +59,7 @@ void ScrollLayer::AppendScrollLayer(Component *rootComponent)
HILOG_ERROR(HILOG_MODULE_ACE, "Scroll Layer: AppendScrollLayer function parameter rootComponent error.");
return;
}
rootComponent->EnableTransmitSwipe();
uint16_t horizontalResolution = GetHorizontalResolution();
uint16_t verticalResolution = GetVerticalResolution();
ConstrainedParameter rootViewParam(horizontalResolution, verticalResolution);