提交 c18a41bb 编写于 作者: L liqiang

fix when view set draggable but not scroll bug

Change-Id: I91059e6d2d183acc8a11bce3d54ef56e0359f026
上级 9be8fa28
...@@ -173,7 +173,6 @@ UIPicker::UIPicker() ...@@ -173,7 +173,6 @@ UIPicker::UIPicker()
#endif #endif
list_.SetLoopState(false); list_.SetLoopState(false);
list_.EnableAutoAlign(true); list_.EnableAutoAlign(true);
list_.SetIntercept(false);
PickerListScrollListener* listener = new PickerListScrollListener(this, &list_); PickerListScrollListener* listener = new PickerListScrollListener(this, &list_);
list_.SetScrollStateListener(listener); list_.SetScrollStateListener(listener);
listListener_ = static_cast<void*>(listener); listListener_ = static_cast<void*>(listener);
......
...@@ -141,7 +141,6 @@ void UITimePicker::InitPicker(UIPicker*& picker, int16_t start, int16_t end) ...@@ -141,7 +141,6 @@ void UITimePicker::InitPicker(UIPicker*& picker, int16_t start, int16_t end)
picker->SetTextColor(backgroundColor_, highlightColor_); picker->SetTextColor(backgroundColor_, highlightColor_);
picker->SetValues(start, end); picker->SetValues(start, end);
picker->RegisterSelectedListener(&pickerListener_); picker->RegisterSelectedListener(&pickerListener_);
picker->SetIntercept(false);
Add(picker); Add(picker);
#if ENABLE_ROTATE_INPUT #if ENABLE_ROTATE_INPUT
......
...@@ -32,7 +32,7 @@ UIView::UIView() ...@@ -32,7 +32,7 @@ UIView::UIView()
isViewGroup_(false), isViewGroup_(false),
needRedraw_(false), needRedraw_(false),
styleAllocFlag_(false), styleAllocFlag_(false),
isIntercept_(true), isIntercept_(false),
#if ENABLE_FOCUS_MANAGER #if ENABLE_FOCUS_MANAGER
focusable_(false), focusable_(false),
#endif #endif
...@@ -288,7 +288,7 @@ bool UIView::OnLongPressEvent(const LongPressEvent& event) ...@@ -288,7 +288,7 @@ bool UIView::OnLongPressEvent(const LongPressEvent& event)
bool isConsumed = onLongPressListener_->OnLongPress(*this, event); bool isConsumed = onLongPressListener_->OnLongPress(*this, event);
return isConsumed; return isConsumed;
} }
return false; return isIntercept_;
} }
bool UIView::OnDragStartEvent(const DragEvent& event) bool UIView::OnDragStartEvent(const DragEvent& event)
...@@ -298,7 +298,7 @@ bool UIView::OnDragStartEvent(const DragEvent& event) ...@@ -298,7 +298,7 @@ bool UIView::OnDragStartEvent(const DragEvent& event)
bool isConsumed = onDragListener_->OnDragStart(*this, event); bool isConsumed = onDragListener_->OnDragStart(*this, event);
return isConsumed; return isConsumed;
} }
return false; return isIntercept_;
} }
bool UIView::OnDragEvent(const DragEvent& event) bool UIView::OnDragEvent(const DragEvent& event)
...@@ -308,7 +308,7 @@ bool UIView::OnDragEvent(const DragEvent& event) ...@@ -308,7 +308,7 @@ bool UIView::OnDragEvent(const DragEvent& event)
bool isConsumed = onDragListener_->OnDrag(*this, event); bool isConsumed = onDragListener_->OnDrag(*this, event);
return isConsumed; return isConsumed;
} }
return false; return isIntercept_;
} }
bool UIView::OnDragEndEvent(const DragEvent& event) bool UIView::OnDragEndEvent(const DragEvent& event)
...@@ -318,7 +318,7 @@ bool UIView::OnDragEndEvent(const DragEvent& event) ...@@ -318,7 +318,7 @@ bool UIView::OnDragEndEvent(const DragEvent& event)
bool isConsumed = onDragListener_->OnDragEnd(*this, event); bool isConsumed = onDragListener_->OnDragEnd(*this, event);
return isConsumed; return isConsumed;
} }
return false; return isIntercept_;
} }
bool UIView::OnClickEvent(const ClickEvent& event) bool UIView::OnClickEvent(const ClickEvent& event)
...@@ -328,7 +328,7 @@ bool UIView::OnClickEvent(const ClickEvent& event) ...@@ -328,7 +328,7 @@ bool UIView::OnClickEvent(const ClickEvent& event)
bool isConsumed = onClickListener_->OnClick(*this, event); bool isConsumed = onClickListener_->OnClick(*this, event);
return isConsumed; return isConsumed;
} }
return false; return isIntercept_;
} }
bool UIView::OnPressEvent(const PressEvent& event) bool UIView::OnPressEvent(const PressEvent& event)
...@@ -338,7 +338,7 @@ bool UIView::OnPressEvent(const PressEvent& event) ...@@ -338,7 +338,7 @@ bool UIView::OnPressEvent(const PressEvent& event)
bool isConsumed = onTouchListener_->OnPress(*this, event); bool isConsumed = onTouchListener_->OnPress(*this, event);
return isConsumed; return isConsumed;
} }
return false; return isIntercept_;
} }
bool UIView::OnReleaseEvent(const ReleaseEvent& event) bool UIView::OnReleaseEvent(const ReleaseEvent& event)
...@@ -348,7 +348,7 @@ bool UIView::OnReleaseEvent(const ReleaseEvent& event) ...@@ -348,7 +348,7 @@ bool UIView::OnReleaseEvent(const ReleaseEvent& event)
bool isConsumed = onTouchListener_->OnRelease(*this, event); bool isConsumed = onTouchListener_->OnRelease(*this, event);
return isConsumed; return isConsumed;
} }
return false; return isIntercept_;
} }
bool UIView::OnCancelEvent(const CancelEvent& event) bool UIView::OnCancelEvent(const CancelEvent& event)
...@@ -358,7 +358,7 @@ bool UIView::OnCancelEvent(const CancelEvent& event) ...@@ -358,7 +358,7 @@ bool UIView::OnCancelEvent(const CancelEvent& event)
bool isConsumed = onTouchListener_->OnCancel(*this, event); bool isConsumed = onTouchListener_->OnCancel(*this, event);
return isConsumed; return isConsumed;
} }
return false; return isIntercept_;
} }
#if ENABLE_ROTATE_INPUT #if ENABLE_ROTATE_INPUT
...@@ -367,7 +367,7 @@ bool UIView::OnRotateEvent(const RotateEvent& event) ...@@ -367,7 +367,7 @@ bool UIView::OnRotateEvent(const RotateEvent& event)
if (onRotateListener_ != nullptr) { if (onRotateListener_ != nullptr) {
return onRotateListener_->OnRotate(*this, event); return onRotateListener_->OnRotate(*this, event);
} }
return false; return isIntercept_;
} }
#endif #endif
......
...@@ -101,7 +101,7 @@ void PointerInputDevice::DispatchPressEvent(UIViewGroup* rootView) ...@@ -101,7 +101,7 @@ void PointerInputDevice::DispatchPressEvent(UIViewGroup* rootView)
if (!touchableView_->OnPressEvent(evt)) { if (!touchableView_->OnPressEvent(evt)) {
while (parent != nullptr) { while (parent != nullptr) {
PressEvent evtParent(curPos_); PressEvent evtParent(curPos_);
if (parent->UIView::OnPressEvent(evtParent)) { if (parent->OnPressEvent(evtParent)) {
break; break;
} }
parent = parent->GetParent(); parent = parent->GetParent();
...@@ -123,7 +123,7 @@ bool PointerInputDevice::ProcessReleaseEvent() ...@@ -123,7 +123,7 @@ bool PointerInputDevice::ProcessReleaseEvent()
if (!touchableView_->OnPressEvent(evtPress)) { if (!touchableView_->OnPressEvent(evtPress)) {
while (parent != nullptr) { while (parent != nullptr) {
PressEvent evtPressParent(curPos_); PressEvent evtPressParent(curPos_);
if (parent->UIView::OnPressEvent(evtPressParent)) { if (parent->OnPressEvent(evtPressParent)) {
break; break;
} }
parent = parent->GetParent(); parent = parent->GetParent();
...@@ -136,7 +136,7 @@ bool PointerInputDevice::ProcessReleaseEvent() ...@@ -136,7 +136,7 @@ bool PointerInputDevice::ProcessReleaseEvent()
if (!touchableView_->OnReleaseEvent(evtRelease)) { if (!touchableView_->OnReleaseEvent(evtRelease)) {
while (parent != nullptr) { while (parent != nullptr) {
ReleaseEvent evtReleaseParent(curPos_); ReleaseEvent evtReleaseParent(curPos_);
if (parent->UIView::OnReleaseEvent(evtReleaseParent)) { if (parent->OnReleaseEvent(evtReleaseParent)) {
break; break;
} }
parent = parent->GetParent(); parent = parent->GetParent();
...@@ -152,7 +152,7 @@ bool PointerInputDevice::ProcessReleaseEvent() ...@@ -152,7 +152,7 @@ bool PointerInputDevice::ProcessReleaseEvent()
OnClickEventHappen(parent); OnClickEventHappen(parent);
#endif #endif
ClickEvent evtParent(curPos_); ClickEvent evtParent(curPos_);
if (parent->UIView::OnClickEvent(evtParent)) { if (parent->OnClickEvent(evtParent)) {
break; break;
} }
parent = parent->GetParent(); parent = parent->GetParent();
...@@ -214,7 +214,7 @@ void PointerInputDevice::DispatchDragStartEvent() ...@@ -214,7 +214,7 @@ void PointerInputDevice::DispatchDragStartEvent()
if (!draggableView_->OnDragStartEvent(evt)) { if (!draggableView_->OnDragStartEvent(evt)) {
while (parent != nullptr) { while (parent != nullptr) {
DragEvent evtParent(curPos_, lastPos_, dragLen_); DragEvent evtParent(curPos_, lastPos_, dragLen_);
if (parent->UIView::OnDragStartEvent(evtParent)) { if (parent->OnDragStartEvent(evtParent)) {
break; break;
} }
parent = parent->GetParent(); parent = parent->GetParent();
...@@ -237,7 +237,7 @@ void PointerInputDevice::DispatchDragEvent() ...@@ -237,7 +237,7 @@ void PointerInputDevice::DispatchDragEvent()
if (!draggableView_->OnDragEvent(evt)) { if (!draggableView_->OnDragEvent(evt)) {
while (parent != nullptr) { while (parent != nullptr) {
DragEvent evtParent(curPos_, lastPos_, dragLen_); DragEvent evtParent(curPos_, lastPos_, dragLen_);
if (parent->UIView::OnDragEvent(evtParent)) { if (parent->OnDragEvent(evtParent)) {
break; break;
} }
parent = parent->GetParent(); parent = parent->GetParent();
...@@ -259,7 +259,7 @@ void PointerInputDevice::DispatchDragEndEvent() ...@@ -259,7 +259,7 @@ void PointerInputDevice::DispatchDragEndEvent()
if (!draggableView_->OnDragEndEvent(evt)) { if (!draggableView_->OnDragEndEvent(evt)) {
while (parent != nullptr) { while (parent != nullptr) {
DragEvent evtParent(curPos_, lastPos_, dragLen_); DragEvent evtParent(curPos_, lastPos_, dragLen_);
if (parent->UIView::OnDragEndEvent(evtParent)) { if (parent->OnDragEndEvent(evtParent)) {
break; break;
} }
parent = parent->GetParent(); parent = parent->GetParent();
...@@ -290,7 +290,7 @@ void PointerInputDevice::DispatchLongPressEvent(uint32_t elapse) ...@@ -290,7 +290,7 @@ void PointerInputDevice::DispatchLongPressEvent(uint32_t elapse)
if (!isConsumed) { if (!isConsumed) {
while (parent != nullptr) { while (parent != nullptr) {
LongPressEvent evtParent(curPos_, pressTimeStamp_); LongPressEvent evtParent(curPos_, pressTimeStamp_);
isConsumed = parent->UIView::OnLongPressEvent(evtParent); isConsumed = parent->OnLongPressEvent(evtParent);
if (needClick_ && (parent->GetOnLongPressListener() != nullptr)) { if (needClick_ && (parent->GetOnLongPressListener() != nullptr)) {
needClick_ = false; needClick_ = false;
} }
...@@ -313,7 +313,7 @@ void PointerInputDevice::DispatchCancelEvent() ...@@ -313,7 +313,7 @@ void PointerInputDevice::DispatchCancelEvent()
if (!touchableView_->OnCancelEvent(evt)) { if (!touchableView_->OnCancelEvent(evt)) {
while (parent != nullptr) { while (parent != nullptr) {
CancelEvent evtParent(lastPos_); CancelEvent evtParent(lastPos_);
if (parent->UIView::OnCancelEvent(evtParent)) { if (parent->OnCancelEvent(evtParent)) {
break; break;
} }
parent = parent->GetParent(); parent = parent->GetParent();
......
...@@ -135,10 +135,7 @@ public: ...@@ -135,10 +135,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
virtual bool OnClick(UIView& view, const ClickEvent& event) virtual bool OnClick(UIView& view, const ClickEvent& event) { return false; }
{
return false;
}
/** /**
* @brief A destructor used to delete the <b>OnClickListener</b> instance. * @brief A destructor used to delete the <b>OnClickListener</b> instance.
...@@ -167,10 +164,7 @@ public: ...@@ -167,10 +164,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
virtual bool OnLongPress(UIView& view, const LongPressEvent& event) virtual bool OnLongPress(UIView& view, const LongPressEvent& event) { return false; }
{
return false;
}
/** /**
* @brief A destructor used to delete the <b>OnLongPressListener</b> instance. * @brief A destructor used to delete the <b>OnLongPressListener</b> instance.
...@@ -198,10 +192,7 @@ public: ...@@ -198,10 +192,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
virtual bool OnDragStart(UIView& view, const DragEvent& event) virtual bool OnDragStart(UIView& view, const DragEvent& event) { return false; }
{
return false;
}
/** /**
* @brief Called when a view is being dragged. * @brief Called when a view is being dragged.
...@@ -213,10 +204,7 @@ public: ...@@ -213,10 +204,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
virtual bool OnDrag(UIView& view, const DragEvent& event) virtual bool OnDrag(UIView& view, const DragEvent& event) { return false; }
{
return false;
}
/** /**
* @brief Called when a view stops dragging. * @brief Called when a view stops dragging.
...@@ -228,10 +216,7 @@ public: ...@@ -228,10 +216,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
virtual bool OnDragEnd(UIView& view, const DragEvent& event) virtual bool OnDragEnd(UIView& view, const DragEvent& event) { return false; }
{
return false;
}
/** /**
* @brief A destructor used to delete the <b>OnDragListener</b> instance. * @brief A destructor used to delete the <b>OnDragListener</b> instance.
...@@ -260,10 +245,7 @@ public: ...@@ -260,10 +245,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
virtual bool OnPress(UIView& view, const PressEvent& event) virtual bool OnPress(UIView& view, const PressEvent& event) { return false; }
{
return false;
}
/** /**
* @brief Called when a view is released. * @brief Called when a view is released.
...@@ -275,10 +257,7 @@ public: ...@@ -275,10 +257,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
virtual bool OnRelease(UIView& view, const ReleaseEvent& event) virtual bool OnRelease(UIView& view, const ReleaseEvent& event) { return false; }
{
return false;
}
/** /**
* @brief Called when a click event on a view is canceled. * @brief Called when a click event on a view is canceled.
...@@ -290,10 +269,7 @@ public: ...@@ -290,10 +269,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
virtual bool OnCancel(UIView& view, const CancelEvent& event) virtual bool OnCancel(UIView& view, const CancelEvent& event) { return false; }
{
return false;
}
/** /**
* @brief A destructor used to delete the <b>OnTouchListener</b> instance. * @brief A destructor used to delete the <b>OnTouchListener</b> instance.
...@@ -320,10 +296,7 @@ public: ...@@ -320,10 +296,7 @@ public:
* @since 5.0 * @since 5.0
* @version 3.0 * @version 3.0
*/ */
virtual bool OnRotate(UIView& view, const RotateEvent& event) virtual bool OnRotate(UIView& view, const RotateEvent& event) { return true; }
{
return true;
}
/** /**
* @brief A destructor used to delete an <b>OnRotateListener</b> instance. * @brief A destructor used to delete an <b>OnRotateListener</b> instance.
* @since 5.0 * @since 5.0
...@@ -346,10 +319,7 @@ public: ...@@ -346,10 +319,7 @@ public:
* @since 5.0 * @since 5.0
* @version 3.0 * @version 3.0
*/ */
void SetOnRotateListener(OnRotateListener* onRotateListener) void SetOnRotateListener(OnRotateListener* onRotateListener) { onRotateListener_ = onRotateListener; }
{
onRotateListener_ = onRotateListener;
}
/** /**
* @brief Obtains the rotation event listener for the view. * @brief Obtains the rotation event listener for the view.
...@@ -357,10 +327,7 @@ public: ...@@ -357,10 +327,7 @@ public:
* @since 5.0 * @since 5.0
* @version 3.0 * @version 3.0
*/ */
OnRotateListener*& GetOnRotateListener() OnRotateListener*& GetOnRotateListener() { return onRotateListener_; }
{
return onRotateListener_;
}
#endif #endif
/** /**
...@@ -540,10 +507,7 @@ public: ...@@ -540,10 +507,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
void SetOnDragListener(OnDragListener* onDragListener) void SetOnDragListener(OnDragListener* onDragListener) { onDragListener_ = onDragListener; }
{
onDragListener_ = onDragListener;
}
/** /**
* @brief Obtains the drag event listener for the view. * @brief Obtains the drag event listener for the view.
...@@ -551,10 +515,7 @@ public: ...@@ -551,10 +515,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
OnDragListener*& GetOnDragListener() OnDragListener*& GetOnDragListener() { return onDragListener_; }
{
return onDragListener_;
}
/** /**
* @brief Sets a click event listener for the view. * @brief Sets a click event listener for the view.
...@@ -562,10 +523,7 @@ public: ...@@ -562,10 +523,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
void SetOnClickListener(OnClickListener* onClickListener) void SetOnClickListener(OnClickListener* onClickListener) { onClickListener_ = onClickListener; }
{
onClickListener_ = onClickListener;
}
/** /**
* @brief Obtains the click event listener for the view. * @brief Obtains the click event listener for the view.
...@@ -573,10 +531,7 @@ public: ...@@ -573,10 +531,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
OnClickListener*& GetOnClickListener() OnClickListener*& GetOnClickListener() { return onClickListener_; }
{
return onClickListener_;
}
/** /**
* @brief Sets a long-press event listener for the view. * @brief Sets a long-press event listener for the view.
...@@ -595,10 +550,7 @@ public: ...@@ -595,10 +550,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
OnLongPressListener*& GetOnLongPressListener() OnLongPressListener*& GetOnLongPressListener() { return onLongPressListener_; }
{
return onLongPressListener_;
}
/** /**
* @brief Sets a touch event listener for the view. * @brief Sets a touch event listener for the view.
...@@ -606,10 +558,7 @@ public: ...@@ -606,10 +558,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
void SetOnTouchListener(OnTouchListener* onTouchListener) void SetOnTouchListener(OnTouchListener* onTouchListener) { onTouchListener_ = onTouchListener; }
{
onTouchListener_ = onTouchListener;
}
/** /**
* @brief Obtains the touch event listener for the view. * @brief Obtains the touch event listener for the view.
...@@ -617,10 +566,7 @@ public: ...@@ -617,10 +566,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
OnTouchListener*& GetTouchListener() OnTouchListener*& GetTouchListener() { return onTouchListener_; }
{
return onTouchListener_;
}
/** /**
* @brief Obtains the top-level view based on specified coordinates. * @brief Obtains the top-level view based on specified coordinates.
...@@ -651,10 +597,7 @@ public: ...@@ -651,10 +597,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
void SetParent(UIView* parent) void SetParent(UIView* parent) { parent_ = parent; }
{
parent_ = parent;
}
/** /**
* @brief Obtains the parent view of the view. * @brief Obtains the parent view of the view.
...@@ -662,10 +605,7 @@ public: ...@@ -662,10 +605,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
UIView* GetParent() const UIView* GetParent() const { return parent_; }
{
return parent_;
}
/** /**
* @brief Sets the next sibling view for the view. * @brief Sets the next sibling view for the view.
...@@ -673,10 +613,7 @@ public: ...@@ -673,10 +613,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
void SetNextSibling(UIView* sibling) void SetNextSibling(UIView* sibling) { nextSibling_ = sibling; }
{
nextSibling_ = sibling;
}
/** /**
* @brief Obtains the next sibling view of the view. * @brief Obtains the next sibling view of the view.
...@@ -684,10 +621,7 @@ public: ...@@ -684,10 +621,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
UIView* GetNextSibling() const UIView* GetNextSibling() const { return nextSibling_; }
{
return nextSibling_;
}
/** /**
* @brief Sets whether the view is visible. * @brief Sets whether the view is visible.
...@@ -711,10 +645,7 @@ public: ...@@ -711,10 +645,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
bool IsVisible() const bool IsVisible() const { return visible_; }
{
return visible_;
}
/** /**
* @brief Sets whether the view is touchable. * @brief Sets whether the view is touchable.
...@@ -723,10 +654,7 @@ public: ...@@ -723,10 +654,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
void SetTouchable(bool touch) void SetTouchable(bool touch) { touchable_ = touch; }
{
touchable_ = touch;
}
/** /**
* @brief Checks whether the view is touchable. * @brief Checks whether the view is touchable.
...@@ -734,10 +662,7 @@ public: ...@@ -734,10 +662,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
bool IsTouchable() const bool IsTouchable() const { return touchable_; }
{
return touchable_;
}
/** /**
* @brief Sets whether the view is draggable. * @brief Sets whether the view is draggable.
...@@ -758,10 +683,7 @@ public: ...@@ -758,10 +683,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
bool IsDraggable() const bool IsDraggable() const { return draggable_; }
{
return draggable_;
}
/** /**
* @brief Sets whether to transfer the drag event to the parent view for processing when the view is being dragged. * @brief Sets whether to transfer the drag event to the parent view for processing when the view is being dragged.
...@@ -771,10 +693,7 @@ public: ...@@ -771,10 +693,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
void SetDragParentInstead(bool dragParentInstead) void SetDragParentInstead(bool dragParentInstead) { dragParentInstead_ = dragParentInstead; }
{
dragParentInstead_ = dragParentInstead;
}
/** /**
* @brief Obtains whether the view transfers a drag event to the parent view for processing. * @brief Obtains whether the view transfers a drag event to the parent view for processing.
...@@ -783,10 +702,7 @@ public: ...@@ -783,10 +702,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
bool IsDragParentInstead() const bool IsDragParentInstead() const { return dragParentInstead_; }
{
return dragParentInstead_;
}
/** /**
* @brief Obtains the absolute rectangle area of the view. When the view has deformation such as rotation, * @brief Obtains the absolute rectangle area of the view. When the view has deformation such as rotation,
...@@ -838,10 +754,7 @@ public: ...@@ -838,10 +754,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
Rect GetRelativeRect() const Rect GetRelativeRect() const { return rect_; }
{
return rect_;
}
/** /**
* @brief Adjusts the size of the visible area. This operation may affect the final display size. * @brief Adjusts the size of the visible area. This operation may affect the final display size.
...@@ -966,10 +879,7 @@ public: ...@@ -966,10 +879,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
virtual void SetX(int16_t x) virtual void SetX(int16_t x) { rect_.SetX(x); }
{
rect_.SetX(x);
}
/** /**
* @brief Sets a percentage that represents the proportion of the view's x-coordinate * @brief Sets a percentage that represents the proportion of the view's x-coordinate
...@@ -986,10 +896,7 @@ public: ...@@ -986,10 +896,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
int16_t GetX() const int16_t GetX() const { return rect_.GetX(); }
{
return rect_.GetX();
}
/** /**
* @brief Sets the y-coordinate for the view. * @brief Sets the y-coordinate for the view.
...@@ -997,10 +904,7 @@ public: ...@@ -997,10 +904,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
virtual void SetY(int16_t y) virtual void SetY(int16_t y) { rect_.SetY(y); }
{
rect_.SetY(y);
}
/** /**
* @brief Sets a percentage that represents the proportion of the view's y-coordinate * @brief Sets a percentage that represents the proportion of the view's y-coordinate
...@@ -1017,10 +921,7 @@ public: ...@@ -1017,10 +921,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
int16_t GetY() const int16_t GetY() const { return rect_.GetY(); }
{
return rect_.GetY();
}
/** /**
* @brief Sets the position for the view. * @brief Sets the position for the view.
...@@ -1029,10 +930,7 @@ public: ...@@ -1029,10 +930,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
virtual void SetPosition(int16_t x, int16_t y) virtual void SetPosition(int16_t x, int16_t y) { rect_.SetPosition(x, y); }
{
rect_.SetPosition(x, y);
}
/** /**
* @brief Sets the position percentages for the view. * @brief Sets the position percentages for the view.
...@@ -1082,23 +980,26 @@ public: ...@@ -1082,23 +980,26 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
bool IsViewGroup() const bool IsViewGroup() const { return isViewGroup_; }
{
return isViewGroup_;
}
/** /**
* @brief Sets whether to intercept the drag event. If intercepted, the view does not transfer the drag event to * @brief Sets whether to intercept the input event. If intercepted, the view does not transfer the input event to
* the parent view after local processing. * the parent view after local processing.
* @param isIntercept Specifies whether to intercept the drag event. Value <b>true</b> means to intercept the drag * @param isIntercept Specifies whether to intercept the input event. Value <b>true</b> means to intercept the input
* event, and <b>false</b> means the opposite. * event, and <b>false</b> means the opposite.
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
void SetIntercept(bool isIntercept) void SetIntercept(bool isIntercept) { isIntercept_ = isIntercept; }
{
isIntercept_ = isIntercept; /**
} * @brief Gets whether to intercept the input event. If intercepted, the view does not transfer the input event to
* the parent view after local processing.
* @return Returns <b>true</b> if intercept the input event, and <b>false</b> means the opposite.
* @since 1.0
* @version 1.0
*/
bool IsIntercept() { return isIntercept_; }
/** /**
* @brief Sets the affine transformation matrix. * @brief Sets the affine transformation matrix.
...@@ -1128,10 +1029,7 @@ public: ...@@ -1128,10 +1029,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
virtual UIView* GetChildById(const char* id) const virtual UIView* GetChildById(const char* id) const { return nullptr; }
{
return nullptr;
}
/** /**
* @brief Sets the view ID. * @brief Sets the view ID.
...@@ -1139,10 +1037,7 @@ public: ...@@ -1139,10 +1037,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
void SetViewId(const char* id) void SetViewId(const char* id) { id_ = id; }
{
id_ = id;
}
/** /**
* @brief Obtains the view ID. * @brief Obtains the view ID.
...@@ -1150,10 +1045,7 @@ public: ...@@ -1150,10 +1045,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
const char* GetViewId() const const char* GetViewId() const { return id_; }
{
return id_;
}
/** /**
* @brief Sets the view index. * @brief Sets the view index.
...@@ -1161,10 +1053,7 @@ public: ...@@ -1161,10 +1053,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
void SetViewIndex(int16_t index) void SetViewIndex(int16_t index) { index_ = index; }
{
index_ = index;
}
/** /**
* @brief Obtains the view index. * @brief Obtains the view index.
...@@ -1172,10 +1061,7 @@ public: ...@@ -1172,10 +1061,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
int16_t GetViewIndex() const int16_t GetViewIndex() const { return index_; }
{
return index_;
}
/** /**
* @brief Obtains the view type. * @brief Obtains the view type.
...@@ -1183,10 +1069,7 @@ public: ...@@ -1183,10 +1069,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
virtual UIViewType GetViewType() const virtual UIViewType GetViewType() const { return UI_NUMBER_MAX; }
{
return UI_NUMBER_MAX;
}
/** /**
* @brief Lays out all child views according to the preset arrangement mode. * @brief Lays out all child views according to the preset arrangement mode.
...@@ -1371,10 +1254,7 @@ public: ...@@ -1371,10 +1254,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
virtual int64_t GetStyle(uint8_t key) const virtual int64_t GetStyle(uint8_t key) const { return style_->GetStyle(key); }
{
return style_->GetStyle(key);
}
/** /**
* @brief Obtains the view style. This function applies to scenarios where the style does not need to be modified, * @brief Obtains the view style. This function applies to scenarios where the style does not need to be modified,
...@@ -1383,10 +1263,7 @@ public: ...@@ -1383,10 +1263,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
const Style& GetStyleConst() const const Style& GetStyleConst() const { return *style_; }
{
return *style_;
}
/** /**
* @brief Sets the opacity for the view. * @brief Sets the opacity for the view.
...@@ -1395,10 +1272,7 @@ public: ...@@ -1395,10 +1272,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
void SetOpaScale(uint8_t opaScale) void SetOpaScale(uint8_t opaScale) { opaScale_ = opaScale; }
{
opaScale_ = opaScale;
}
/** /**
* @brief Obtains the view opacity. * @brief Obtains the view opacity.
...@@ -1407,10 +1281,7 @@ public: ...@@ -1407,10 +1281,7 @@ public:
* @since 1.0 * @since 1.0
* @version 1.0 * @version 1.0
*/ */
uint8_t GetOpaScale() const uint8_t GetOpaScale() const { return opaScale_; }
{
return opaScale_;
}
/** /**
* @brief Obtains the extra message about a <b>UIView</b> instance. This field is ignored by the graphics * @brief Obtains the extra message about a <b>UIView</b> instance. This field is ignored by the graphics
...@@ -1420,10 +1291,7 @@ public: ...@@ -1420,10 +1291,7 @@ public:
* @since 5.0 * @since 5.0
* @version 3.0 * @version 3.0
*/ */
ViewExtraMsg* GetExtraMsg() ViewExtraMsg* GetExtraMsg() { return viewExtraMsg_; }
{
return viewExtraMsg_;
}
/** /**
* @brief Sets the extra message about a <b>UIView</b> instance. This field is ignored by the graphics * @brief Sets the extra message about a <b>UIView</b> instance. This field is ignored by the graphics
...@@ -1433,10 +1301,7 @@ public: ...@@ -1433,10 +1301,7 @@ public:
* @since 5.0 * @since 5.0
* @version 3.0 * @version 3.0
*/ */
void SetExtraMsg(ViewExtraMsg* extraMsg) void SetExtraMsg(ViewExtraMsg* extraMsg) { viewExtraMsg_ = extraMsg; }
{
viewExtraMsg_ = extraMsg;
}
/** /**
* @brief Rotates the view. * @brief Rotates the view.
...@@ -1488,10 +1353,7 @@ public: ...@@ -1488,10 +1353,7 @@ public:
* @since 5.0 * @since 5.0
* @version 3.0 * @version 3.0
*/ */
void SetFocusable(bool focusable) void SetFocusable(bool focusable) { focusable_ = focusable; }
{
focusable_ = focusable;
}
/** /**
* @brief 获取视图是否可获焦. * @brief 获取视图是否可获焦.
...@@ -1500,10 +1362,7 @@ public: ...@@ -1500,10 +1362,7 @@ public:
* @since 5.0 * @since 5.0
* @version 3.0 * @version 3.0
*/ */
bool IsFocusable() const bool IsFocusable() const { return focusable_; }
{
return focusable_;
}
/** /**
* @brief 组件获焦响应 * @brief 组件获焦响应
...@@ -1535,10 +1394,7 @@ public: ...@@ -1535,10 +1394,7 @@ public:
* @since 5.0 * @since 5.0
* @version 3.0 * @version 3.0
*/ */
virtual bool OnFocus(UIView& view) virtual bool OnFocus(UIView& view) { return false; }
{
return false;
}
/** /**
* @brief 回调函数,视图失焦时触发. * @brief 回调函数,视图失焦时触发.
...@@ -1546,10 +1402,7 @@ public: ...@@ -1546,10 +1402,7 @@ public:
* @since 5.0 * @since 5.0
* @version 3.0 * @version 3.0
*/ */
virtual bool OnBlur(UIView& view) virtual bool OnBlur(UIView& view) { return false; }
{
return false;
}
/** /**
* @brief 析构函数. * @brief 析构函数.
...@@ -1565,10 +1418,7 @@ public: ...@@ -1565,10 +1418,7 @@ public:
* @since 5.0 * @since 5.0
* @version 3.0 * @version 3.0
*/ */
void SetOnFocusListener(OnFocusListener* onFocusListener) void SetOnFocusListener(OnFocusListener* onFocusListener) { onFocusListener_ = onFocusListener; }
{
onFocusListener_ = onFocusListener;
}
/** /**
* @brief 获取当前视图焦点改变事件监听者. * @brief 获取当前视图焦点改变事件监听者.
...@@ -1576,10 +1426,7 @@ public: ...@@ -1576,10 +1426,7 @@ public:
* @since 5.0 * @since 5.0
* @version 3.0 * @version 3.0
*/ */
OnFocusListener* GetOnFocusListener() const OnFocusListener* GetOnFocusListener() const { return onFocusListener_; }
{
return onFocusListener_;
}
#endif #endif
bool GetBitmap(ImageInfo& bitmap); bool GetBitmap(ImageInfo& bitmap);
......
...@@ -333,6 +333,7 @@ void UITestEventInjector::SetUpScrollView() ...@@ -333,6 +333,7 @@ void UITestEventInjector::SetUpScrollView()
SetLastPos(label); SetLastPos(label);
scrollTestView_ = new UIScrollView(); scrollTestView_ = new UIScrollView();
scrollTestView_->SetIntercept(true);
scrollTestView_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); scrollTestView_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
scrollTestView_->SetPosition(VIEW_DISTANCE_TO_LEFT_SIDE, positionY_, SCROLL_WIDTH, SCROLL_HEIGHT); scrollTestView_->SetPosition(VIEW_DISTANCE_TO_LEFT_SIDE, positionY_, SCROLL_WIDTH, SCROLL_HEIGHT);
scrollTestView_->SetXScrollBarVisible(true); scrollTestView_->SetXScrollBarVisible(true);
......
...@@ -150,6 +150,7 @@ void UITestSlider::SetUp() ...@@ -150,6 +150,7 @@ void UITestSlider::SetUp()
if (scroll_ == nullptr) { if (scroll_ == nullptr) {
scroll_ = new UIScrollView(); scroll_ = new UIScrollView();
scroll_->SetIntercept(true);
scroll_->SetPosition(336, 11); // 336: x-coordinate; 11: y-coordinate scroll_->SetPosition(336, 11); // 336: x-coordinate; 11: y-coordinate
scroll_->Resize(624, Screen::GetInstance().GetHeight() - 70); // 624: width; 70: decrease height scroll_->Resize(624, Screen::GetInstance().GetHeight() - 70); // 624: width; 70: decrease height
container_->Add(scroll_); container_->Add(scroll_);
......
...@@ -129,6 +129,7 @@ void UITestUIList::UIKit_List_Init_Test_Full_Screen_001() ...@@ -129,6 +129,7 @@ void UITestUIList::UIKit_List_Init_Test_Full_Screen_001()
adapter1_->SetData(adapterData2_); adapter1_->SetData(adapterData2_);
UIList* list = new UIList(UIList::VERTICAL); UIList* list = new UIList(UIList::VERTICAL);
list->SetIntercept(true);
list->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); list->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
list->SetPosition(VIEW_DISTANCE_TO_LEFT_SIDE, VIEW_DISTANCE_TO_TOP_SIDE, g_listW, list->SetPosition(VIEW_DISTANCE_TO_LEFT_SIDE, VIEW_DISTANCE_TO_TOP_SIDE, g_listW,
g_listH - 200); // 200: mean list reduce height g_listH - 200); // 200: mean list reduce height
...@@ -154,6 +155,7 @@ void UITestUIList::UIKit_List_Init_Test_halh_Screen_001() ...@@ -154,6 +155,7 @@ void UITestUIList::UIKit_List_Init_Test_halh_Screen_001()
adapter2_->SetData(adapterData1_); adapter2_->SetData(adapterData1_);
UIList* list = new UIList(UIList::VERTICAL); UIList* list = new UIList(UIList::VERTICAL);
list->SetIntercept(true);
list->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); list->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
// 2: half of screen width // 2: half of screen width
list->SetPosition(Screen::GetInstance().GetWidth() / 2 + VIEW_DISTANCE_TO_LEFT_SIDE, VIEW_DISTANCE_TO_TOP_SIDE, list->SetPosition(Screen::GetInstance().GetWidth() / 2 + VIEW_DISTANCE_TO_LEFT_SIDE, VIEW_DISTANCE_TO_TOP_SIDE,
...@@ -233,6 +235,7 @@ void UITestUIList::UIKit_List_Scroll_Test_Blank_Set_001() ...@@ -233,6 +235,7 @@ void UITestUIList::UIKit_List_Scroll_Test_Blank_Set_001()
adapter4_->SetData(adapterData2_); adapter4_->SetData(adapterData2_);
UIList* list = new UIList(UIList::VERTICAL); UIList* list = new UIList(UIList::VERTICAL);
list->SetIntercept(true);
list->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); list->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
list->SetPosition(VIEW_DISTANCE_TO_LEFT_SIDE, g_listH - 95, g_listW, g_listH); // 95: decrease y-coordinate list->SetPosition(VIEW_DISTANCE_TO_LEFT_SIDE, g_listH - 95, g_listW, g_listH); // 95: decrease y-coordinate
list->SetAdapter(adapter4_); list->SetAdapter(adapter4_);
......
...@@ -108,6 +108,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_bar_001() ...@@ -108,6 +108,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_bar_001()
positionY_ += DELTA_Y_COORDINATE_2; positionY_ += DELTA_Y_COORDINATE_2;
UIScrollView* scroll = new UIScrollView(); UIScrollView* scroll = new UIScrollView();
scroll->SetIntercept(true);
scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH); scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH);
scroll->SetXScrollBarVisible(false); scroll->SetXScrollBarVisible(false);
...@@ -133,6 +134,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_bar_002() ...@@ -133,6 +134,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_bar_002()
positionY_ += DELTA_Y_COORDINATE_2; positionY_ += DELTA_Y_COORDINATE_2;
UIScrollView* scroll = new UIScrollView(); UIScrollView* scroll = new UIScrollView();
scroll->SetIntercept(true);
scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH); scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH);
scroll->SetXScrollBarVisible(true); scroll->SetXScrollBarVisible(true);
...@@ -157,6 +159,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_bar_003() ...@@ -157,6 +159,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_bar_003()
positionY_ += DELTA_Y_COORDINATE_2; positionY_ += DELTA_Y_COORDINATE_2;
UIScrollView* scroll = new UIScrollView(); UIScrollView* scroll = new UIScrollView();
scroll->SetIntercept(true);
scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH); scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH);
scroll->SetXScrollBarVisible(true); scroll->SetXScrollBarVisible(true);
...@@ -186,6 +189,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_bar_004() ...@@ -186,6 +189,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_bar_004()
positionY_ += DELTA_Y_COORDINATE_2; positionY_ += DELTA_Y_COORDINATE_2;
UIScrollView* scroll = new UIScrollView(); UIScrollView* scroll = new UIScrollView();
scroll->SetIntercept(true);
scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH); scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH);
scroll->SetXScrollBarVisible(true); scroll->SetXScrollBarVisible(true);
...@@ -212,6 +216,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_Scrollable_Set_001() ...@@ -212,6 +216,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_Scrollable_Set_001()
positionY_ += DELTA_Y_COORDINATE_2; positionY_ += DELTA_Y_COORDINATE_2;
UIScrollView* scroll = new UIScrollView(); UIScrollView* scroll = new UIScrollView();
scroll->SetIntercept(true);
scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH); scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH);
scroll->SetScrollBlankSize(20); // 20: means scroll blank size scroll->SetScrollBlankSize(20); // 20: means scroll blank size
...@@ -240,6 +245,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_Scrollable_Set_002() ...@@ -240,6 +245,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_Scrollable_Set_002()
positionY_ += DELTA_Y_COORDINATE_2; positionY_ += DELTA_Y_COORDINATE_2;
UIScrollView* scroll = new UIScrollView(); UIScrollView* scroll = new UIScrollView();
scroll->SetIntercept(true);
scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH); scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH);
scroll->SetHorizontalScrollState(true); scroll->SetHorizontalScrollState(true);
...@@ -267,6 +273,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_Scroll_Blank_Set_001() ...@@ -267,6 +273,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_Scroll_Blank_Set_001()
positionY_ += DELTA_Y_COORDINATE_2; positionY_ += DELTA_Y_COORDINATE_2;
UIScrollView* scroll = new UIScrollView(); UIScrollView* scroll = new UIScrollView();
scroll->SetIntercept(true);
scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH); scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH);
scroll->SetScrollBlankSize(50); // (50): means scroll blank size scroll->SetScrollBlankSize(50); // (50): means scroll blank size
...@@ -293,6 +300,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_Scroll_listener_001() ...@@ -293,6 +300,7 @@ void UITestUIScrollView::UIKit_UIScrollView_Test_Scroll_listener_001()
positionY_ += DELTA_Y_COORDINATE_2; positionY_ += DELTA_Y_COORDINATE_2;
UIScrollView* scroll = new UIScrollView(); UIScrollView* scroll = new UIScrollView();
scroll->SetIntercept(true);
scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); scroll->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH); scroll->SetPosition(positionX_, positionY_, g_scrollW, g_scrollH);
container_->Add(scroll); container_->Add(scroll);
......
...@@ -84,6 +84,7 @@ void UITestUISwipeView::UIKit_Swipe_View_Test_Horizontal_001() ...@@ -84,6 +84,7 @@ void UITestUISwipeView::UIKit_Swipe_View_Test_Horizontal_001()
positionY_ += g_deltaCoordinateY2; positionY_ += g_deltaCoordinateY2;
UISwipeView* swipe = new UISwipeView(UISwipeView::HORIZONTAL); UISwipeView* swipe = new UISwipeView(UISwipeView::HORIZONTAL);
swipe->SetIntercept(true);
swipe->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); swipe->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
swipe->SetPosition(positionX_, positionY_, g_swipeW, g_swipeH); swipe->SetPosition(positionX_, positionY_, g_swipeW, g_swipeH);
swipe->SetBlankSize(100); // 100: is blank size swipe->SetBlankSize(100); // 100: is blank size
...@@ -112,6 +113,7 @@ void UITestUISwipeView::UIKit_Swipe_View_Test_Horizontal_002() ...@@ -112,6 +113,7 @@ void UITestUISwipeView::UIKit_Swipe_View_Test_Horizontal_002()
positionY_ += g_deltaCoordinateY2; positionY_ += g_deltaCoordinateY2;
UISwipeView* swipe = new UISwipeView(UISwipeView::HORIZONTAL); UISwipeView* swipe = new UISwipeView(UISwipeView::HORIZONTAL);
swipe->SetIntercept(true);
swipe->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); swipe->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
swipe->SetPosition(positionX_, positionY_, g_swipeW, g_swipeH); swipe->SetPosition(positionX_, positionY_, g_swipeW, g_swipeH);
swipe->SetLoopState(true); swipe->SetLoopState(true);
...@@ -147,6 +149,7 @@ void UITestUISwipeView::UIKit_Swipe_View_Test_Ver_001() ...@@ -147,6 +149,7 @@ void UITestUISwipeView::UIKit_Swipe_View_Test_Ver_001()
positionY_ += g_deltaCoordinateY2; positionY_ += g_deltaCoordinateY2;
UISwipeView* swipe = new UISwipeView(UISwipeView::VERTICAL); UISwipeView* swipe = new UISwipeView(UISwipeView::VERTICAL);
swipe->SetIntercept(true);
swipe->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); swipe->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
swipe->SetPosition(positionX_, positionY_, g_swipeH, g_swipeW); swipe->SetPosition(positionX_, positionY_, g_swipeH, g_swipeW);
container_->Add(swipe); container_->Add(swipe);
...@@ -174,6 +177,7 @@ void UITestUISwipeView::UIKit_Swipe_View_Test_Ver_002() ...@@ -174,6 +177,7 @@ void UITestUISwipeView::UIKit_Swipe_View_Test_Ver_002()
positionY_ += g_deltaCoordinateY2; positionY_ += g_deltaCoordinateY2;
UISwipeView* swipe = new UISwipeView(UISwipeView::VERTICAL); UISwipeView* swipe = new UISwipeView(UISwipeView::VERTICAL);
swipe->SetIntercept(true);
swipe->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); swipe->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
swipe->SetPosition(positionX_, positionY_, g_swipeH, g_swipeW); swipe->SetPosition(positionX_, positionY_, g_swipeH, g_swipeW);
swipe->SetLoopState(true); swipe->SetLoopState(true);
...@@ -207,6 +211,7 @@ void UITestUISwipeView::UIKit_Swipe_View_Test_Remove_001() ...@@ -207,6 +211,7 @@ void UITestUISwipeView::UIKit_Swipe_View_Test_Remove_001()
positionY_ += g_deltaCoordinateY2; positionY_ += g_deltaCoordinateY2;
UISwipeView* swipe = new UISwipeView(UISwipeView::HORIZONTAL); UISwipeView* swipe = new UISwipeView(UISwipeView::HORIZONTAL);
swipe->SetIntercept(true);
swipe->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); swipe->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
swipe->SetPosition(positionX_, positionY_, g_swipeH, g_swipeW); swipe->SetPosition(positionX_, positionY_, g_swipeH, g_swipeW);
swipe->SetLoopState(true); swipe->SetLoopState(true);
...@@ -267,6 +272,7 @@ void UITestUISwipeView::UIKit_Swipe_View_Test_Align_001(UISwipeView::AlignMode a ...@@ -267,6 +272,7 @@ void UITestUISwipeView::UIKit_Swipe_View_Test_Align_001(UISwipeView::AlignMode a
label->SetPosition(positionX_, lastY_ + g_blank); label->SetPosition(positionX_, lastY_ + g_blank);
UISwipeView* swipe = new UISwipeView(UISwipeView::HORIZONTAL); UISwipeView* swipe = new UISwipeView(UISwipeView::HORIZONTAL);
swipe->SetIntercept(true);
swipe->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full); swipe->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
// 100: offset // 100: offset
swipe->SetPosition(positionX_, label->GetY() + g_blank + g_deltaCoordinateY, g_swipeW - 100, g_swipeH); swipe->SetPosition(positionX_, label->GetY() + g_blank + g_deltaCoordinateY, g_swipeW - 100, g_swipeH);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册