VisualElementPropertyAnimation* pOpacityAnimation = null;
VisualElementPropertyAnimation* pBoundsAnimation = null;
- String* pOpenUserData = null;
- String* pCloseUserData = null;
-
- pOpenUserData = new (std::nothrow) String(L"BarOpenAnimation");
- SysTryCatch(NID_UI_CTRL, pOpenUserData, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed");
-
- pCloseUserData = new (std::nothrow) String(L"BarCloseAnimation");
- SysTryCatch(NID_UI_CTRL, pCloseUserData, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation is failed");
+ String* pUserData = null;
pAnimationGroup->SetDuration(ANIMATION_DURATION);
pOpacityAnimation->SetPropertyName("opacity");
- if (open == true)
+ if (open)
{
+ pUserData = new (std::nothrow) String(L"BarOpenAnimation");
+ SysTryCatch(NID_UI_CTRL, pUserData, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
pOpacityAnimation->SetStartValue(Variant(0.0f));
pOpacityAnimation->SetEndValue(Variant(1.0f));
}
else
{
+ pUserData = new (std::nothrow) String(L"BarCloseAnimation");
+ SysTryCatch(NID_UI_CTRL, pUserData, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
pOpacityAnimation->SetStartValue(Variant(1.0f));
pOpacityAnimation->SetEndValue(Variant(0.0f));
}
{
pBoundsAnimation->SetStartValue(Variant(FloatPoint(startValue.x, startValue.y)));
pBoundsAnimation->SetEndValue(Variant(FloatPoint(source.GetBounds().x, source.GetBounds().y)));
- pBoundsAnimation->SetUserData((void*)(pOpenUserData));
+ pBoundsAnimation->SetUserData((void*)(pUserData));
}
else
{
pBoundsAnimation->SetStartValue(Variant(FloatPoint(source.GetBounds().x, source.GetBounds().y)));
pBoundsAnimation->SetEndValue(Variant(FloatPoint(startValue.x, startValue.y)));
- pBoundsAnimation->SetUserData((void*)(pCloseUserData));
+ pBoundsAnimation->SetUserData((void*)(pUserData));
}
pBoundsAnimation->SetDuration(ANIMATION_DURATION);
pBoundsAnimation->SetVisualElementAnimationStatusEventListener(this);
CATCH:
delete pAnimationGroup;
- delete pOpenUserData;
- delete pCloseUserData;
+ delete pOpacityAnimation;
+ delete pUserData;
return null;
}