#include <FAppAppControlProviderManager.h>
#include <FUiAnimVisualElement.h>
#include <FUiSystemUtil.h>
+#include <FUiAnimAnimationTransaction.h>
+#include <FUiAnimEaseInOutTimingFunction.h>
#include <FUiAnimVisualElementPropertyAnimation.h>
#include <FBaseSysLog.h>
#include <FBaseColAllElementsDeleter.h>
using namespace Tizen::Net::Nfc;
using namespace Tizen::Media;
-const int NfcPushUiForm::_DURATION_GROW_ = 500;
-const int NfcPushUiForm::_DURATION_OPACITY_ = 500;
-const int NfcPushUiForm::_DURATION_REPEAT_ = 500;
-const int NfcPushUiForm::_DURATION_OPACITY2_ = 500;
+const int NfcPushUiForm::_DURATION_GROW_ = 667;
+const int NfcPushUiForm::_DURATION_OPACITY_ = 497;
+const int NfcPushUiForm::_DURATION_REPEAT_ = 516;
+const int NfcPushUiForm::_DURATION_OPACITY2_ = 431;
NfcPushUiForm::NfcPushUiForm(void)
: __reqId(-1)
__pVisualElementBounds->SetBounds(__startRect);
- SysLog(NID_NET_NFC, "start to play animation");
- PlayBoundsAnimation(L"grow", 1, _DURATION_GROW_);
-
////////////////////////////////////////////////////////////////////////////////
// Opacity rectangle
////////////////////////////////////////////////////////////////////////////////
__endOpacity = 1.0f;
// draw the bitmap
+ pCanvas->SetBackgroundColor(Color(0x00000000));
+ pCanvas->Clear();
r = pCanvas->DrawBitmap(Point(__rect.x, __rect.y), *pBitmap);
SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to draw the bitmap.");
// set an opacity level
__pVisualElementOpacity->SetOpacity(__startOpacity);
+ SysLog(NID_NET_NFC, "start to play animation");
+ AnimationTransaction::Begin();
+ PlayBoundsAnimation(L"grow", 1, _DURATION_GROW_);
+ PlayOpacityAnimation(L"opacity", _DURATION_OPACITY_);
+ AnimationTransaction::Commit();
+
return r;
}
std::unique_ptr<VisualElementPropertyAnimation> pAnimation(new (std::nothrow) VisualElementPropertyAnimation());
SysTryReturnVoidResult(NID_NET_NFC, pAnimation != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ Tizen::Ui::Animations::EaseInOutTimingFunction* pTimingFunction = new EaseInOutTimingFunction();
+
// bounds
pAnimation->SetPropertyName(L"bounds");
pAnimation->SetStartValue(Variant(__startRect));
pAnimation->SetRepeatCount(repeatCount);
pAnimation->SetAutoReverseEnabled(autoReverse);
pAnimation->SetVisualElementAnimationStatusEventListener(this);
+ if (animationName == L"grow" || animationName == L"shrink")
+ {
+ pAnimation->SetTimingFunction(pTimingFunction);
+ }
__pVisualElementBounds->AddAnimation(animationName, *pAnimation);
}
pAnimation->SetEndValue(Variant(__endOpacity));
pAnimation->SetDuration(duration);
pAnimation->SetVisualElementAnimationStatusEventListener(this);
+ if (animationName == L"opacity")
+ {
+ pAnimation->SetDelay(247);
+ }
__pVisualElementOpacity->AddAnimation(animationName, *pAnimation);
}
{
if(completedNormally)
{
- if(keyName == L"grow")
- {
- PlayOpacityAnimation(L"opacity", _DURATION_OPACITY_);
- }
- else if (keyName == L"opacity")
+ if (keyName == L"opacity")
{
float margin = (__endRect.width * 0.2f) / 2;
__startRect = __endRect;
FinishAppControl(__reqId, APP_CTRL_RESULT_SUCCEEDED);
}
- else if (keyName == L"opacity2")
- {
-
-
- }
}
}
{
__startOpacity = __endOpacity;
__endOpacity = 0.0f;
- PlayOpacityAnimation(L"opacity2", _DURATION_OPACITY2_);
// reset the circles size
__startRect = __endRect;
__endRect = FloatRectangle(__startRect.x + 90.0f, __startRect.y + 90.0f, 0, 0);
// play animation
+ AnimationTransaction::Begin();
+ PlayOpacityAnimation(L"opacity2", _DURATION_OPACITY2_);
PlayBoundsAnimation(L"shrink", 1, 667, false);
+ AnimationTransaction::Commit();
}
// INfcDeviceDiscoveryEventListener