Hello,
I'm working on an app with an integrated map. I tried to implement gesturelistener for pinch panning an rotate.
So far they are working. But why do all three listener get triggerd if i start a gesture?
E.g. I have implemented the panningesture with 2 touchpoints and if I do a panning pinch and rotate also fired.
Do I have to do something special to diff between the gestures?
My implementation looks like (just some snippets ;)):
void MapviewerForm::OnPinchGestureStarted(Tizen::Ui::TouchPinchGestureDetector& gestureDetector)
{
AppLogDebug("Pinch started.");
ConsumeInputEvent();
}
void MapviewerForm::OnPinchGestureChanged(Tizen::Ui::TouchPinchGestureDetector& gestureDetector)
{
Pinch(gestureDetector.GetScale());
ConsumeInputEvent();
}
void MapviewerForm::OnPanningGestureStarted(Tizen::Ui::TouchPanningGestureDetector& gestureDetector)
{
Point point(0, 0);
bool twoTouchPoints = false;
Tizen::Base::Collection::IListT<TouchEventInfo*>* pList = Tizen::Ui::TouchEventManager::GetInstance()->GetTouchInfoListN();
if (pList != null)
{
int fingerCount = 2;
TouchEventInfo *pTouchInfo = null;
if (pList->GetCount() == fingerCount)
{
/*
* Just tracking second finger y-value
*/
pList->GetAt(1, pTouchInfo);
_panningStartDistance = pTouchInfo->GetCurrentPositionF().y;
twoTouchPoints = true;
}
pList->RemoveAll();
delete pList;
}
if (twoTouchPoints)
{
_panningActive = true;
}
AppLogDebug("Panning started");
ConsumeInputEvent();
}
}
void MapviewerForm::OnRotationGestureStarted(Tizen::Ui::TouchRotationGestureDetector& gestureDetector)
{
AppLogDebug("Rotating started");
_lastRotatingAngle = gestureDetector.GetAngle();
_rotatingActive = true;
ConsumeInputEvent();
}
}