Languages

Menu
Sites
Language
Button stop works after applying VisualElementAnimation

I have a form with 2 buttons.

 result testForm::OnInitializing(void)
{
	//creating buttons
	m_pButtonOk = new Button();
	m_pButtonOk->Construct(Rectangle(100, 0, 200, 100), "Ok");
	m_pButtonOk->SetActionId(ID_BUTTON_OK);
	m_pButtonOk->AddActionEventListener(*this);
	AddControl(m_pButtonOk);

	m_pButtonShift= new Button();
	m_pButtonShift->Construct(Rectangle(100, 900, 200, 100), "Shift");
	m_pButtonShift->SetActionId(ID_BUTTON_SHIFT);
	m_pButtonShift->AddActionEventListener(*this);
	AddControl(m_pButtonShift);

	return E_SUCCESS;
}

void testForm::Shift()
{
	//applying shift animation
	VisualElementPropertyAnimation shift;
	shift.SetStartValue(Variant(FloatPoint(100, 0)));
	shift.SetEndValue(Variant(FloatPoint(500, 0)));
	shift.SetPropertyName("bounds.position");
	shift.SetDuration(3000);
	m_pButtonOk->GetVisualElement()->AddAnimation(shift);
}

void
testForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
{
	switch(actionId)
	{
	case ID_BUTTON_OK:
			AppLog("OK Button is clicked!\n");
		break;
	case ID_BUTTON_SHIFT:
			AppLog("Shift Button is clicked!\n");
			Shift();
		break;
	default:
		break;
	}
}

When user presses "Shift" button, "Ok" button is moving to a new position. But after animation is ended, Ok button stops working. It changes color when you tap on it, but OnActionPerformed is not firing. Looks like tap region for this event is not changed. What can you advise to me?

UPD

Developing on Tizen SDK 2.1.0 Build id : 20130416-1439, on emulator

 
Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

1 Replies
maklakov
i found a workaround. At creating VisualElementPropertyAnimation, you should set listener via SetVisualElementAnimationStatusEventListener, then at implementation OnVisualElementAnimationFinished set manually new bounds.