, __editItemIndex(-1)
//, __pVerticalLineBitmap(null)
, __pHorizontalLineBitmap(null)
- , __pFrontScrollingEffectBitmap(null)
- , __pRearScrollingEffectBitmap(null)
- , __pScrollingEffectBitmap(null)
+// , __pFrontScrollingEffectBitmap(null)
+// , __pRearScrollingEffectBitmap(null)
+// , __pScrollingEffectBitmap(null)
, __pFocusBitmap(null)
- , __pScrollingEffectVe(null)
+// , __pScrollingEffectVe(null)
, __pFlickAnimationTimer(null)
, __pScrollAnimationTimer(null)
, __flickAnimation()
, __reorderDist(0.0f)
, __firstItemIndex(0)
, __lastItemIndex(0)
- , __isScrollEffectEnded(false)
- , __isScrollEffectStarted(false)
+// , __isScrollEffectEnded(false)
+// , __isScrollEffectStarted(false)
, __timerCount(0)
, __isTouchMove(false)
- , __scrollFlag(0)
+// , __scrollFlag(0)
, __tabMinimumSize(0.0f)
, __fontChangeItemCount(0)
__pScrollAnimationTimer = null;
}
- if (__pFrontScrollingEffectBitmap)
- {
- delete __pFrontScrollingEffectBitmap;
- __pFrontScrollingEffectBitmap = null;
- }
-
- if (__pRearScrollingEffectBitmap)
- {
- delete __pRearScrollingEffectBitmap;
- __pRearScrollingEffectBitmap = null;
- }
+// if (__pFrontScrollingEffectBitmap)
+// {
+// delete __pFrontScrollingEffectBitmap;
+// __pFrontScrollingEffectBitmap = null;
+// }
- if (__pScrollingEffectBitmap)
- {
- __pScrollingEffectBitmap = null;
- }
+// if (__pRearScrollingEffectBitmap)
+// {
+// delete __pRearScrollingEffectBitmap;
+// __pRearScrollingEffectBitmap = null;
+// }
+//
+// if (__pScrollingEffectBitmap)
+// {
+// __pScrollingEffectBitmap = null;
+// }
if(__pFocusBitmap)
{
__pFocusBitmap = null;
}
- if (__pScrollingEffectVe)
- {
- __pScrollingEffectVe->RemoveAllAnimations();
- __pScrollingEffectVe->Destroy();
- __pScrollingEffectVe = null;
- }
+// if (__pScrollingEffectVe)
+// {
+// __pScrollingEffectVe->RemoveAllAnimations();
+// __pScrollingEffectVe->Destroy();
+// __pScrollingEffectVe = null;
+// }
}
result
Tizen::Graphics::Bitmap* pBitmap = null;
Tizen::Graphics::Bitmap* pFocusBitmap = null;
Color focusBgColor(0x00000000);
-
- //r = GET_BITMAP_CONFIG_N(TAB::VERTICAL_DIVIDER_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pVerticalLineBitmap); // delete bitmap by critical.kim (2013/03/18)
- //SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate divider line bitmap.");
+ Color itemSelectedColor(0x00000000);
r = GET_BITMAP_CONFIG_N(TAB::ITEM_SELECTED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate horizontal line bitmap.");
+ GET_COLOR_CONFIG(TAB::ITEM_SELECTED, itemSelectedColor);
+
if (pBitmap)
{
- __pHorizontalLineBitmap = _BitmapImpl::GetColorReplacedBitmapN(*(pBitmap), Color::GetColor(COLOR_ID_MAGENTA), __pTab->GetSelectedTextColor());
+ __pHorizontalLineBitmap = _BitmapImpl::GetColorReplacedBitmapN(*(pBitmap), Color::GetColor(COLOR_ID_MAGENTA), itemSelectedColor);
SysTryLog(NID_UI_CTRL, (__pHorizontalLineBitmap != null), "Failed to locate focus item line bitmap.");
}
- r = GET_BITMAP_CONFIG_N(TAB::TAB_BOUNCE_EFFECT_LEFT, BITMAP_PIXEL_FORMAT_ARGB8888, __pFrontScrollingEffectBitmap);
- SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate overscrolling left bitmap.");
+// r = GET_BITMAP_CONFIG_N(TAB::TAB_BOUNCE_EFFECT_LEFT, BITMAP_PIXEL_FORMAT_ARGB8888, __pFrontScrollingEffectBitmap);
+// SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate overscrolling left bitmap.");
- r = GET_BITMAP_CONFIG_N(TAB::TAB_BOUNCE_EFFECT_RIGHT, BITMAP_PIXEL_FORMAT_ARGB8888, __pRearScrollingEffectBitmap);
- SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate overscrolling right bitmap.");
+// r = GET_BITMAP_CONFIG_N(TAB::TAB_BOUNCE_EFFECT_RIGHT, BITMAP_PIXEL_FORMAT_ARGB8888, __pRearScrollingEffectBitmap);
+// SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate overscrolling right bitmap.");
r = GET_BITMAP_CONFIG_N(TAB::ITEM_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pFocusBitmap);
SysTryLog(NID_UI_CTRL, r == E_SUCCESS, "Failed to locate focus bitmap.");
return true;
}
- __scrollFlag = 0;
+// __scrollFlag = 0;
Rectangle itemBounds(0, 0, 0, 0);
_TabItem* pItem = null;
ResetScrollAnimationTimer();
int index = GetItemIndexFromPosition(touchinfo.GetCurrentPosition());
- if (__pScrollingEffectVe)
- {
- __pScrollingEffectVe->RemoveAllAnimations();
- __pTab->GetVisualElement()->DetachChild(*__pScrollingEffectVe);
- __pScrollingEffectVe->Destroy();
- __pScrollingEffectVe = null;
- __isScrollEffectEnded = false;
- __isScrollEffectStarted = false;
- }
+// if (__pScrollingEffectVe)
+// {
+// __pScrollingEffectVe->RemoveAllAnimations();
+// __pTab->GetVisualElement()->DetachChild(*__pScrollingEffectVe);
+// __pScrollingEffectVe->Destroy();
+// __pScrollingEffectVe = null;
+// __isScrollEffectEnded = false;
+// __isScrollEffectStarted = false;
+// }
int pressedIndex = GetPressedItemIndex();
__isRightScrollable = false;
distance = movedPosition.x - __currentTouchPosition.x;
__currentTouchPosition.x = movedPosition.x;
- if (!__isEditMode && distance > 0.0f) //Move right i.e Bounce at leftEnd
- {
- __isTouchMove = true;
- if (!__isDirectionRight)
- {
- if (__pScrollingEffectVe)
- {
- __pScrollingEffectVe->RemoveAllAnimations();
- __pTab->GetVisualElement()->DetachChild(*__pScrollingEffectVe);
- __pScrollingEffectVe->Destroy();
- __pScrollingEffectVe = null;
- }
-
- __isScrollEffectEnded = false;
- __isScrollEffectStarted = false;
- }
-
- __isDirectionRight = true;
- SetFirstLoadedItemIndex();
- if ( GetItemAt(0)->GetItemBounds().x >= 0.0f)
- {
- if (!__isScrollEffectStarted)
- {
- __pScrollingEffectBitmap = __pFrontScrollingEffectBitmap;
- SetOpacityVisualElement(0.0f);
- StartScrollingEffect();
- }
-
- __isScrollEffectStarted = true;
- }
-
- __moveDistance = distance;
- DrawHorizontal();
- Draw();
- __moveDistance = 0.0f;
-
- return true;
- }
-
- if (!__isEditMode && distance < 0.0f)//Move left i.e Bounce at RightEnd
- {
- __isTouchMove = true;
- if (__isDirectionRight)
- {
- if (__pScrollingEffectVe)
- {
- __pScrollingEffectVe->RemoveAllAnimations();
- __pTab->GetVisualElement()->DetachChild(*__pScrollingEffectVe);
- __pScrollingEffectVe->Destroy();
- __pScrollingEffectVe = null;
- }
-
- __isScrollEffectEnded = false;
- __isScrollEffectStarted = false;
- }
-
- __isDirectionRight = false;
- SetLastLoadedItemIndex();
-
- if ( __lastLoadedItemIndex == (GetItemCount() - 1) && ((GetItemAt(__lastLoadedItemIndex)->GetItemBounds().x + __itemWidth) <= (__width)))
- {
- if (!__isScrollEffectStarted)
- {
- int index = (GetItemCount() - 1);
- float xPosition = (GetItemAt(index)->GetItemBounds().x + (__itemWidth / 2.0f));
- __pScrollingEffectBitmap = __pRearScrollingEffectBitmap;
- SetOpacityVisualElement(xPosition);
- StartScrollingEffect();
- }
-
- __isScrollEffectStarted = true;
- }
-
- __moveDistance = distance;
- DrawHorizontal();
- Draw();
- __moveDistance = 0.0f;
-
- return true;
- }
+// if (!__isEditMode && distance > 0.0f) //Move right i.e Bounce at leftEnd
+// {
+// __isTouchMove = true;
+// if (!__isDirectionRight)
+// {
+// if (__pScrollingEffectVe)
+// {
+// __pScrollingEffectVe->RemoveAllAnimations();
+// __pTab->GetVisualElement()->DetachChild(*__pScrollingEffectVe);
+// __pScrollingEffectVe->Destroy();
+// __pScrollingEffectVe = null;
+// }
+//
+// __isScrollEffectEnded = false;
+// __isScrollEffectStarted = false;
+// }
+//
+// __isDirectionRight = true;
+// SetFirstLoadedItemIndex();
+// if ( GetItemAt(0)->GetItemBounds().x >= 0.0f)
+// {
+// if (!__isScrollEffectStarted)
+// {
+// __pScrollingEffectBitmap = __pFrontScrollingEffectBitmap;
+// SetOpacityVisualElement(0.0f);
+// StartScrollingEffect();
+// }
+//
+// __isScrollEffectStarted = true;
+// }
+//
+// __moveDistance = distance;
+// DrawHorizontal();
+// Draw();
+// __moveDistance = 0.0f;
+//
+// return true;
+// }
+//
+// if (!__isEditMode && distance < 0.0f)//Move left i.e Bounce at RightEnd
+// {
+// __isTouchMove = true;
+// if (__isDirectionRight)
+// {
+// if (__pScrollingEffectVe)
+// {
+// __pScrollingEffectVe->RemoveAllAnimations();
+// __pTab->GetVisualElement()->DetachChild(*__pScrollingEffectVe);
+// __pScrollingEffectVe->Destroy();
+// __pScrollingEffectVe = null;
+// }
+//
+// __isScrollEffectEnded = false;
+// __isScrollEffectStarted = false;
+// }
+//
+// __isDirectionRight = false;
+// SetLastLoadedItemIndex();
+//
+// if ( __lastLoadedItemIndex == (GetItemCount() - 1) && ((GetItemAt(__lastLoadedItemIndex)->GetItemBounds().x + __itemWidth) <= (__width)))
+// {
+// if (!__isScrollEffectStarted)
+// {
+// int index = (GetItemCount() - 1);
+// float xPosition = (GetItemAt(index)->GetItemBounds().x + (__itemWidth / 2.0f));
+// __pScrollingEffectBitmap = __pRearScrollingEffectBitmap;
+// SetOpacityVisualElement(xPosition);
+// StartScrollingEffect();
+// }
+//
+// __isScrollEffectStarted = true;
+// }
+//
+// __moveDistance = distance;
+// DrawHorizontal();
+// Draw();
+// __moveDistance = 0.0f;
+//
+// return true;
+// }
if (!__isEditMode)
{
return;
}
-void
-_TabPresenter::SetOpacityVisualElement(float xPosition)
-{
- Canvas * pCanvas = null;
- float bounceWidth = (__itemWidth / 2.0f);
-
- if (__pScrollingEffectVe == null)
- {
- __pScrollingEffectVe = new (std::nothrow) _VisualElement();
- SysTryReturnVoidResult(NID_UI_CTRL, __pScrollingEffectVe, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
-
- __pScrollingEffectVe->Construct();
- __pScrollingEffectVe->SetName(L"Opacity");
- }
-
- __pScrollingEffectVe->SetBounds(FloatRectangle(xPosition, 0.0f, bounceWidth, __itemHeight));
- __pScrollingEffectVe->SetShowState(true);
- __pScrollingEffectVe->SetImplicitAnimationEnabled(true);
- __pTab->GetVisualElement()->AttachChild(*__pScrollingEffectVe);
- pCanvas = __pScrollingEffectVe->GetCanvasN();
-
- if (!pCanvas)
- {
- __pScrollingEffectVe->Destroy();
- __pScrollingEffectVe = 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, bounceWidth, __itemHeight);
-
- DrawResourceBitmap(*pCanvas, rect, __pScrollingEffectBitmap);
-
- delete pCanvas;
- return;
-}
-
-void
-_TabPresenter::StartScrollingEffect(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"opacity");
- pAnimation->SetStartValue(Variant(__startOpacity));
- pAnimation->SetEndValue(Variant(__endOpacity));
- pAnimation->SetDuration(OVERSCROLL_ANIMATION_DURATION);
- pAnimation->SetVisualElementAnimationStatusEventListener(this);
-
- String animationName3(L"opacity");
- __pScrollingEffectVe->AddAnimation(animationName3, *pAnimation);
-
- delete pAnimation;
- __isScrollEffectStarted = true;
- return;
-
-}
+//void
+//_TabPresenter::SetOpacityVisualElement(float xPosition)
+//{
+// Canvas * pCanvas = null;
+// float bounceWidth = (__itemWidth / 2.0f);
+//
+// if (__pScrollingEffectVe == null)
+// {
+// __pScrollingEffectVe = new (std::nothrow) _VisualElement();
+// SysTryReturnVoidResult(NID_UI_CTRL, __pScrollingEffectVe, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+//
+// __pScrollingEffectVe->Construct();
+// __pScrollingEffectVe->SetName(L"Opacity");
+// }
+//
+// __pScrollingEffectVe->SetBounds(FloatRectangle(xPosition, 0.0f, bounceWidth, __itemHeight));
+// __pScrollingEffectVe->SetShowState(true);
+// __pScrollingEffectVe->SetImplicitAnimationEnabled(true);
+// __pTab->GetVisualElement()->AttachChild(*__pScrollingEffectVe);
+// pCanvas = __pScrollingEffectVe->GetCanvasN();
+//
+// if (!pCanvas)
+// {
+// __pScrollingEffectVe->Destroy();
+// __pScrollingEffectVe = 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, bounceWidth, __itemHeight);
+//
+// DrawResourceBitmap(*pCanvas, rect, __pScrollingEffectBitmap);
+//
+// delete pCanvas;
+// return;
+//}
+
+//void
+//_TabPresenter::StartScrollingEffect(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"opacity");
+// pAnimation->SetStartValue(Variant(__startOpacity));
+// pAnimation->SetEndValue(Variant(__endOpacity));
+// pAnimation->SetDuration(OVERSCROLL_ANIMATION_DURATION);
+// pAnimation->SetVisualElementAnimationStatusEventListener(this);
+//
+// String animationName3(L"opacity");
+// __pScrollingEffectVe->AddAnimation(animationName3, *pAnimation);
+//
+// delete pAnimation;
+// __isScrollEffectStarted = true;
+// return;
+//
+//}
void
_TabPresenter::OnChangeLayout(_ControlOrientation orientation)
__isRightScrollable = false;
__isLeftScrollable = false;
- if (__pScrollingEffectVe)
- {
- __pScrollingEffectVe->RemoveAllAnimations();
- __pTab->GetVisualElement()->DetachChild(*__pScrollingEffectVe);
- __pScrollingEffectVe->Destroy();
- __pScrollingEffectVe = null;
- __isScrollEffectEnded = false;
- __isScrollEffectStarted = false;
- }
+// if (__pScrollingEffectVe)
+// {
+// __pScrollingEffectVe->RemoveAllAnimations();
+// __pTab->GetVisualElement()->DetachChild(*__pScrollingEffectVe);
+// __pScrollingEffectVe->Destroy();
+// __pScrollingEffectVe = null;
+// __isScrollEffectEnded = false;
+// __isScrollEffectStarted = false;
+// }
ResetScrollAnimationTimer();
ResetReorderTimer();