#include "FUiAnim_RootVisualElement.h"
#include "FUiAnim_DisplayManager.h"
#include "FUiCtrl_Frame.h"
-#include "FUiCtrl_FrameImpl.h"
-#include "FUiCtrl_FormImpl.h"
#include "FUi_Clipboard.h"
#include "FUi_TouchManager.h"
#include "FUi_ControlManager.h"
#include "FUi_ActiveWindowEvent.h"
#include "FUi_ControlImplManager.h"
+#include "FUiCtrl_Popup.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Runtime;
int w = 0;
int h = 0;
ecore_x_e_illume_clipboard_geometry_get(zone, &x, &y, &w, &h);
-
+
Dimension clipboardDim = _CoordinateSystemUtils::InverseTransform(Dimension(w, h));
if (__clipboardHeight == 0)
int w = 0;
int h = 0;
ecore_x_e_illume_clipboard_geometry_get(zone, &x, &y, &w, &h);
-
+
Dimension clipboardDim = _CoordinateSystemUtils::InverseTransform(Dimension(w, h));
if (clipboardDim.height != 0)
{
Ecore_X_Event_Client_Message* pClientEvent = static_cast<Ecore_X_Event_Client_Message*>(pEvent);
SysTryReturn(NID_UI, pClientEvent, ECORE_CALLBACK_RENEW, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
-
+
_ControlManager* pControlManager = _ControlManager::GetInstance();
if (pClientEvent->message_type == __atomRotateRootAngle)
{
return ECORE_CALLBACK_RENEW;
}
-
+
int x = 0;
int y = 0;
if ((unsigned int)pClientEvent->data.l[1] == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_NEXT)
SysLog(NID_UI, "Accessibility action : Read");
_AccessibilityGesture::ProcessGesture(_ACCESSIBILITY_GESTURE_TYPE_ONE_FINGER_ONE_TAP, x, y);
}
- else if ((unsigned int)pClientEvent->data.l[1] == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_UP)
+ else if ((unsigned int)pClientEvent->data.l[1] == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_UP)
{
SysLog(NID_UI, "Accessibility action : value increased");
_AccessibilityGesture::ProcessGesture(_ACCESSIBILITY_GESTURE_TYPE_VALUE_INCREASED);
- }
+ }
else if ((unsigned int)pClientEvent->data.l[1] == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DOWN)
{
SysLog(NID_UI, "Accessibility action : value decreased");
}
}
- if (pClientEvent->message_type == ECORE_X_ATOM_E_WINDOW_ROTATION_CHANGE_REQUEST)
- {
- SysLog(NID_UI, "[Ime Rotation]");
-
- _Window* pWindow = pControlManager->GetCurrentFrame();
- if (pWindow)
- {
- NativeWindowHandle handle = pWindow->GetNativeHandle();
-
- if (pClientEvent->win == handle)
- {
- int angle = pClientEvent->data.l[1];
- SysLog(NID_UI, "[Ime Rotation] Receive the client message(xid = 0x%x, angle = %d)", handle, angle);
-
- _Frame* pFrame = dynamic_cast<_Frame*>(pWindow);
-
- if (pFrame)
- {
- _FrameImpl* pFrameImpl = static_cast<Controls::_FrameImpl*>(pFrame->GetUserData());
- if (pFrameImpl)
- {
- _FormImpl* pCurrentFormImpl = pFrameImpl->GetCurrentForm();
-
- if (pCurrentFormImpl)
- {
- pCurrentFormImpl->UpdateOrientation(angle);
- }
- else
- {
- pFrameImpl->UpdateOrientation(angle);
- }
- }
- }
- }
- }
- }
-
return ECORE_CALLBACK_RENEW;
}
}
}
- _Window* pWindow = const_cast<_Window*>(&window);
- if (pWindow->IsLayoutChangable() == true)
- {
- rotatePartial = false;
- }
-
Evas_Object* pWinObj = pLayer->GetElmWin();
Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
Rectangle winBounds = _CoordinateSystemUtils::Transform(window.GetBounds());
int rotate = ecore_evas_rotation_get(pEcoreEvas);
+ _Window* pWindow = const_cast<_Window*>(&window);
+ if (pWindow->IsLayoutChangable() == true)
+ {
+ _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);
+ if (pPopup)
+ {
+ Rectangle nativeBounds(0, 0, 0, 0);
+
+ if ((rotate == 0) || (rotate == 180))
+ {
+ nativeBounds = pPopup->GetNativeBounds(true);
+ }
+ else
+ {
+ nativeBounds = pPopup->GetNativeBounds(false);
+ }
+
+ winBounds.x = nativeBounds.x;
+ winBounds.y = nativeBounds.y;
+ winBounds.width = nativeBounds.width;
+ winBounds.height = nativeBounds.height;
+ }
+ }
+
int winX = winBounds.x;
int winY = winBounds.y;
{
return;
}
-
+
Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
if (win == 0)
{
if (ret < 0)
{
- return 0;
+ return 0;
}
}
return true;
}
*/
-
+
return true;
}
Rectangle winBounds = _CoordinateSystemUtils::Transform(bounds);
+ int rotate = ecore_evas_rotation_get(pEcoreEvas);
+
+ _Window* pWindow = const_cast<_Window*>(&window);
+ if (pWindow->IsLayoutChangable() == true)
+ {
+ _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);
+ if (pPopup)
+ {
+ Rectangle nativeBounds(0, 0, 0, 0);
+
+ if ((rotate == 0) || (rotate == 180))
+ {
+ nativeBounds = pPopup->GetNativeBounds(true);
+ }
+ else
+ {
+ nativeBounds = pPopup->GetNativeBounds(false);
+ }
+
+ winBounds.x = nativeBounds.x;
+ winBounds.y = nativeBounds.y;
+ winBounds.width = nativeBounds.width;
+ winBounds.height = nativeBounds.height;
+ }
+ }
+
int winX = winBounds.x;
int winY = winBounds.y;
int rootH = 0;
ecore_x_window_size_get(ecore_x_window_root_get(win), &rootW, &rootH);
- int rotate = ecore_evas_rotation_get(pEcoreEvas);
switch (rotate)
{
case 270:
Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
evas_object_move(pWinObject, winX, winY);
-
+
if (ret == EINA_FALSE)
{
evas_object_resize(pWinObject, winBounds.width, winBounds.height);
FloatRectangle winBoundsF = _CoordinateSystemUtils::Transform(bounds);
Rectangle winBounds = _CoordinateSystemUtils::ConvertToInteger(winBoundsF);
+ int rotate = ecore_evas_rotation_get(pEcoreEvas);
+
+ _Window* pWindow = const_cast<_Window*>(&window);
+ if (pWindow->IsLayoutChangable() == true)
+ {
+ _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);
+ if (pPopup)
+ {
+ Rectangle nativeBounds(0, 0, 0, 0);
+
+ if ((rotate == 0) || (rotate == 180))
+ {
+ nativeBounds = pPopup->GetNativeBounds(true);
+ }
+ else
+ {
+ nativeBounds = pPopup->GetNativeBounds(false);
+ }
+
+ winBounds.x = nativeBounds.x;
+ winBounds.y = nativeBounds.y;
+ winBounds.width = nativeBounds.width;
+ winBounds.height = nativeBounds.height;
+ }
+ }
+
int winX = winBounds.x;
int winY = winBounds.y;
int rootH = 0;
ecore_x_window_size_get(ecore_x_window_root_get(win), &rootW, &rootH);
- int rotate = ecore_evas_rotation_get(pEcoreEvas);
switch (rotate)
{
case 270:
Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
evas_object_move(pWinObject, winX, winY);
-
+
if (ret == EINA_FALSE)
{
evas_object_resize(pWinObject, winBounds.width, winBounds.height);
int* rotations = null;
unsigned int count = 0;
Eina_Bool ret = ecore_evas_wm_rotation_available_rotations_get(pOwnerLayer->GetEcoreEvas(), &rotations, &count);
-
+
if (ret)
{
if (rotations)
free(rotations);
}
}
-
+
bool preferredRoation = pOwnerWindow->GetPreferredRotation();
if (preferredRoation == true)
{
using namespace Tizen::Graphics::_Text;
using namespace Tizen::Ui::Animations;
+namespace {
+const int SCROLL_PANEL_FIXED_FLICK_AMOUNT = 1000;
+}
+
namespace Tizen { namespace Ui { namespace Controls
{
int
_IconListPresenter::CalculateFlickAmount(int distance, int duration)
{
- return ((((distance * SCROLL_FLICK_IN_PIXEL_UNIT) / duration) * SCROLL_FLICK_WEIGHT_VELOCITY) + (distance * SCROLL_FLICK_WEIGHT_DISTANCE)) / SCROLL_FLICK_ALPHA_PER_PIXEL;
+ if (_FloatCompare(distance, 0.0f))
+ {
+ return 0.0f;
+ }
+ else if (distance < 0.0)
+ {
+ return -SCROLL_PANEL_FIXED_FLICK_AMOUNT;
+ }
+ else
+ {
+ return SCROLL_PANEL_FIXED_FLICK_AMOUNT;
+ }
}
void
targetPosition -= CalculateFlickAmount(flickPosition.x, flickTime);
}
- // 3-flicking move to top or bottom
- if (__flickCount >= (NEEDED_FLICK_COUNT_FOR_FINGER_FASTSCROLL - 1))
- {
- if (!_FloatCompareGE(__scrollPosition, targetPosition) && __isFlickDown)
- {
- __flickCount = 0;
-
- StartScrollToAnimation(__scrollLength + OVERSCROLLING_MAX_DISTANCE);
- return true;
- }
- else if (!_FloatCompareLE(__scrollPosition, targetPosition) && !__isFlickDown)
- {
- __flickCount = 0;
-
- StartScrollToAnimation((OVERSCROLLING_MAX_DISTANCE * -1));
- return true;
- }
- }
-
if (_FloatCompareLE(targetPosition, OVERSCROLLING_MAX_DISTANCE * -1))
{
targetPosition = (OVERSCROLLING_MAX_DISTANCE * -1);
targetPosition = GetMagneticScrollPosition(targetPosition);
}
- if (_FloatCompareLE(__scrollPosition,targetPosition) && __isFlickDown)
- {
- __flickCount++;
- }
- else if (_FloatCompareGE(__scrollPosition, targetPosition) && !__isFlickDown)
- {
- __flickCount++;
- }
- else
- {
- __isFlickDown = !__isFlickDown;
- __flickCount = 1;
- }
-
StartScrollToAnimation(targetPosition);
}
return true;
_MessageBox* pMsgbox = new (std::nothrow) _MessageBox();
SysTryReturn(NID_UI, pMsgbox != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ Dimension screenSize = _ControlManager::GetInstance()->GetScreenSize();
+
+ _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
+ SysTryReturn(NID_UI_CTRL, pFrame != null, null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
+
+ _Form* pForm = pFrame->GetCurrentForm();
+ int portIndiHeight = 0;
+ int landIndiHeight = 0;
+
+ if (pForm && pForm->IsIndicatorVisible())
+ {
+ GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, portIndiHeight);
+ GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, _CONTROL_ORIENTATION_LANDSCAPE, landIndiHeight);
+ }
+
+ Rectangle portBounds(0, 0, screenSize.width, screenSize.height - portIndiHeight);
+ Rectangle landBounds(0, 0, screenSize.width - landIndiHeight, screenSize.height);
+
+ _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+
result r = pMsgbox->CreateRootVisualElement(_WINDOW_TYPE_SUB);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ pEcoreEvas->SetWindowRotationBounds(*pMsgbox, 0, portBounds);
+ pEcoreEvas->SetWindowRotationBounds(*pMsgbox, 180, portBounds);
+ pEcoreEvas->SetWindowRotationBounds(*pMsgbox, 90, landBounds);
+ pEcoreEvas->SetWindowRotationBounds(*pMsgbox, 270, landBounds);
+
// for taking touch event
pMsgbox->AcquireHandle();
result
_MessageBox::OnAttachedToMainTree(void)
{
- result r = E_SUCCESS;
-
- SysTryReturn(NID_UI_CTRL, GetVisibleState() != false, E_INVALID_OPERATION,
- E_INVALID_OPERATION, "[E_INVALID_OPERATION] This control is not 'displayable'");
-
- _Control* pOwner = GetOwner();
- if (pOwner)
- {
- GetEcoreEvasMgr()->GetEcoreEvas()->SetOwner(*this, *pOwner);
- }
+ result r = _Popup::OnAttachedToMainTree();
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
r = __pMsgboxPresenter->OnAttachedToMainTree();
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
float totalH = titleHeight
+ transTopMargin
+ transBottomMargin
- + __pMsgboxPresenter->GetBodyTextHeight();
+ + __pMsgboxPresenter->GetBodyTextObjHeight();
switch (__msgboxStyle)
{
float transLeftMargin = 0.0f;
float transRightMargin = 0.0f;
- float totalHeightExceptTextObj = 0.0f;
- float tempHeight = 0.0f;
-
GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth);
GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, orientation, bottomHeight);
GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, orientation, maxHeight);
__pBodyTextObject->SetBounds(__textBounds);
__pBodyTextObject->Compose();
- __textObjHeight = __pBodyTextObject->GetTotalHeightF();
-
// Text bounds
- totalHeightExceptTextObj = titleHeight + (textTopMargin * 2.0f) + bottomHeight + (transTopMargin + transBottomMargin);
- tempHeight = maxHeight - (totalHeightExceptTextObj + __textObjHeight);
-
- if (tempHeight < 0.0f)
- {
- __textObjHeight += tempHeight;
- }
-
- __textBounds.height = __textObjHeight;
-
__pBodyTextObject->SetBounds(__textBounds);
// Scroll in Text
float transLeftMargin = 0.0f;
float transRightMargin = 0.0f;
- float totalHeightExceptTextObj = 0.0f;
- float tempHeight = 0.0f;
-
_ControlOrientation orientation;
__pMessageBox = &msgbox;
__pBodyTextObject->SetForegroundColor(__pMessageBox->GetTextColor(), 0, __pBodyTextObject->GetTextLength());
__pBodyTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
__pBodyTextObject->SetFont(_pFont, 0, __pBodyTextObject->GetTextLength());
- __pBodyTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT);
+ __pBodyTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT|TEXT_OBJECT_ALIGNMENT_MIDDLE);
__pBodyTextObject->SetBounds(FloatRectangle(textLeftMargin + transLeftMargin,
titleHeight + textTopMargin + transTopMargin,
defaultWidth - (textLeftMargin + textRightMargin + transLeftMargin + transRightMargin),
maxHeight - titleHeight));
__pBodyTextObject->Compose();
- __textObjHeight = __pBodyTextObject->GetTotalHeightF();
+ __textObjHeight = TEXT_OBJ_HEIGHT;
// Text bounds
- totalHeightExceptTextObj = titleHeight + (textTopMargin * 2.0f) + bottomHeight + (transTopMargin + transBottomMargin);
- tempHeight = maxHeight - (totalHeightExceptTextObj + __textObjHeight);
-
- __textObjHeight = (tempHeight > 0.0f) ? __textObjHeight : __textObjHeight + tempHeight;
-
__textBounds.SetBounds(textLeftMargin + transLeftMargin,
titleHeight + textTopMargin + transTopMargin,
defaultWidth - (textLeftMargin + textRightMargin + transLeftMargin + transRightMargin),
}
float
+_MessageBoxPresenter::GetBodyTextObjHeight(void) const
+{
+ return __textObjHeight;
+}
+float
_MessageBoxPresenter::GetBodyTextHeight(void) const
{
return (__pBodyTextObject == null) ? 0.0f : __pBodyTextObject->GetTotalHeightF();
, __pPopupPresenter(null)
, __bounds(0.0f, 0.0f, 0.0f, 0.0f)
, __popupResult(POPUP_RESULT_NONE)
+ , __portBounds(0, 0, 0, 0)
+ , __landBounds(0, 0, 0, 0)
{
- // empty statement
+ Dimension screenSize = _ControlManager::GetInstance()->GetScreenSize();
+
+ _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
+ SysTryReturnVoidResult(NID_UI_CTRL, pFrame != null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
+
+ _Form* pForm = pFrame->GetCurrentForm();
+ int portIndiHeight = 0;
+ int landIndiHeight = 0;
+ if (pForm && pForm->IsIndicatorVisible())
+ {
+ GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, portIndiHeight);
+ GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, _CONTROL_ORIENTATION_LANDSCAPE, landIndiHeight);
+ }
+ __portBounds = Rectangle(0, portIndiHeight, screenSize.width, screenSize.height - portIndiHeight);
+ __landBounds = Rectangle(0, landIndiHeight, screenSize.height, screenSize.width - landIndiHeight);
}
_Popup::~_Popup(void)
_Popup* pPopup = new (std::nothrow) _Popup();
SysTryReturn(NID_UI_CTRL, pPopup != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ Dimension screenSize = _ControlManager::GetInstance()->GetScreenSize();
+
+ _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
+ SysTryReturn(NID_UI_CTRL, pFrame != null, null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
+
+ _Form* pForm = pFrame->GetCurrentForm();
+ int portIndiHeight = 0;
+ int landIndiHeight = 0;
+
+ if (pForm && pForm->IsIndicatorVisible())
+ {
+ GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, portIndiHeight);
+ GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, _CONTROL_ORIENTATION_LANDSCAPE, landIndiHeight);
+ }
+
+ Rectangle portBounds(0, 0, screenSize.width, screenSize.height - portIndiHeight);
+ Rectangle landBounds(0, 0, screenSize.width - landIndiHeight, screenSize.height);
+
+ _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+
result r = pPopup->CreateRootVisualElement(_WINDOW_TYPE_SUB);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ pEcoreEvas->SetWindowRotationBounds(*pPopup, 0, portBounds);
+ pEcoreEvas->SetWindowRotationBounds(*pPopup, 180, portBounds);
+ pEcoreEvas->SetWindowRotationBounds(*pPopup, 90, landBounds);
+ pEcoreEvas->SetWindowRotationBounds(*pPopup, 270, landBounds);
+
// for taking touch event
pPopup->AcquireHandle();
GetEcoreEvasMgr()->GetEcoreEvas()->SetOwner(*this, *GetOwner());
+ Dimension screenSize = _ControlManager::GetInstance()->GetScreenSize();
+
+ _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
+ SysTryReturnResult(NID_UI_CTRL, pFrame != null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
+
+ _Form* pForm = pFrame->GetCurrentForm();
+
+ int portIndiHeight = 0;
+ int landIndiHeight = 0;
+ if (pForm && pForm->IsIndicatorVisible())
+ {
+ GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, portIndiHeight);
+ GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, _CONTROL_ORIENTATION_LANDSCAPE, landIndiHeight);
+ }
+
+ Rectangle portBounds(0, 0, screenSize.width, screenSize.height - portIndiHeight);
+ Rectangle landBounds(0, 0, screenSize.width - landIndiHeight, screenSize.height);
+
+ _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+
+ pEcoreEvas->SetWindowRotationBounds(*this, 0, portBounds);
+ pEcoreEvas->SetWindowRotationBounds(*this, 180, portBounds);
+ pEcoreEvas->SetWindowRotationBounds(*this, 90, landBounds);
+ pEcoreEvas->SetWindowRotationBounds(*this, 270, landBounds);
+
+ __portBounds = Rectangle(0, portIndiHeight, screenSize.width, screenSize.height - portIndiHeight);
+ __landBounds = Rectangle(0, landIndiHeight, screenSize.height, screenSize.width - landIndiHeight);
+
return E_SUCCESS;
}
return _Window::OnDetachingFromMainTree();
}
-result
-_Popup::OnBoundsChanging(const FloatRectangle& bounds)
-{
- return E_SUCCESS;
-}
-
void
_Popup::OnBoundsChanged(void)
{
return true;
}
+Rectangle
+_Popup::GetNativeBounds(bool isPortrait) const
+{
+ if (isPortrait)
+ {
+ return __portBounds;
+ }
+ else
+ {
+ return __landBounds;
+ }
+}
+
}}} // Tizen::Ui::Controls
#include "FUi_EcoreEvas.h"
#include "FUi_EcoreEvasMgr.h"
#include "FUi_ResourceManager.h"
-#include "FUi_DataBindingContext.h"
#include "FUiCtrl_ButtonImpl.h"
#include "FUiCtrl_Button.h"
#include "FUiCtrl_Form.h"
_ProgressPopup* pProgressPopup = new (std::nothrow) _ProgressPopup();
SysTryReturn(NID_UI_CTRL, pProgressPopup != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ Dimension screenSize = _ControlManager::GetInstance()->GetScreenSize();
+
+ _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
+ SysTryReturn(NID_UI_CTRL, pFrame != null, null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
+
+ _Form* pForm = pFrame->GetCurrentForm();
+ int portIndiHeight = 0;
+ int landIndiHeight = 0;
+
+ if (pForm && pForm->IsIndicatorVisible())
+ {
+ GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, portIndiHeight);
+ GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, _CONTROL_ORIENTATION_LANDSCAPE, landIndiHeight);
+ }
+
+ Rectangle portBounds(0, 0, screenSize.width, screenSize.height - portIndiHeight);
+ Rectangle landBounds(0, 0, screenSize.width - landIndiHeight, screenSize.height);
+
+ _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+
result r = pProgressPopup->CreateRootVisualElement();
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ pEcoreEvas->SetWindowRotationBounds(*pProgressPopup, 0, portBounds);
+ pEcoreEvas->SetWindowRotationBounds(*pProgressPopup, 180, portBounds);
+ pEcoreEvas->SetWindowRotationBounds(*pProgressPopup, 90, landBounds);
+ pEcoreEvas->SetWindowRotationBounds(*pProgressPopup, 270, landBounds);
+
// for taking touch event
pProgressPopup->AcquireHandle();
return pProgressPopup;
+ textTopGap
+ textBottomGap
+ bottomHeight
- + __pProgressPopupPresenter->GetBodyTextHeight();
+ + __pProgressPopupPresenter->GetBodyTextObjHeight();
return totalH;
}
result
_ProgressPopup::OnAttachedToMainTree(void)
{
- SysTryReturn(NID_UI_CTRL, GetVisibleState() != false, E_INVALID_OPERATION,
- E_INVALID_OPERATION, "[E_INVALID_OPERATION] This control is not 'displayable'");
-
- GetEcoreEvasMgr()->GetEcoreEvas()->SetOwner(*this, *GetOwner());
+ result r = _Popup::OnAttachedToMainTree();
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
return E_SUCCESS;
}
__cancelButton = cancelButton;
__transparent = transparent;
__pProgressPopup = &ProgressPopup;
+ __textObjectHeight = TEXT_OBJ_HEIGHT;
+
return r;
}
__pBodyTextObject->SetForegroundColor(__pProgressPopup->GetTextColor(), 0, __pBodyTextObject->GetTextLength());
__pBodyTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
__pBodyTextObject->SetFont(_pFont, 0, __pBodyTextObject->GetTextLength());
- __pBodyTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT);
+ __pBodyTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT|TEXT_OBJECT_ALIGNMENT_MIDDLE);
}
if (__pProgressPopup->HasButton())
__pBodyTextObject->Compose();
// Calculate Text bounds
- __textObjectHeight = __pBodyTextObject->GetTotalHeight();
-
- float totalHeightExceptTextObj = titleHeight + animationWidth + textTopMargin + textBottomMargin + bottomHeight + (transTopMargin + transBottomMargin);
- float tmpH = maxHeight - (totalHeightExceptTextObj + __textObjectHeight);
-
- __textObjectHeight = (tmpH > 0.0f) ? __textObjectHeight : __textObjectHeight + tmpH;
-
__textBounds.SetBounds(textLeftMargin + transLeftMargin,
titleHeight + textTopMargin + transTopMargin + animationWidth + noTitleHeight,
defaultWidth - (textLeftMargin + textRightMargin + transLeftMargin + transRightMargin),
}
float
+_ProgressPopupPresenter::GetBodyTextObjHeight(void) const
+{
+ return __textObjectHeight;
+}
+float
_ProgressPopupPresenter::GetBodyTextHeight(void) const
{
return (__pBodyTextObject == null) ? 0.0f : __pBodyTextObject->GetTotalHeightF();
+ textTopMargin
+ textBottomMargin
+ btnTopMargin
- + GetBodyTextHeight();
+ + GetBodyTextObjHeight();
return FloatRectangle(x, y, width, height);
}
void
_ScrollPresenter::EnableScrollingEffect(bool enable)
{
- __enableScrollingEffect = enable;
+ __enableScrollingEffect = false;
}
bool
, __initialPressesItemStatus(_BUTTON_STATUS_NORMAL)
, __pEditItem(null)
, __pTitleBackgroundBitmap(null)
- , __pBouncingEffectBitmap(null)
, __pTitleSlideTimer(null)
, __pFlickAnimationTimer(null)
, __titleRect(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f))
, __pTextFont(null)
, __pDescriptionTextObject(null)
, __pTitleTextObject(null)
- , __pBouncingEffectVe(null)
, __flickAnimation()
, __moveDistance(0.0f)
, __flickMove(0.0f)
, __fontStyle(0)
, __fontSize(0.0f)
, __tabMoved(false)
- , __isBouncingEffectStarted(false)
- , __bouncingEffectWidth(0.0f)
- , __bouncingEffectHeight(0.0f)
, __titlePressed(false)
, __titleSliding(false)
{
__pTitleBackgroundBitmap = null;
}
- if (__pBouncingEffectBitmap)
- {
- delete __pBouncingEffectBitmap;
- __pBouncingEffectBitmap = null;
- }
-
if (__pTitleSlideTimer)
{
delete __pTitleSlideTimer;
delete __pTitleTextObject;
__pTitleTextObject = null;
}
-
- if (__pBouncingEffectVe)
- {
- __pBouncingEffectVe->RemoveAllAnimations();
- __pBouncingEffectVe->Destroy();
- __pBouncingEffectVe = null;
- }
}
result
}
void
-_ToolbarPresenter::LoadBouncingEffectBitmap(ToolbarStyle style, bool isHeader, bool moveRight)
-{
- if (__pBouncingEffectBitmap != null)
- {
- delete __pBouncingEffectBitmap;
- __pBouncingEffectBitmap = null;
- }
-
- if (style == TOOLBAR_TAB)
- {
- if (isHeader)
- {
- if (moveRight)
- {
- if (__pToolbar->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
- {
- GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_BOUNCING_EFFECT_LEFT_VERTICAL,
- BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap);
- }
- else
- {
- GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_BOUNCING_EFFECT_LEFT_HORIZONTAL,
- BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap);
- }
- }
- else
- {
- if (__pToolbar->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
- {
- GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_BOUNCING_EFFECT_RIGHT_VERTICAL,
- BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap);
- }
- else
- {
- GET_BITMAP_CONFIG_N(HEADER::TAB_ITEM_BOUNCING_EFFECT_RIGHT_HORIZONTAL,
- BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap);
- }
- }
- }
- else // FOOTER_TAB
- {
- if (moveRight)
- {
- if (__pToolbar->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
- {
- GET_BITMAP_CONFIG_N(FOOTER::TAB_ITEM_BOUNCING_EFFECT_LEFT_VERTICAL,
- BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap);
- }
- else
- {
- GET_BITMAP_CONFIG_N(FOOTER::TAB_ITEM_BOUNCING_EFFECT_LEFT_HORIZONTAL,
- BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap);
- }
- }
- else
- {
- if (__pToolbar->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
- {
- GET_BITMAP_CONFIG_N(FOOTER::TAB_ITEM_BOUNCING_EFFECT_RIGHT_VERTICAL,
- BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap);
- }
- else
- {
- GET_BITMAP_CONFIG_N(FOOTER::TAB_ITEM_BOUNCING_EFFECT_RIGHT_HORIZONTAL,
- BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap);
- }
- }
- }
- }
- else if (style == TOOLBAR_TAB_WITH_TITLE)
- {
- if (moveRight)
- {
- GET_BITMAP_CONFIG_N(HEADER::TITLE_TAB_ITEM_BOUNCING_EFFECT_LEFT,
- BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap);
- }
- else
- {
- GET_BITMAP_CONFIG_N(HEADER::TITLE_TAB_ITEM_BOUNCING_EFFECT_RIGHT,
- BITMAP_PIXEL_FORMAT_ARGB8888, __pBouncingEffectBitmap);
- }
- }
-
- if (__pBouncingEffectBitmap != null)
- {
- __bouncingEffectWidth = __pBouncingEffectBitmap->GetWidthF();
- __bouncingEffectHeight = __pBouncingEffectBitmap->GetHeightF();
- }
-
- return;
-}
-
-void
_ToolbarPresenter::DrawItems(void)
{
result r = E_SUCCESS;
__touchInitiatedInToolbar = false;
- if (__pBouncingEffectVe)
- {
- __pBouncingEffectVe->RemoveAllAnimations();
- __pToolbar->GetVisualElement()->DetachChild(*__pBouncingEffectVe);
- __pBouncingEffectVe->Destroy();
- __pBouncingEffectVe = null;
- }
-
int releasedItemIndex = __pToolbar->GetItemIndexFromPosition(touchPoint);
float tabLeftMargin = 0.0f;
__tabMoved = false;
- __isBouncingEffectStarted = false;
-
// Restore status of other buttons to _BUTTON_STATUS_NORMAL // this can be removed
int itemCount = __pToolbar->GetItemCount();
{
float distance = (touchinfo.GetCurrentPosition()).x - __currentTouchPosition.x;
float sideMargin = 0.0f;
- float startX = 0.0f;
- float startY = 0.0f;
GET_SHAPE_CONFIG(HEADER::TAB_LEFT_MARGIN, __pToolbar->GetOrientation(), sideMargin);
if (itemBounds.x + distance >= sideMargin && !__beingEdited)
{
distance = sideMargin - itemBounds.x;
-
- if (!__isBouncingEffectStarted)
- {
- LoadBouncingEffectBitmap(style, __pToolbar->IsHeader(), true);
-
- if (style == TOOLBAR_TAB_WITH_TITLE)
- {
- GET_SHAPE_CONFIG(HEADER::TITLE_HEIGHT_WITH_SEGMENTED_ITEM, __pToolbar->GetOrientation(), startY);
- }
-
- SetBouncingVisualElement(startX, startY);
-
- StartBouncingEffect();
-
- __isBouncingEffectStarted = true;
- }
- }
- else
- {
- if (__pBouncingEffectVe)
- {
- __pBouncingEffectVe->RemoveAllAnimations();
- __pToolbar->GetVisualElement()->DetachChild(*__pBouncingEffectVe);
- __pBouncingEffectVe->Destroy();
- __pBouncingEffectVe = null;
- }
-
- __isBouncingEffectStarted = false;
}
}
else if (distance < 0)
if (itemBounds.x + itemBounds.width + distance <= clientBounds.width - sideMargin && !__beingEdited)
{
distance = (clientBounds.width - sideMargin) - (itemBounds.x + itemBounds.width);
-
- if (!__isBouncingEffectStarted)
- {
- LoadBouncingEffectBitmap(style, __pToolbar->IsHeader(), false);
-
- startX = clientBounds.width - __bouncingEffectWidth;
-
- if (style == TOOLBAR_TAB_WITH_TITLE)
- {
- GET_SHAPE_CONFIG(HEADER::TITLE_HEIGHT_WITH_SEGMENTED_ITEM, __pToolbar->GetOrientation(), startY);
- }
-
- SetBouncingVisualElement(startX, startY);
-
- StartBouncingEffect();
-
- __isBouncingEffectStarted = true;
- }
- }
- else
- {
- if (__pBouncingEffectVe)
- {
- __pBouncingEffectVe->RemoveAllAnimations();
- __pToolbar->GetVisualElement()->DetachChild(*__pBouncingEffectVe);
- __pBouncingEffectVe->Destroy();
- __pBouncingEffectVe = null;
- }
-
- __isBouncingEffectStarted = false;
}
}
-
if (__beingEdited)
{
float tabLeftMargin = 0.0f;
}
void
-_ToolbarPresenter::SetBouncingVisualElement(float startX, float startY)
-{
- Canvas * pCanvas = null;
- int Z_ORDER_GROUP_CONTROL = 2001;
-
- if (__pBouncingEffectVe == null)
- {
- __pBouncingEffectVe = new (std::nothrow) VisualElement();
- SysTryReturnVoidResult(NID_UI_CTRL, __pBouncingEffectVe, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
-
- __pBouncingEffectVe->Construct();
- __pBouncingEffectVe->SetName(L"BouncingEffect");
- }
-
- __pBouncingEffectVe->SetBounds(FloatRectangle(startX, startY, __bouncingEffectWidth, __bouncingEffectHeight));
- __pBouncingEffectVe->SetShowState(true);
- __pBouncingEffectVe->SetImplicitAnimationEnabled(true);
-
- _VisualElementImpl::GetInstance(*__pBouncingEffectVe)->SetZOrderGroup(Z_ORDER_GROUP_CONTROL + 1);
- __pToolbar->GetVisualElement()->AttachChild(*__pBouncingEffectVe);
-
- pCanvas = __pBouncingEffectVe->GetCanvasN();
-
- if (!pCanvas)
- {
- __pBouncingEffectVe->Destroy();
- __pBouncingEffectVe = null;
-
- SysLog(NID_UI_CTRL, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- return;
- }
-
- Color backgroundColor(0, 0, 0, 0);
- pCanvas->SetBackgroundColor(backgroundColor);
- pCanvas->Clear();
-
- FloatRectangle rect(0.0f, 0.0f, __bouncingEffectWidth, __bouncingEffectHeight);
-
- if (__pBouncingEffectBitmap)
- {
- if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pBouncingEffectBitmap))
- {
- pCanvas->DrawNinePatchedBitmap(rect, *__pBouncingEffectBitmap);
-
- }
- else
- {
- pCanvas->DrawBitmap(rect, *__pBouncingEffectBitmap);
- }
- }
-
- delete pCanvas;
-
- return;
-}
-
-void
-_ToolbarPresenter::StartBouncingEffect(void)
-{
- float startOpacity = 0.0f;
- float endOpacity = 1.0f;
-
- VisualElementPropertyAnimation* pAnimation = new (std::nothrow) VisualElementPropertyAnimation();
- SysTryReturnVoidResult(NID_UI_CTRL, pAnimation, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
-
- pAnimation->SetPropertyName(L"BouncingEffect");
- pAnimation->SetStartValue(Variant(startOpacity));
- pAnimation->SetEndValue(Variant(endOpacity));
- pAnimation->SetDuration(500);
- pAnimation->SetVisualElementAnimationStatusEventListener(this);
-
- String bouncing(L"BouncingEffect");
- __pBouncingEffectVe->AddAnimation(bouncing, *pAnimation);
-
- delete pAnimation;
-
- return;
-}
-
-void
_ToolbarPresenter::StartFlickAnimation(void)
{
float distance = CalculateProgress(__flickMove);
//Accessor
public:
float GetBodyTextHeight(void) const;
+ float GetBodyTextObjHeight(void) const;
Tizen::Graphics::FloatRectangle GetTitleBounds(void) const;
Tizen::Graphics::FloatRectangle GetTextBounds(void) const;
int __buttonNum;
float __prevPositionY;
float __textObjHeight;
+ static const float TEXT_OBJ_HEIGHT = 210.0f;
bool __touchPressFlag;
bool __scrollStart;
virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
- virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds);
virtual void OnBoundsChanged(void);
virtual bool IsLayoutChangable(void) const;
virtual void OnOwnerChanged(_Control* pOldOwner);
virtual void UpdateClientBounds(const Tizen::Graphics::FloatDimension& size, Tizen::Graphics::FloatRectangle& clientBounds);
virtual bool IsRotationSynchronized(void) const;
+ Tizen::Graphics::Rectangle GetNativeBounds(bool isPortrait) const;
+
// Accessor
public:
void SetColor(const Tizen::Graphics::Color& color);
PopupModalResult __popupResult;
+ Tizen::Graphics::Rectangle __portBounds;
+ Tizen::Graphics::Rectangle __landBounds;
}; // _Popup
virtual result DoModal(int& modalResult);
float GetBodyTextHeight(void) const;
+ float GetBodyTextObjHeight(void) const;
Tizen::Graphics::FloatRectangle GetButtonBounds(void) const;
Tizen::Graphics::FloatRectangle GetTitleBounds(void) const;
bool __transparent;
static const int ANIMATION_REPEAT_COUNT = 100;
+ static const float TEXT_OBJ_HEIGHT = 160.0f;
}; // _ProgressPopupPresenter
result _SetModel(const _ToolbarModel& toolbarModel);
private:
- void LoadBouncingEffectBitmap(ToolbarStyle style, bool isHeader, bool moveRight);
void SetBouncingVisualElement(float startX, float startY);
- void StartBouncingEffect(void);
void StartFlickAnimation(void);
result StartFlickAnimationTimer(void);
Tizen::Graphics::Bitmap* __pTitleBackgroundBitmap;
- Tizen::Graphics::Bitmap* __pBouncingEffectBitmap;
-
Tizen::Base::Runtime::Timer* __pTitleSlideTimer;
Tizen::Base::Runtime::Timer* __pFlickAnimationTimer;
Tizen::Graphics::_Text::TextObject* __pTitleTextObject;
- Tizen::Ui::Animations::VisualElement* __pBouncingEffectVe;
-
_FlickAnimation __flickAnimation;
static const int FLICK_ANIMATION_TIMER_PERIOD = 3;
float __fontSize;
bool __tabMoved;
- bool __isBouncingEffectStarted;
- float __bouncingEffectWidth;
- float __bouncingEffectHeight;
-
bool __titlePressed;
bool __titleSliding;