*/
#include <FGrpRectangle.h>
+#include <FUiAnimAnimationTransaction.h>
+#include <FUiAnimVisualElementPropertyAnimation.h>
#include <FGrp_CoordinateSystem.h>
#include <FUiAnim_VisualElementSurfaceImpl.h>
#include "FUiAnim_VisualElement.h"
#include "FUi_EcoreEvas.h"
#include "FUi_ResourceManager.h"
#include "FUi_CoordinateSystemUtils.h"
+#include "FUi_UiEventManager.h"
#include "FUi_Window.h"
+#include "FUi_TouchManager.h"
#include "FUiCtrl_Form.h"
#include "FUiCtrl_Indicator.h"
#include "FUiCtrl_IndicatorManager.h"
using namespace Tizen::Ui;
using namespace Tizen::Ui::Animations;
-namespace Tizen { namespace Ui { namespace Controls
-{
-
static const char* pPortraitSvcName = "elm_indicator_portrait";
static const char* pLandScapeSvcName = "elm_indicator_landscape";
static const char* pPortPublicKey = "__Plug_Ecore_Evas_Port";
static const char* pLandPublicKey = "__Plug_Ecore_Evas_Land";
static const char* pIndicatorKey = "Inidcator_Manager_Object";
static const int CONNECTION_INTERVAL = 1000;
+static const int ANIMATION_INTERVAL = 3000;
+static const int ANIMATION_DURATION = 300;
-#define MSG_DOMAIN_CONTROL_INDICATOR 0x10001
-#define MSG_ID_INDICATOR_REPEAT_EVENT 0x10002
-#define MSG_ID_INDICATOR_ROTATION 0x10003
-#define MSG_ID_INDICATOR_OPACITY 0X1004
-#define MSG_ID_INDICATOR_TYPE 0X1005
+static const int MSG_DOMAIN_CONTROL_INDICATOR = 0x10001;
+static const int MSG_ID_INDICATOR_REPEAT_EVENT = 0x10002;
+static const int MSG_ID_INDICATOR_ROTATION = 0x10003;
+static const int MSG_ID_INDICATOR_OPACITY = 0X1004;
+static const int MSG_ID_INDICATOR_TYPE = 0X1005;
+static const int MSG_ID_INDICATOR_START_ANIMATION = 0X10006;
+
+namespace Tizen { namespace Ui { namespace Controls
+{
-typedef enum
+struct _IndicatorDataAnimation
+{
+ Ecore_X_Window xwin;
+ double duration;
+};
+
+enum
{
_INDICATOR_TYPE_UNKNOWN, /**< Unknown indicator type mode */
_INDICATOR_TYPE_1, /**< Type 0 the the indicator */
_INDICATOR_TYPE_2, /**< Type 1 the indicator */
-} _IndicatorTypeMode;
+} _IndicatorType;
_Indicator*
_Indicator::CreateIndicator(void)
: __pPortraitIndicatorEvasObject(null)
, __pLandscapeIndicatorEvasObject(null)
, __pConnectionTimer(null)
+ , __pAnimationTimer(null)
, __pPortraitVisualElement(null)
, __pLandscapeVisualElement(null)
, __pCurrentVisualElement(null)
, __landscapeautohide(false)
, __opacity(_INDICATOR_OPACITY_OPAQUE)
, __orientation(_CONTROL_ORIENTATION_PORTRAIT)
+ , __startTouchPoint(0.0f, 0.0f)
+ , __animationing(false)
+ , __touchPressed(false)
{
}
delete __pConnectionTimer;
__pConnectionTimer = null;
}
+
+ if (__pAnimationTimer != null)
+ {
+ __pAnimationTimer->Cancel();
+ delete __pAnimationTimer;
+ __pAnimationTimer = null;
+ }
+
+ _UiEventManager::GetInstance()->RemoveTouchEventListener(*this);
}
result
_EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
SysTryReturnResult(NID_UI_CTRL, pEcoreEvas, E_SYSTEM, "[E_SYSTEM] Unable to get evas");
+ Ecore_X_Window win = 0;
+
if (__pWindow)
{
r = pEcoreEvas->SetIndicatorShowState(*__pWindow, state);
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ win = (Ecore_X_Window)__pWindow->GetNativeHandle();
}
__showstate = state;
{
Color bgColor(0x00000000);
SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
+ if (__pPortraitVisualElement)
+ {
+ __pPortraitVisualElement->SetShowState(false);
+ }
ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
+ ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_2);
}
else
{
SetIndicatorOpacity(__opacity);
+ if (__pPortraitVisualElement)
+ {
+ __pPortraitVisualElement->SetShowState(true);
+ }
ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_OPAQUE);
+ ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_1);
}
}
else
{
Color bgColor(0x00000000);
SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
+ if (__pLandscapeVisualElement)
+ {
+ __pLandscapeVisualElement->SetShowState(false);
+ }
ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
+ ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_2);
}
else
{
SetIndicatorOpacity(__opacity);
+ if (__pLandscapeVisualElement)
+ {
+ __pLandscapeVisualElement->SetShowState(true);
+ }
ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_OPAQUE);
+ ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_1);
}
}
__portraitautohide = portrait;
const Dimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSize();
const Dimension landscapeSize = Dimension(portraitSize.height, portraitSize.width);
- _ControlOrientation orientation = __pWindow->GetOrientation();
-
Rectangle indicatorbounds(0, 0, 0, 0);
- if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+ if (__orientation == _CONTROL_ORIENTATION_PORTRAIT)
{
indicatorbounds.width = portraitSize.width;
- GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, __pWindow->GetOrientation(), indicatorbounds.height);
}
else
{
indicatorbounds.width = landscapeSize.width;
- GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, __pWindow->GetOrientation(), indicatorbounds.height);
}
+ GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, __pWindow->GetOrientation(), indicatorbounds.height);
_CoordinateSystem* pCoordSystem = _CoordinateSystem::GetInstance();
SysTryReturn(NID_UI_CTRL, pCoordSystem, Rectangle(-1, -1, -1, -1), E_SYSTEM, "[E_SYSTEM] Coordinate system load failed.");
const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF();
const FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width);
- _ControlOrientation orientation = __pWindow->GetOrientation();
-
FloatRectangle indicatorbounds(0.0f, 0.0f, 0.0f, 0.0f);
- if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+ if (__orientation == _CONTROL_ORIENTATION_PORTRAIT)
{
indicatorbounds.width = portraitSize.width;
- GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, __pWindow->GetOrientation(), indicatorbounds.height);
}
else
{
indicatorbounds.width = landscapeSize.width;
- GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, __pWindow->GetOrientation(), indicatorbounds.height);
}
+ GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, __pWindow->GetOrientation(), indicatorbounds.height);
+
_CoordinateSystem* pCoordSystem = _CoordinateSystem::GetInstance();
SysTryReturn(NID_UI_CTRL, pCoordSystem, FloatRectangle(-1.0, -1.0, -1.0, -1.0), E_SYSTEM, "[E_SYSTEM] Coordinate system load failed.");
ecore_evas_callback_msg_handle_set(pPortraitEe, _Indicator::OnMessageHandle);
ecore_evas_callback_msg_handle_set(pLandscapeEe, _Indicator::OnMessageHandle);
+ Activate();
+
return r;
}
void
_Indicator::OnChangeLayout(_ControlOrientation orientation)
{
+ RemoveIndicatorAnimations();
+ if (__pAnimationTimer != null)
+ {
+ __pAnimationTimer->Cancel();
+ __animationing = false;
+ }
+
Ecore_X_Window win = 0;
if (__pWindow)
{
{
Color bgColor(0x00000000);
SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
+ if (__pPortraitVisualElement)
+ {
+ __pPortraitVisualElement->SetShowState(false);
+ }
ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
+ ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_2);
}
else
{
SetIndicatorOpacity(__opacity);
+ if (__pPortraitVisualElement)
+ {
+ __pPortraitVisualElement->SetShowState(true);
+ }
ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_OPAQUE);
+ ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_1);
}
}
{
Color bgColor(0x00000000);
SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
+ if (__pLandscapeVisualElement)
+ {
+ __pLandscapeVisualElement->SetShowState(false);
+ }
ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
+ ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_2);
}
else
{
SetIndicatorOpacity(__opacity);
+ if (__pLandscapeVisualElement)
+ {
+ __pLandscapeVisualElement->SetShowState(true);
+ }
ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_OPAQUE);
+ ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_1);
}
}
}
void
_Indicator::OnTimerExpired(Timer& timer)
{
- Eina_Bool result = EINA_TRUE;
-
- _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
- if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+ if (__pConnectionTimer == &timer)
{
- result = ecore_evas_extn_plug_connect(__pPortraitIndicatorEvasObject, pPortraitSvcName, 0, EINA_FALSE);
+ Eina_Bool result = EINA_TRUE;
+
+ _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
+ if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+ {
+ result = ecore_evas_extn_plug_connect(__pPortraitIndicatorEvasObject, pPortraitSvcName, 0, EINA_FALSE);
+ }
+ else
+ {
+ result = ecore_evas_extn_plug_connect(__pLandscapeIndicatorEvasObject, pLandScapeSvcName, 0, EINA_FALSE);
+ }
+
+ if (result == EINA_TRUE)
+ {
+ timer.Cancel();
+ }
+ else
+ {
+ timer.Start(CONNECTION_INTERVAL);
+ }
}
- else
+ else if(__pAnimationTimer == &timer)
{
- result = ecore_evas_extn_plug_connect(__pLandscapeIndicatorEvasObject, pLandScapeSvcName, 0, EINA_FALSE);
- }
+ ShowIndicatorEffect(false, ANIMATION_DURATION);
- if (result == EINA_TRUE)
- {
timer.Cancel();
- }
- else
- {
- timer.Start(CONNECTION_INTERVAL);
+ __animationing = false;
}
}
return;
}
+ _Indicator* pIndicator = (_Indicator*)ecore_evas_data_get(pEe, pIndicatorKey);
+ SysTryReturnVoidResult(NID_UI_CTRL, pIndicator, E_SYSTEM, "[E_SYSTEM] Unable to get Indicator Object");
+
Evas_Object* pPortraitIndicatorEvasObject = (Evas_Object*)ecore_evas_data_get(pEe, pPortPublicKey);
Evas_Object* pLandscapeIndicatorEvasObject = (Evas_Object*)ecore_evas_data_get(pEe, pLandPublicKey);
}
}
}
+ else if (msgId == MSG_ID_INDICATOR_START_ANIMATION)
+ {
+ _IndicatorDataAnimation* pData = (_IndicatorDataAnimation*)data;
+ Ecore_X_Window win = 0;
+ _Window* pWindow = pIndicator->__pWindow;
+ if (pWindow)
+ {
+ win = (Ecore_X_Window)pWindow->GetNativeHandle();
+ }
+
+ if (pData->xwin == win)
+ {
+ pIndicator->ShowIndicatorEffect(true, pData->duration);
+ }
+ }
+
}
}
return HIT_TEST_NOWHERE;
}
- Evas_Object* pImageObject = null;
- if (this->__pCurrentVisualElement)
+ if (__orientation == _CONTROL_ORIENTATION_PORTRAIT)
{
- _VisualElementImpl* pImpl = _VisualElementImpl::GetInstance(*this->__pCurrentVisualElement);
- if (pImpl)
+ if (__portraitautohide)
+ {
+ return HIT_TEST_NOWHERE;
+ }
+ else
+ {
+ return HIT_TEST_MATCH;
+ }
+ }
+ else
+ {
+ if (__landscapeautohide)
{
- _EflNode* pNativeNode = dynamic_cast< _EflNode* >(pImpl->GetNativeNode());
- if (pNativeNode)
+ return HIT_TEST_NOWHERE;
+ }
+ else
+ {
+ return HIT_TEST_MATCH;
+ }
+ }
+
+}
+
+void
+_Indicator::SetIndicatorOrientation(Tizen::Ui::_ControlOrientation orientation)
+{
+ __orientation = orientation;
+}
+
+void
+_Indicator::SetWindow(_Window* pWindow)
+{
+ __pWindow = pWindow;
+}
+
+result
+_Indicator::ShowIndicatorEffect(bool down, int duration)
+{
+ Ecore_X_Window win = 0;
+ if (__pWindow)
+ {
+ win = (Ecore_X_Window)__pWindow->GetNativeHandle();
+ }
+
+ VisualElementPropertyAnimation* pSlideAnimation = new (std::nothrow) VisualElementPropertyAnimation();
+ SysTryReturnResult(NID_UI_CTRL, pSlideAnimation, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ pSlideAnimation->SetDuration(duration);
+ pSlideAnimation->SetPropertyName( L"bounds.position");
+ pSlideAnimation->SetVisualElementAnimationStatusEventListener(this);
+
+ float indicatorHeight = 0.0f;
+ GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, __orientation, indicatorHeight);
+
+ String* pUserData = null;
+ if (down)
+ {
+ Color bgColor(0xff1e1e1e);
+ SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
+
+ if (__orientation == _CONTROL_ORIENTATION_PORTRAIT)
+ {
+ if (__pPortraitVisualElement)
{
- VisualElementSurface* pPortraitSurface = pNativeNode->GetSurface();
- if (pPortraitSurface)
- {
- _EflVisualElementSurfaceImpl* pSurface = dynamic_cast<_EflVisualElementSurfaceImpl*>(_VisualElementSurfaceImpl::GetInstance(*pPortraitSurface));
- if (pSurface)
- {
- pImageObject = (Evas_Object*)pSurface->GetNativeHandle();
- }
- }
+ __pPortraitVisualElement->SetShowState(true);
}
}
+ else
+ {
+ if (__pLandscapeVisualElement)
+ {
+ __pLandscapeVisualElement->SetShowState(true);
+ }
+ }
+
+ pSlideAnimation->SetStartValue(Variant(FloatPoint(0.0f, -indicatorHeight)));
+ pSlideAnimation->SetEndValue(Variant(FloatPoint(0.0f, 0.0f)));
+ ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_1);
+ pUserData = new (std::nothrow) String(L"DownAnimation");
+ SysTryReturnResult(NID_UI_CTRL, pUserData, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ }
+ else
+ {
+ pSlideAnimation->SetStartValue(Variant(FloatPoint(0.0f, 0.0f)));
+ pSlideAnimation->SetEndValue(Variant(FloatPoint(0.0f, -indicatorHeight)));
+ ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_2);
+ pUserData = new (std::nothrow) String(L"UpAnimation");
+ SysTryReturnResult(NID_UI_CTRL, pUserData, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ }
+ pSlideAnimation->SetUserData((void*)(pUserData));
+ AddAnimation( L"bounds.position", *pSlideAnimation);
+
+ delete pSlideAnimation;
+
+ return E_SUCCESS;
+}
+
+void
+_Indicator::RemoveIndicatorAnimations(void)
+{
+ if (__pAnimationTimer)
+ {
+ __pAnimationTimer->Cancel();
+ }
+ RemoveAllAnimations();
+}
+
+bool
+_Indicator::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
+{
+ bool r = false;
+ if (IsVisible() ==false)
+ {
+ return false;
}
- if (pImageObject)
+ int pointId = touchinfo.GetPointId();
+ _TouchManager* pTouchManager = _TouchManager::GetInstance();
+
+ FloatPoint touchPosition = source.ConvertToScreenPosition(touchinfo.GetCurrentPosition());
+ int indicatorHeight = 0;
+ if (__pWindow)
+ {
+ GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, __pWindow->GetOrientation(), indicatorHeight);
+ }
+ else
{
- if (!evas_object_repeat_events_get(pImageObject))
+ return false;
+ }
+ if (touchPosition.y < indicatorHeight)
+ {
+ if (__animationing)
{
- return HIT_TEST_MATCH;
+ return true;
}
else
{
- return HIT_TEST_NOWHERE;
+ __startTouchPoint = touchinfo.GetCurrentPosition();
+ __touchPressed = true;
+ __pointId = pointId;
+ }
+
+ if (__orientation == _CONTROL_ORIENTATION_PORTRAIT)
+ {
+ if (__portraitautohide)
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ }
+ else
+ {
+ if (__landscapeautohide)
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
}
}
+
+ if (pTouchManager->IsListenerOnly(pointId) == true )
+ {
+ return true;
+ }
else
{
- return HIT_TEST_NOWHERE;
+ return false;
+ }
+}
+
+bool
+_Indicator::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
+{
+ if (IsVisible() ==false)
+ {
+ return false;
+ }
+
+ _TouchManager* pTouchManager = _TouchManager::GetInstance();
+
+ if (__touchPressed)
+ {
+ if (touchinfo.GetPointId() == __pointId)
+ {
+ __touchPressed = false;
+ }
+
+ FloatPoint touchPosition = source.ConvertToScreenPosition(touchinfo.GetCurrentPosition());
+ int indicatorHeight = 0;
+ if (__pWindow)
+ {
+ GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, __pWindow->GetOrientation(), indicatorHeight);
+ }
+ else
+ {
+ return false;
+ }
+ if (touchPosition.y < indicatorHeight)
+ {
+ if (__animationing)
+ {
+ return true;
+ }
+ }
+
+ if (pTouchManager->IsListenerOnly(touchinfo.GetPointId()) == true)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ return false;
+}
+
+bool
+_Indicator::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
+{
+ bool r = false;
+
+ if (IsVisible() ==false)
+ {
+ return false;
+ }
+
+ int pointId = touchinfo.GetPointId();
+ _TouchManager* pTouchManager = _TouchManager::GetInstance();
+
+ if (__touchPressed)
+ {
+ FloatPoint touchPoint = touchinfo.GetCurrentPosition();
+ float gap = touchPoint.y - __startTouchPoint.y;
+
+ int touchGap = 0;
+ if (__pWindow)
+ {
+ GET_SHAPE_CONFIG(FORM::INDICATOR_TOUCH_GAP, __pWindow->GetOrientation(), touchGap);
+ }
+ else
+ {
+ return false;
+ }
+
+ if (gap < touchGap || __animationing)
+ {
+ }
+ else
+ {
+ if (__orientation == _CONTROL_ORIENTATION_PORTRAIT)
+ {
+ if (__portraitautohide)
+ {
+ ShowIndicatorEffect(true, ANIMATION_DURATION);
+ }
+ }
+ else
+ {
+ if (__landscapeautohide)
+ {
+ ShowIndicatorEffect(true, ANIMATION_DURATION);
+ }
+ }
+ }
+
+ if (pTouchManager->IsListenerOnly(pointId) == true)
+ {
+ r = true;
+ }
+ else
+ {
+ r = false;
+ }
+ }
+ else
+ {
+ r = false;
+ }
+ return r;
+}
+
+bool
+_Indicator::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
+{
+ return false;
+}
+
+void
+_Indicator::OnVisualElementAnimationStarted(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target)
+{
+ String* pUserData = (String*) animation.GetUserData();
+
+ if ((pUserData != null) && (*pUserData == String(L"DownAnimation")))
+ {
+ if (__pAnimationTimer == null)
+ {
+ __pAnimationTimer = new (std::nothrow) Timer;
+ if (__pAnimationTimer == null)
+ {
+ return;
+ }
+
+ result r = __pAnimationTimer->Construct(*this);
+ if (r != E_SUCCESS)
+ {
+ delete __pAnimationTimer;
+ __pAnimationTimer = null;
+
+ return;
+ }
+ }
+
+ __pAnimationTimer->Start(ANIMATION_INTERVAL);
+
+ __animationing = true;
}
}
void
-_Indicator::SetIndicatorOrientation(Tizen::Ui::_ControlOrientation orientation)
+_Indicator::OnVisualElementAnimationRepeated(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, long currentRepeatCount)
{
- __orientation = orientation;
+
}
void
-_Indicator::SetWindow(_Window* pWindow)
+_Indicator::OnVisualElementAnimationFinished(const Tizen::Ui::Animations::VisualElementAnimation& animation, const Tizen::Base::String& keyName, Tizen::Ui::Animations::VisualElement& target, bool completedNormally)
{
- __pWindow = pWindow;
+ String* pUserData = (String*) animation.GetUserData();
+
+ if ((pUserData != null) && (*pUserData == String(L"UpAnimation")))
+ {
+ Color bgColor(0x00000000);
+ SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
+
+ int indicatorHeight = 0;
+ GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, __pWindow->GetOrientation(), indicatorHeight);
+ SetBounds(FloatRectangle(0.0f, 0.0f, GetIndicatorBoundsF().width, indicatorHeight));
+
+ if (__orientation == _CONTROL_ORIENTATION_PORTRAIT)
+ {
+ if (__pPortraitVisualElement)
+ {
+ __pPortraitVisualElement->SetShowState(false);
+ }
+ }
+ else
+ {
+ if (__pLandscapeVisualElement)
+ {
+ __pLandscapeVisualElement->SetShowState(false);
+ }
+ }
+ delete pUserData;
+ }
+}
+
+void
+_Indicator::Activate(void)
+{
+ _UiEventManager::GetInstance()->AddTouchEventListener(*this);
+
+ return;
+}
+
+void
+_Indicator::Deactivate(void)
+{
+ _UiEventManager::GetInstance()->RemoveTouchEventListener(*this);
+
+ if (__pAnimationTimer)
+ {
+ __pAnimationTimer->Cancel();
+ }
+ RemoveAllAnimations();
+
+ Ecore_X_Window win = 0;
+ if (__pWindow)
+ {
+ win = (Ecore_X_Window)__pWindow->GetNativeHandle();
+ }
+
+ if (__orientation == _CONTROL_ORIENTATION_PORTRAIT)
+ {
+ if (__portraitautohide)
+ {
+ Color bgColor(0x00000000);
+ SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
+
+ if (__pPortraitVisualElement)
+ {
+ __pPortraitVisualElement->SetShowState(false);
+ ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_2);
+ }
+ __animationing = false;
+ }
+ }
+ else
+ {
+ if (__landscapeautohide)
+ {
+ Color bgColor(0x00000000);
+ SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
+
+ if (__pLandscapeVisualElement)
+ {
+ __pLandscapeVisualElement->SetShowState(false);
+ ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_2);
+ }
+ __animationing = false;
+ }
+ }
+
+ return;
}
}}} // Tizen::Ui::Controls