}
}
+// Tizen::Ui::Animations::IAnimationTransactionEventListener
+void
+_EditDate::OnAnimationTransactionStarted(int transactionId)
+{
+ return;
+}
+
+void
+_EditDate::OnAnimationTransactionStopped(int transactionId)
+{
+ __pEditDatePresenter->EndTransaction();
+ return;
+}
+
+void
+_EditDate::OnAnimationTransactionFinished(int transactionId)
+{
+ __pEditDatePresenter->EndTransaction();
+ return;
+}
+
}}} // Tizen::Ui::Controls
*/
#include <vconf.h>
+#include <FGrpColor.h>
+#include <FUiControl.h>
+#include <FUiAnimAnimationTransaction.h>
+#include <FUiAnimVisualElementPropertyAnimation.h>
#include <FGrp_TextTextObject.h>
#include <FGrp_TextTextSimple.h>
#include <FGrp_CanvasImpl.h>
#include <FGrp_BitmapImpl.h>
#include <FGrp_FontImpl.h>
#include "FUi_ResourceManager.h"
+#include "FUi_CoordinateSystemUtils.h"
+#include "FUiAnim_VisualElement.h"
#include "FUiCtrl_EditDatePresenter.h"
#include "FUiCtrl_EditDate.h"
#include "FUiCtrl_DateTimeModel.h"
#include "FUiCtrl_DateTimeUtils.h"
-#include "FUiControl.h"
-#include "FUiAnim_VisualElement.h"
-#include "FUiAnimVisualElementPropertyAnimation.h"
-#include "FGrpColor.h"
-#include "FUi_CoordinateSystemUtils.h"
using namespace Tizen::Graphics;
using namespace Tizen::Base;
, __elementWidth(0.0f)
, __isEnterKeyPressed(false)
, __isFocused(false)
+ , __transactionId(0)
{
}
delete __pContentBgEffectDisabledBitmap;
__pContentBgEffectDisabledBitmap = null;
+ if (__transactionId != 0)
+ {
+ AnimationTransaction::Stop(__transactionId);
+ }
+
if (__pContentProvider != null)
{
+ __pEditDate->GetVisualElement()->DetachChild(__pContentProvider);
__pContentProvider->Destroy();
__pContentProvider = null;
}
__isEditDateInitialized = true;
CalculateAreaBounds();
-
return r;
}
pNewBoundsAnimation->SetPropertyName("bounds.position");
pNewBoundsAnimation->SetStartValue(Variant(FloatPoint(pNewVisualElement->GetBounds().x, oldTextDim.height)));
pNewBoundsAnimation->SetEndValue(Variant(FloatPoint(pNewVisualElement->GetBounds().x, 0.0f)));
- pNewBoundsAnimation->SetVisualElementAnimationStatusEventListener(this);
pOldBoundsAnimation = new (std::nothrow) VisualElementPropertyAnimation();
SysTryCatch(NID_UI_CTRL, (pOldBoundsAnimation != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
pOldBoundsAnimation->SetPropertyName("bounds.position");
pOldBoundsAnimation->SetStartValue(Variant(FloatPoint(pOldVisualElement->GetBounds().x, 0.0f)));
pOldBoundsAnimation->SetEndValue(Variant(FloatPoint(pOldVisualElement->GetBounds().x, oldTextDim.height * -1.0f)));
- pOldBoundsAnimation->SetVisualElementAnimationStatusEventListener(this);
pOldSimpleText = new (std::nothrow)TextSimple((const_cast <wchar_t*>(__lastSelectedValue.GetPointer())), __lastSelectedValue.GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
SysTryCatch(NID_UI_CTRL, (pOldSimpleText != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
pCanvas = null;
pOldVisualElement->SetImplicitAnimationEnabled(false);
- pOldVisualElement->AddAnimation(*pOldBoundsAnimation);
-
pNewVisualElement->SetImplicitAnimationEnabled(false);
+
+ AnimationTransaction::Begin(__transactionId);
+ pOldVisualElement->AddAnimation(*pOldBoundsAnimation);
pNewVisualElement->AddAnimation(*pNewBoundsAnimation);
+ AnimationTransaction::SetCurrentTransactionEventListener(__pEditDate);
+ AnimationTransaction::Commit();
delete pOldBoundsAnimation;
delete pNewBoundsAnimation;
}
void
-_EditDatePresenter::OnVisualElementAnimationFinished (const VisualElementAnimation &animation, const String &keyName, VisualElement &target, bool completedNormally)
+_EditDatePresenter::EndTransaction(void)
{
result r = E_SUCCESS;
- __isAnimating = false;
+ __isAnimating = false;
VisualElement* pEditDateElement = __pEditDate->GetVisualElement();
r = GetLastResult();
SysTryReturnVoidResult(NID_UI_CTRL, (pEditDateElement != null), r, "[%s] Propagating.", GetErrorMessage(r));
pEditDateElement->DetachChild(*__pContentProvider);
__pContentProvider->Destroy();
__pContentProvider = null;
- Draw();
}
+ Draw();
+ __transactionId = 0;
return;
}
-
}}} // Tizen::Ui::Controls
return false;
}
+// Tizen::Ui::Animations::IAnimationTransactionEventListener
+void
+_EditTime::OnAnimationTransactionStarted(int transactionId)
+{
+ return;
+}
+
+void
+_EditTime::OnAnimationTransactionStopped(int transactionId)
+{
+ __pEditTimePresenter->EndTransaction();
+ return;
+}
+
+void
+_EditTime::OnAnimationTransactionFinished(int transactionId)
+{
+ __pEditTimePresenter->EndTransaction();
+ return;
+}
+
}}} // Controls
*/
#include <FSysSettingInfo.h>
+#include <FGrpColor.h>
+#include <FUiAnimAnimationTransaction.h>
+#include <FUiAnimVisualElementPropertyAnimation.h>
#include <FGrp_BitmapImpl.h>
#include <FGrp_TextTextObject.h>
#include <FGrp_TextTextSimple.h>
#include <FGrp_FontImpl.h>
#include "FUi_CoordinateSystemUtils.h"
#include "FUi_ResourceManager.h"
+#include "FUiAnim_VisualElement.h"
#include "FUiCtrl_EditTimePresenter.h"
#include "FUiCtrl_EditTime.h"
#include "FUiCtrl_DateTimeModel.h"
#include "FUiCtrl_DateTimeUtils.h"
-#include "FUiAnim_VisualElement.h"
-#include "FUiAnimVisualElementPropertyAnimation.h"
-#include "FGrpColor.h"
+
using namespace Tizen::Graphics;
using namespace Tizen::Base;
, __isEditTimeInitialized(false)
, __isEnterKeyPressed(false)
, __isFocused(false)
+ , __transactionId(0)
{
}
delete __pContentBgEffectDisabledBitmap;
__pContentBgEffectDisabledBitmap = null;
+
+ if (__transactionId != 0)
+ {
+ AnimationTransaction::Stop(__transactionId);
+ }
+
+ if (__pContentProvider != null)
+ {
+ __pEditTime->GetVisualElement()->DetachChild(__pContentProvider);
+ __pContentProvider->Destroy();
+ __pContentProvider = null;
+ }
}
_EditTimePresenter*
}
Canvas* pCanvas = __pEditTime->GetCanvasN();
- SysAssertf((pCanvas != null), "Failed to get canvas.");
+ r = GetLastResult();
+ SysTryReturnResult(NID_UI_CTRL, (pCanvas != null), r, "Failed to get canvas.");
FloatRectangle colonBounds(0.0f, 0.0f, 0.0f, 0.0f);
pNewBoundsAnimation->SetPropertyName("bounds.position");
pNewBoundsAnimation->SetStartValue(Variant(FloatPoint(pNewVisualElement->GetBounds().x, oldTextDim.height)));
pNewBoundsAnimation->SetEndValue(Variant(FloatPoint(pNewVisualElement->GetBounds().x, 0.0f)));
- pNewBoundsAnimation->SetVisualElementAnimationStatusEventListener(this);
pOldBoundsAnimation = new (std::nothrow) VisualElementPropertyAnimation();
SysTryCatch(NID_UI_CTRL, (pOldBoundsAnimation != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
pOldBoundsAnimation->SetPropertyName("bounds.position");
pOldBoundsAnimation->SetStartValue(Variant(FloatPoint(pOldVisualElement->GetBounds().x, 0.0f)));
pOldBoundsAnimation->SetEndValue(Variant(FloatPoint(pOldVisualElement->GetBounds().x, oldTextDim.height * -1.0f)));
- pOldBoundsAnimation->SetVisualElementAnimationStatusEventListener(this);
pOldSimpleText = new (std::nothrow)TextSimple((const_cast <wchar_t*>(__lastSelectedValue.GetPointer())), __lastSelectedValue.GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
SysTryCatch(NID_UI_CTRL, (pOldSimpleText != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
pCanvas = null;
pOldVisualElement->SetImplicitAnimationEnabled(false);
- pOldVisualElement->AddAnimation(*pOldBoundsAnimation);
-
pNewVisualElement->SetImplicitAnimationEnabled(false);
+
+ AnimationTransaction::Begin(__transactionId);
+ pOldVisualElement->AddAnimation(*pOldBoundsAnimation);
pNewVisualElement->AddAnimation(*pNewBoundsAnimation);
+ AnimationTransaction::SetCurrentTransactionEventListener(__pEditTime);
+ AnimationTransaction::Commit();
delete pOldBoundsAnimation;
delete pNewBoundsAnimation;
}
void
-_EditTimePresenter::OnVisualElementAnimationFinished (const VisualElementAnimation &animation, const String &keyName, VisualElement &target, bool completedNormally)
+_EditTimePresenter::EndTransaction(void)
{
result r = E_SUCCESS;
- __isAnimating = false;
+ __isAnimating = false;
VisualElement* pEditTimeElement = __pEditTime->GetVisualElement();
r = GetLastResult();
SysTryReturnVoidResult(NID_UI_CTRL, (pEditTimeElement != null), r, "[%s] Propagating.", GetErrorMessage(r));
- pEditTimeElement->DetachChild(*__pContentProvider);
- __pContentProvider->Destroy();
- __pContentProvider = null;
+ if (__pContentProvider != null)
+ {
+ pEditTimeElement->DetachChild(*__pContentProvider);
+ __pContentProvider->Destroy();
+ __pContentProvider = null;
+
+ }
Draw();
+ __transactionId = 0;
return;
}
-
}}} // Tizen::Ui::Controls
#define _FUI_CTRL_INTERNAL_EDITDATE_H_
#include <FSysISettingEventListener.h>
+#include <FUiAnimIAnimationTransactionEventListener.h>
#include "FUi_Control.h"
#include "FUi_UiTouchEvent.h"
#include "FUiCtrl_IDateTimeChangeEventListener.h"
: public _Control
, public _IDateTimeChangeEventListener
, public _IActionEventListener
+ , public Tizen::Ui::Animations::IAnimationTransactionEventListener
, virtual public Tizen::Base::Runtime::IEventListener
, virtual public _IUiEventListener
, virtual public _IUiEventPreviewer
void OnAncestorEnableStateChanged(const _Control& control);
void OnAncestorVisibleStateChanged(const _Control& control);
+ // Tizen::Ui::Animations::IAnimationTransactionEventListener
+ virtual void OnAnimationTransactionStarted(int transactionId);
+ virtual void OnAnimationTransactionStopped(int transactionId);
+ virtual void OnAnimationTransactionFinished(int transactionId);
+
private:
_EditDate(void);
#include <FGrp_TextTextObject.h>
#include "FUi_Control.h"
#include "FUiCtrl_DateTimeDefine.h"
-#include "FUiAnimIVisualElementAnimationStatusEventListener.h"
namespace Tizen { namespace Ui { namespace Controls
{
class _EditDatePresenter
: public Tizen::Base::Object
- , Tizen::Ui::Animations::IVisualElementAnimationStatusEventListener
{
public:
_EditDatePresenter(void);
virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
- virtual void OnVisualElementAnimationFinished (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, bool completedNormally);
- virtual void OnVisualElementAnimationRepeated (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, long currentRepeatCount){}
- virtual void OnVisualElementAnimationStarted (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target){}
-
+ void EndTransaction(void);
private:
_EditDatePresenter(const _EditDatePresenter&);
_EditDatePresenter& operator =(const _EditDatePresenter&);
static const int __dividerCount = 2;
bool __isEnterKeyPressed;
bool __isFocused;
+ int __transactionId;
}; // _EditDatePresenter
}}} // Tizen::Ui::Controls
#define _FUI_CTRL_INTERNAL_EDITTIME_H_
#include <FSysISettingEventListener.h>
+#include <FUiAnimIAnimationTransactionEventListener.h>
#include "FUi_Control.h"
#include "FUi_UiTouchEvent.h"
+#include "FUi_IAccessibilityListener.h"
#include "FUiCtrl_IDateTimeChangeEventListener.h"
#include "FUiCtrl_DateTimeChangeEvent.h"
#include "FUiCtrl_IActionEventListener.h"
-#include "FUi_IAccessibilityListener.h"
#include "FUiCtrl_DateTimeBar.h"
namespace Tizen { namespace Ui
, public _IDateTimeChangeEventListener
, public _IActionEventListener
, public _IAccessibilityListener
+ , public Tizen::Ui::Animations::IAnimationTransactionEventListener
, virtual public Tizen::Base::Runtime::IEventListener
, virtual public _IUiEventListener
, virtual public _IUiEventPreviewer
virtual bool OnAccessibilityActionPerformed(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element);
virtual bool OnAccessibilityValueIncreased(const Tizen::Ui::_AccessibilityContainer&, const Tizen::Ui::_AccessibilityElement&);
virtual bool OnAccessibilityValueDecreased(const Tizen::Ui::_AccessibilityContainer&, const Tizen::Ui::_AccessibilityElement&);
+
+ // Tizen::Ui::Animations::IAnimationTransactionEventListener
+ virtual void OnAnimationTransactionStarted(int transactionId);
+ virtual void OnAnimationTransactionStopped(int transactionId);
+ virtual void OnAnimationTransactionFinished(int transactionId);
private:
_EditTime(void);
#include <FGrp_TextTextObject.h>
#include "FUi_Control.h"
#include "FUiCtrl_DateTimeDefine.h"
-#include "FUiAnimIVisualElementAnimationStatusEventListener.h"
namespace Tizen { namespace Ui { namespace Controls
{
class _EditTimePresenter
: public Tizen::Base::Object
- , Tizen::Ui::Animations::IVisualElementAnimationStatusEventListener
{
public:
_EditTimePresenter(const Tizen::Base::String& title);
void UpdateTimeFormat(void);
void UpdateLastSelectedValue(_DateTimeId boxId, bool __isTouchPressed);
- virtual void OnVisualElementAnimationFinished (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, bool completedNormally);
- virtual void OnVisualElementAnimationRepeated (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target, long currentRepeatCount){}
- virtual void OnVisualElementAnimationStarted (const Tizen::Ui::Animations::VisualElementAnimation &animation, const Tizen::Base::String &keyName, Tizen::Ui::Animations::VisualElement &target){}
result DrawFocus(void);
+ void EndTransaction(void);
+
private:
_EditTimePresenter(const _EditTimePresenter&);
bool __isEditTimeInitialized;
bool __isEnterKeyPressed;
bool __isFocused;
+ int __transactionId;
}; // _EditTimePresenter
}}} // Tizen::Ui::Controls