Skip to main content
Exit0815
Senior
February 12, 2022
Solved

Swipe Container: Swipe does not work when start on a Button

  • February 12, 2022
  • 2 replies
  • 1283 views

Hello,

i have a swipe container to have the nice animation between "Screens" without scolling some fix containers.

The problem i have is that i have multiple flexbuttons (for changing pages when clicked) inside the swipe container. If i try to swipe the screen on top of the flex-buttons it will not work.

Means, i need a "free space" where i am able to swipe.

Is there any solution or any idea for a workaround?

On my smartphone i can also swipe when i start swiping on an icon of an app and don't need to start swipe on the background :)

Thanks a lot.

This topic has been closed for replies.
Best answer by Zwei.9

Hi,

Transfer your ClickEvent of button into swipeContianer.

void XXXXX::clickActionButtonHandler(const CustomButton& _btn, const ClickEvent& evt)

{

if (&_btn == &customButton1)

{

mySwipeContainer.handleClickEvent(evt);

if (mySwipeContainer.isAnimating())

return;

}

}

Transfer your DragEventof button into swipeContianer.

void XXXXX::dragActionButtonHandler(const CustomButton& _btn, const DragEvent& evt)

{

if (&_btn == &customButton1)

{

mySwipeContainer.handleDragEvent(evt);

customButton1.toReleaseState();//change pressed state when drag

customButton1.invalidate();

}

}

2 replies

Zwei.9
Zwei.9Best answer
Associate III
February 16, 2022

Hi,

Transfer your ClickEvent of button into swipeContianer.

void XXXXX::clickActionButtonHandler(const CustomButton& _btn, const ClickEvent& evt)

{

if (&_btn == &customButton1)

{

mySwipeContainer.handleClickEvent(evt);

if (mySwipeContainer.isAnimating())

return;

}

}

Transfer your DragEventof button into swipeContianer.

void XXXXX::dragActionButtonHandler(const CustomButton& _btn, const DragEvent& evt)

{

if (&_btn == &customButton1)

{

mySwipeContainer.handleDragEvent(evt);

customButton1.toReleaseState();//change pressed state when drag

customButton1.invalidate();

}

}

Exit0815
Exit0815Author
Senior
February 16, 2022

Thank you very much.

Thats sounds logical and i will test it as soon as i have time.