const BufferInfo& dstBufferInfo = dstLock.GetBufferInfo();
{
- if (!this->__useStableRenderer && srcBufferInfo.bitsPerPixel == 32 && GetCompositeMode() != COMPOSITE_MODE_SRC_OVER)
+ if (!this->__useStableRenderer && srcBufferInfo.bitsPerPixel == 32 && (GetCompositeMode() != COMPOSITE_MODE_SRC_OVER || bitmap.__isPremultiplied))
{
_Util::Pixmap srcImage(srcBufferInfo.width, srcBufferInfo.height, srcBufferInfo.bitsPerPixel, srcBufferInfo.pPixels, srcBufferInfo.pitch);
_ApplySrcBitmapAttrib(srcImage, bitmap, bitmap.__isOpaqueAllOver);
_Util::Pixmap dstImageUnclipped(dstBufferInfo.width, dstBufferInfo.height, dstBufferInfo.bitsPerPixel, dstBufferInfo.pPixels, dstBufferInfo.pitch);
_Util::Pixmap dstImage = dstImageUnclipped.GetSubBitmap(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
- if (srcBufferInfo.pixelFormat == PIXEL_FORMAT_RGB565 && srcImage.enableColorKey == 0 && dstBufferInfo.pixelFormat == PIXEL_FORMAT_ARGB8888 && !this->__isClipBoundsSet)
+ if (srcBufferInfo.pixelFormat == PIXEL_FORMAT_RGB565 && srcImage.enableColorKey == 0 && dstBufferInfo.pixelFormat == PIXEL_FORMAT_ARGB8888 && !this->__isClipBoundsSet && alphaConstant >= 255)
{
pixman_image_t* pPixmanSrc = pixman_image_create_bits(PIXMAN_r5g6b5, srcBufferInfo.width, srcBufferInfo.height, (uint32_t*)srcBufferInfo.pPixels, srcBufferInfo.pitch);
pixman_image_t* pPixmanDst = pixman_image_create_bits(PIXMAN_a8r8g8b8, dstBufferInfo.width, dstBufferInfo.height, (uint32_t*)dstBufferInfo.pPixels, dstBufferInfo.pitch);
}
}
{
- bool isPixmanSupported = (!this->__useStableRenderer && GetCompositeMode() != COMPOSITE_MODE_SRC_OVER);
+ bool isPixmanSupported = (!this->__useStableRenderer && (GetCompositeMode() != COMPOSITE_MODE_SRC_OVER || bitmap.__isPremultiplied));
if (isPixmanSupported)
{
const BufferInfo& dstBufferInfo = dstLock.GetBufferInfo();
{
- if (!this->__useStableRenderer && srcBufferInfo.bitsPerPixel == 32 && GetCompositeMode() != COMPOSITE_MODE_SRC_OVER)
+ if (!this->__useStableRenderer && srcBufferInfo.bitsPerPixel == 32 && (GetCompositeMode() != COMPOSITE_MODE_SRC_OVER || srcBitmap.__isPremultiplied))
{
_Util::Rectangle<int> srcBounds =
{
const BufferInfo& dstBufferInfo = dstLock.GetBufferInfo();
{
- if (srcBufferInfo.bitsPerPixel == 32 && GetCompositeMode() != COMPOSITE_MODE_SRC_OVER)
+ if (srcBufferInfo.bitsPerPixel == 32 && (GetCompositeMode() != COMPOSITE_MODE_SRC_OVER || srcBitmap.__isPremultiplied))
{
_Util::Rectangle<int> outRect = { 0, 0, -1, -1 };
_Util::Rectangle<int> dstRect = { destRect.x, destRect.y, destRect.width, destRect.height };
wchar_t leftChar = 0;
_IFont::Glyph* pFontGlyphData = 0;
+ _IFont::SizeProperty sizeProperty;
+ rtn = this->GetFontSizeProperty(sizeProperty);
+ SysTryReturn(NID_GRP, rtn, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to get font sizeProperty.");
+
// need to revise y value, because _IFont is based on the baseline
{
- _IFont::SizeProperty sizeProperty;
- bool rtn = this->GetFontSizeProperty(sizeProperty);
- SysTryReturn(NID_GRP, rtn, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to get font sizeProperty.");
-
if (canvas.__textOrigin == TEXT_ORIGIN_LEFT_TOP)
{
yDest += sizeProperty.maxHeight.ToInt() + sizeProperty.descender.ToInt();
yDest += pGlyph->yAdvance.ToInt();
}
- scratchPad.RegisterFillRect(null);
-
IEnumeratorT<_IFont::Glyph*>* pEnum = glyphList.GetEnumeratorN();
if (pEnum)
pFont->UnloadGlyph(&pFontGlyphData);
}
+ }
- if (this->IsUnderlined() || this->IsStrikeOut())
- {
- int y = point.y + charHeight - 1;
- int thick = this->GetLineThickness();
+ if (this->IsUnderlined() || this->IsStrikeOut())
+ {
+ int y = 0;
+ int thick = this->GetLineThickness();
- xDest -= this->GetCharSpace();
+ if (canvas.__textOrigin == TEXT_ORIGIN_LEFT_TOP)
+ {
+ y = point.y + charHeight - 1;
+ }
+ else
+ {
+ y = point.y - sizeProperty.descender.ToInt() - 1;
+ }
- if (this->IsUnderlined())
- {
- canvas.FillRectangle(canvasFgColor, Rectangle(startX, y - thick, xDest - startX, thick));
- }
+ xDest -= this->GetCharSpace();
- if (this->IsStrikeOut())
- {
- y -= charHeight / 2;
- canvas.FillRectangle(canvasFgColor, Rectangle(startX, y - thick, xDest - startX, thick));
- }
+ if (this->IsUnderlined())
+ {
+ canvas.FillRectangle(canvasFgColor, Rectangle(startX, y - thick, xDest - startX, thick));
}
- scratchPad.RegisterFillRect(null);
+ if (this->IsStrikeOut())
+ {
+ y -= charHeight / 2;
+ canvas.FillRectangle(canvasFgColor, Rectangle(startX, y - thick, xDest - startX, thick));
+ }
}
+ scratchPad.RegisterFillRect(null);
+
+
return E_SUCCESS;
}
{
__fontAttrib.style = style;
__fontAttrib.size = pcSize;
- __fontAttrib.lineThickness = ((pcSize < 24) ? 1 : ((pcSize < 48) ? 2 : 3));
+ __fontAttrib.lineThickness = pcSize.ToInt() > 0 ? (pcSize.ToInt() / 24) + 1 : 1;
_IFont::SizeProperty sizeProperty;
bool getProperty = false;
virtual result SetTextOffset(int offset);
+ virtual const Font* GetFont(void) const;
+
bool GetEditable(void) const;
void SetEditModeEnable(bool enable);
result SetFont(const Font* pFont);
- const Font* GetFont(void) const;
+ virtual const Font* GetFont(void) const;
virtual void SetForegroundColor(const Color& color);
TextElement* pLastTextElement = (textLength == 0) ? GetElementAtTextIndex(startTextIndex) : GetElementAtTextIndex(startTextIndex + textLength - 1);
SysTryCatch(NID_GRP, pLastTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element.");
- if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT)
+ if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT || pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_CUTLINK)
{
TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pLastTextElement);
SysTryCatch(NID_GRP, pSimpleText, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element.");
pLastDisplayTextElement = (textLength == 0) ? GetElementAtTextIndex(startTextIndex) : GetElementAtTextIndex(startTextIndex + textLength - 1);
SysTryCatch(NID_GRP, pLastDisplayTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element.");
- if (pLastDisplayTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT)
+ if (pLastDisplayTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT || pLastDisplayTextElement->GetType() == TEXT_ELEMENT_TYPE_CUTLINK)
{
TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pLastDisplayTextElement);
SysTryCatch(NID_GRP, pSimpleText, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element.");
TextElement* pLastTextElement = GetElementAtTextIndex(startTextIndex + textLength - 1);
SysTryCatch(NID_GRP, pLastTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element.");
- if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT)
+ if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT || pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_CUTLINK)
{
TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pLastTextElement);
SysTryCatch(NID_GRP, pSimpleText, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element.");
{
GetRegion(textIndexFromElementOffset, 1, spaceCharDim.width, spaceCharDim.height);
textLength--;
+ currentLength--;\r
startTextIndex++;
textIndexFromElementOffset++;
}
GetRegion(startTextIndex, textLength, textSize.width, textSize.height);
if (action == TEXT_OBJECT_ACTION_TYPE_ABBREV)
{
- TextElement* pLastTextElement = GetElementAtTextIndex(startTextIndex + textLength - 1);
+ TextElement* pLastTextElement = (textLength == 0) ? GetElementAtTextIndex(startTextIndex) : GetElementAtTextIndex(startTextIndex + textLength - 1);
SysTryCatch(NID_GRP, pLastTextElement, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get element.");
- if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT)
+ if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT || pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_CUTLINK)
{
TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pLastTextElement);
SysTryCatch(NID_GRP, pSimpleText, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to cast text element.");
, TEXT_OBJECT_WRAP_TYPE_CHARACTER, textLength, textSize.width, textSize.height);
textSize.width += abbrevTextDim.width;
- currentLength = textLength;
+ currentLength = Math::Min(currentLength, textLength);
drawAbbrevText = true;
}
SysTryCatch(NID_GRP, r == E_SUCCESS, , r, "[%s] Fail to move next element.", GetErrorMessage(r));
}
+ currentLength = Math::Min(textLength, currentLength);
blockRect = FloatRectangle(adjustedRect.x, displayRect.y, adjustedRect.width, adjustedRect.height);
adjustedRect.y = displayRect.y + displayRect.height - baseline;
canvasImpl.SetTextOrigin(TEXT_ORIGIN_BASELINE);
TextElement* pLastTextElement = GetElementAtTextIndex(lineOffset + lineLength - 1);
SysTryReturn(NID_GRP, pLastTextElement, -1, E_SYSTEM, "[E_SYSTEM] Fail to get element.");
- if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT)
+ if (pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_TEXT || pLastTextElement->GetType() == TEXT_ELEMENT_TYPE_CUTLINK)
{
TextSimple* pSimpleText = dynamic_cast < TextSimple* >(pLastTextElement);
SysTryReturn(NID_GRP, pSimpleText, String(L""), E_SYSTEM, "[E_SYSTEM] Fail to cast text element.");
return TextSimple::ChangeTextOffset(pText, gap);
}
+const Font*
+TextCutLink::GetFont(void) const
+{
+ if (__isEdited)
+ {
+ return TextSimple::GetCurrentFont();
+ }
+
+ return __pLinkFont;
+}
+
Font*
TextCutLink::GetCurrentFont(void) const
{
return false;
}
- if (!control.IsInputEventEnabled())
+ if (GetTouchInfo()->GetTouchStatus() != _TOUCH_CANCELED)
{
- return false;
+ if (!control.IsInputEventEnabled())
+ {
+ return false;
+ }
}
return true;
int velY = 0;
__flickAnimation.CalculateInitializeVelocity(distanceX, 0, duration, &velX, &velY);
- __flickAnimation.InitializeFlickAmount(velX);
+ __flickAnimation.InitializeFlickAmount(velX * FLICK_ANIMATION_VELOCITY_FACTOR_DATE_TIME_BAR);
StartFlickAnimationTimer();
return true;
//
#include <FBaseString.h>
#include <FGrpColor.h>
+#include <FSys_SettingInfoImpl.h>
#include "FUi_AccessibilityContainer.h"
#include "FUi_AccessibilityElement.h"
#include "FUi_AccessibilityManager.h"
using namespace Tizen::Base;
using namespace Tizen::Graphics;
+using namespace Tizen::System;
using namespace Tizen::Ui::Effects;
namespace Tizen { namespace Ui { namespace Controls {
SysAssert(false);
}
+ r = _SettingInfoImpl::RemoveSettingEventListenerForInternal(*this);
+ if (r != E_SUCCESS)
+ {
+ SetLastResult(r);
+ SysAssert(false);
+ }
+
RemoveGalleryAccessibilityElements();
delete __pRenderer;
r = __pinchGesture.AddGestureListener(*this);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = _SettingInfoImpl::AddSettingEventListenerForInternal(*this);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
SetRenderer((_GalleryRenderer &)*pRenderer);
SetPresenter((_GalleryPresenter &)*pPresenter);
return;
}
+void
+_Gallery::OnSettingChanged(Tizen::Base::String& key)
+{
+ const wchar_t* LOCALE_LANGUAGE = L"http://tizen.org/setting/locale.language";
+ if (key == LOCALE_LANGUAGE)
+ {
+ __pPresenter->UpdateEmptyString();
+ }
+}
+
}}} // Tizen::Ui::Controls
, __horizontalAlignment(GALLERY_HORIZONTAL_ALIGN_CENTER)
, __emptyFontSize(0)
, __emptyFontStyle(FONT_STYLE_PLAIN)
+ , __userSetEmptyText(false)
, __pGalleryView(null)
{
AddPropertyChangeEventListener(*this);
result
_GalleryPresenter::SetTextOfEmptyGallery(const String& text)
{
+ __userSetEmptyText = true;
result r = __galleryRenderer.SetEmptyText(text);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
}
+void
+_GalleryPresenter::UpdateEmptyString(void)
+{
+ if (__userSetEmptyText == false)
+ {
+ GET_STRING_CONFIG(IDS_COM_BODY_NO_IMAGES, __emptyText);
+ result r = __galleryRenderer.SetEmptyText(__emptyText);
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ if (GetItemCount() == 0)
+ {
+ r = __galleryRenderer.EnableEmptyView();
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
+ r = __galleryRenderer.RefreshView();
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+}
+
}}} // Tizen::Ui::Controls
{
__pListModel->RestoreItemStatus();
}
+
+ return E_SUCCESS;
}
result
, __isAnimationCallbackBlocked(false)
, __lockLoadItemWithScroll(false)
, __itemTouchReleasedEventState(TABLE_VIEW_ITEM_TOUCH_RELEASED_EVENT_NORMAL)
+ , __scrollToItemTag()
{
__sweptItemTag.itemIndex = -1;
__sweptItemTag.groupIndex = -1;
__reservedScrollItemIndex.itemIndex = -1;
__reservedScrollItemIndex.groupIndex = -1;
+
+ __expandableItemTag.groupIndex = -1;
+ __expandableItemTag.itemIndex = -1;
}
_TableViewPresenter::~_TableViewPresenter()
__pItemDrawingProperty->propertyChanged = true;
}
- if (__pTableView->GetScrollStyle() == TABLE_VIEW_SCROLL_BAR_STYLE_FAST_SCROLL)
- {
- GET_SHAPE_CONFIG(TABLEVIEW::FASTSCROLL_INDEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, __pItemDrawingProperty->scrollMargin);
- }
- else
- {
- __pItemDrawingProperty->scrollMargin = 0;
- }
+ __pItemDrawingProperty->scrollMargin = 0;
if (!_FloatCompare(__pItemDrawingProperty->width, __pTableView->GetBoundsF().width))
{
__pListModel->SetGroupExpandState(groupIndex, true);
+ ResetSweepItem();
+
float groupTotalHeight = 0.0f;
int itemCount = GetItemCountAt(groupIndex);
_TableViewItem* pItem = null;
if (groupIndex < topTag.groupIndex || groupIndex > bottomTag.groupIndex)
{
- int firstLoadedGroupIndex = -1;
- int firstLoadedItemIndex = -1;
- __pListModel->GetFirstLoadedItemIndex(firstLoadedGroupIndex, firstLoadedItemIndex);
-
- TableViewItemTag firstLoadedItemTag = {firstLoadedGroupIndex, firstLoadedItemIndex};
- _TableViewItem* pItem = FindItem(firstLoadedItemTag);
+ _TableViewItem* pItem = FindItem(topTag);
if (pItem != null)
{
- float itemPositionY = CalculateItemPositionY(firstLoadedItemTag.groupIndex, firstLoadedItemTag.itemIndex);
-
FloatRectangle itemBounds = pItem->GetBoundsF();
- itemBounds.y = itemPositionY;
+ itemBounds.y = CalculateItemPositionY(topTag.groupIndex, topTag.itemIndex);
pItem->SetBounds(itemBounds);
-
- AttachNextItemsToBottom(firstLoadedItemTag);
+ AttachNextItemsToBottom(topTag);
if (groupIndex < topTag.groupIndex)
{
- _ScrollPanelPresenter::ScrollTo(screenPosition + groupTotalHeight);
+ ScrollTo(screenPosition + groupTotalHeight);
}
}
+ int firstLoadedGroupIndex = -1;
+ int firstLoadedItemIndex = -1;
+ __pListModel->GetFirstLoadedItemIndex(firstLoadedGroupIndex, firstLoadedItemIndex);
+
+ for (int j = firstLoadedGroupIndex; j <= topTag.groupIndex; j++)
+ {
+ int itemCount = GetItemCountAt(j);
+
+ for (int i = -1; i < itemCount; i++)
+ {
+ if (i >= topTag.itemIndex && j == topTag.groupIndex)
+ {
+ break;
+ }
+
+ UnloadItem(j, i);
+ }
+ }
return E_SUCCESS;
}
float startPosition = itemBounds.y + itemBounds.height;
float endPosition = startPosition + groupTotalHeight;
- if (!_FloatCompareLE(endPosition, screenPosition + __pTableView->GetBoundsF().height))
+ if (endPosition > screenPosition + __pTableView->GetBoundsF().height)
{
endPosition = screenPosition + __pTableView->GetBoundsF().height;
}
_TableViewItem* pItem = FindItem(firstLoadedItemTag);
if (pItem != null)
{
- float itemPositionY = CalculateItemPositionY(firstLoadedItemTag.groupIndex, firstLoadedItemTag.itemIndex);
-
FloatRectangle itemBounds = pItem->GetBoundsF();
- itemBounds.y = itemPositionY;
+ itemBounds.y = CalculateItemPositionY(firstLoadedItemTag.groupIndex, firstLoadedItemTag.itemIndex);
pItem->SetBounds(itemBounds);
-
AttachNextItemsToBottom(firstLoadedItemTag);
if (groupIndex < itemTag.groupIndex)
{
- _ScrollPanelPresenter::ScrollTo(screenPosition - groupTotalHeight);
+ ScrollTo(screenPosition - groupTotalHeight);
}
}
endPosition += itemBounds.height;
}
- if (!_FloatCompareLE(endPosition, screenPosition + __pTableView->GetBoundsF().height))
+ if (endPosition > screenPosition + __pTableView->GetBoundsF().height)
{
endPosition = screenPosition + __pTableView->GetBoundsF().height;
}
CollapseGroupAnimationFinished(false);
}
- AdjustClientAreaBounds(false, -groupTotalHeight);
-
return E_SUCCESS;
}
void
_TableViewPresenter::ScrollToItem(int groupIndex, int itemIndex, TableViewScrollItemAlignment itemAlignment, float shiftingDistance)
{
+ _VisualElement* pVisualElement = __pTableView->GetVisualElement();
+ String animationName(L"EXPAND_GROUP_ANIMATION");
+ VisualElementValueAnimation* pExpandGroupAnimation = dynamic_cast<VisualElementValueAnimation*>(pVisualElement->GetAnimationN(animationName));
+ if (pExpandGroupAnimation != null)
+ {
+ __scrollToItemTag.groupIndex = groupIndex;
+ __scrollToItemTag.itemIndex = itemIndex;
+ __scrollToItemTag.itemAlignment = itemAlignment;
+ __scrollToItemTag.shiftingDistance = shiftingDistance;
+ __scrollToItemTag.startedAnimation = true;
+ delete pExpandGroupAnimation;
+ return;
+ }
+
+ animationName = L"COLLAPSE_GROUP_ANIMATION";
+ VisualElementValueAnimation* pCollapseGroupAnimation = dynamic_cast<VisualElementValueAnimation*>(pVisualElement->GetAnimationN(animationName));
+ if (pCollapseGroupAnimation != null)
+ {
+ __scrollToItemTag.groupIndex = groupIndex;
+ __scrollToItemTag.itemIndex = itemIndex;
+ __scrollToItemTag.itemAlignment = itemAlignment;
+ __scrollToItemTag.shiftingDistance = shiftingDistance;
+ __scrollToItemTag.startedAnimation = true;
+ delete pCollapseGroupAnimation;
+ return;
+ }
+
TableViewItemTag itemPos = {groupIndex, itemIndex};
StopAllItemAnimation();
if (visible)
{
pItem = LoadItem(current.groupIndex, current.itemIndex);
+ if (pItem == null)
+ {
+ break;
+ }
}
else
{
pItem = FindItem(current);
- }
-
- if (pItem == null)
- {
- break;
+ if (pItem == null)
+ {
+ continue;
+ }
}
itemBounds = pItem->GetBoundsF();
if (visible)
{
- if (_FloatCompareGE(position, itemBounds.y) && !_FloatCompareGE(position, itemBounds.y + itemBounds.height))
+ if ((position >= itemBounds.y) && (position < itemBounds.y + itemBounds.height))
{
ShowTableViewCapturedItem(current.groupIndex, current.itemIndex, position - itemBounds.y);
pItem->SetVisibleState(false);
}
else
{
- if (!_FloatCompareGE(position, itemBounds.y))
+ if (position < itemBounds.y)
{
UnloadItem(current);
}
- else if (_FloatCompareGE(position, itemBounds.y) && !_FloatCompareGE(position, itemBounds.y + itemBounds.height))
+ else if ((position >= itemBounds.y) && (position < itemBounds.y + itemBounds.height))
{
pItem->SetVisibleState(false);
ShowTableViewCapturedItem(current.groupIndex, current.itemIndex, position - itemBounds.y);
while (GetNextItemPosition(current, next))
{
- if (_FloatCompareGE(screenPosition, nextItemPositionY))
+ if (screenPosition >= nextItemPositionY)
{
pCurrentItem = LoadItem(current.groupIndex, current.itemIndex);
if (pCurrentItem == null)
void
_TableViewPresenter::CollapseGroupAnimationFinished(bool completedNormally)
{
+ int itemCountInGroup = __pListModel->GetItemCountInGroup(__expandableItemTag.groupIndex);
+
if (completedNormally == false)
{
TableViewItemTag current;
current.groupIndex = __expandableItemTag.groupIndex;
current.itemIndex = -1;
- _TableViewItem* pCurrentItem = null;
- int itemCountInGroup = __pListModel->GetItemCountInGroup(__expandableItemTag.groupIndex);
-
for (int i = 0; i < itemCountInGroup; i++)
{
UnloadItem(__expandableItemTag.groupIndex, i);
}
- pCurrentItem = FindItem(current);
+ _TableViewItem* pCurrentItem = FindItem(current);
if (pCurrentItem == null)
{
SysTryReturnVoidResult(NID_UI_CTRL, pCurrentItem != null, E_SYSTEM, "[E_SYSTEM] A system error has been occurred.")
while (GetNextItemPosition(current, next))
{
current = next;
- if (_FloatCompareGE(screenPosition, nextItemPositionY))
+ if (screenPosition >= nextItemPositionY)
{
pCurrentItem = LoadItem(current.groupIndex, current.itemIndex);
if (pCurrentItem == null)
itemBounds = pCurrentItem->GetBoundsF();
itemBounds.y = nextItemPositionY;
pCurrentItem->SetBounds(itemBounds);
-
nextItemPositionY = pCurrentItem->GetBoundsF().y + pCurrentItem->GetBoundsF().height;
}
else
}
else
{
- float scrollPosition = GetScrollPosition();
-
- int groupItemsHeight = 0;
- _TableViewItem* pItem = null;
- for (int i = 0; i < __expandableItemTag.itemIndex; i++)
- {
- pItem = static_cast<_TableViewItem*>(__pListModel->GetItemFromTemporaryBuffer(__expandableItemTag.groupIndex, i));
- groupItemsHeight += pItem->GetItemHeight();
- }
-
- _TableViewItem* pTableViewItem = static_cast<_TableViewItem*>(__pListModel->GetItemFromTemporaryBuffer(__expandableItemTag.groupIndex, __expandableItemTag.itemIndex));
- FloatRectangle itemBounds = pTableViewItem->GetBoundsF();
- groupItemsHeight += (scrollPosition - itemBounds.y);
-
int currentGroupIndex = -1;
int currentItemIndex = -1;
GetTopDrawnItemIndex(currentGroupIndex, currentItemIndex);
}
}
- int itemCount = GetItemCountAt(__expandableItemTag.groupIndex);
- for (int i = 0; i < itemCount; i++)
+ for (int i = 0; i < itemCountInGroup; i++)
{
UnloadItem(__expandableItemTag.groupIndex, i);
}
+
+ GetTopDrawnItemIndex(currentGroupIndex, currentItemIndex);
+ TableViewItemTag currentItemTag;
+ currentItemTag.groupIndex = currentGroupIndex;
+ currentItemTag.itemIndex = currentItemIndex;
+
+ _TableViewItem* pItem = FindItem(currentItemTag);
+ if (pItem != null)
+ {
+ FloatRectangle itemBounds = pItem->GetBoundsF();
+ itemBounds.y = CalculateItemPositionY(currentGroupIndex, currentItemIndex);
+ pItem->SetBounds(itemBounds);
+ AttachNextItemsToBottom(currentItemTag);
+ if (__expandableItemTag.groupIndex < currentGroupIndex)
+ {
+ SetScrollPosition(itemBounds.y, false);
+ }
+ }
+ }
+
+ float groupTotalHeight = 0;
+ _TableViewItem* pItem = null;
+ for (int i = 0; i < itemCountInGroup; i++)
+ {
+ pItem = static_cast<_TableViewItem*>(__pListModel->GetItemFromTemporaryBuffer(__expandableItemTag.groupIndex, i));
+ groupTotalHeight += pItem->GetItemHeight();
}
+
+ AdjustClientAreaBounds(false, -groupTotalHeight);
}
void
{
__pCapturedItemVisualElement->SetShowState(false);
}
-
ExpandGroupAnimationFinished(completedNormally);
+
+ if (__scrollToItemTag.startedAnimation)
+ {
+ __scrollToItemTag.startedAnimation = false;
+ ScrollToItem(__scrollToItemTag.groupIndex, __scrollToItemTag.itemIndex, __scrollToItemTag.itemAlignment, __scrollToItemTag.shiftingDistance);
+ }
return;
}
else if (keyName == L"COLLAPSE_GROUP_ANIMATION")
{
__pCapturedItemVisualElement->SetShowState(false);
}
-
CollapseGroupAnimationFinished(completedNormally);
+
+ if (__scrollToItemTag.startedAnimation)
+ {
+ __scrollToItemTag.startedAnimation = false;
+ ScrollToItem(__scrollToItemTag.groupIndex, __scrollToItemTag.itemIndex, __scrollToItemTag.itemAlignment, __scrollToItemTag.shiftingDistance);
+ }
return;
}
else if (direction == _ACCESSIBILITY_FOCUS_DIRECTION_PREVIOUS)
{
GetLastItem(itemPos);
+
+ if (IsGroupExpanded(itemPos.groupIndex) == false)
+ {
+ itemPos.itemIndex = -1;
+ }
+
if (GetAccessibilityElementFocusedState() == false && FindItem(itemPos) == null)
{
ScrollToItem(itemPos.groupIndex, itemPos.itemIndex, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_BOTTOM);
static const int FLICK_ANIMATION_TIMER_PERIOD = 10;
static const int FLICK_ANIMATION_FPS_DATE_TIME_BAR = 30;
static const int FLICK_ANIMATION_SENSITIVITY_DATE_TIME_BAR = 30;
+ static const int FLICK_ANIMATION_VELOCITY_FACTOR_DATE_TIME_BAR = 3;
Tizen::Graphics::FloatRectangle __bodyAreaBounds;
Tizen::Graphics::FloatRectangle __arrowAreaBounds;
#define _FUI_CTRL_INTERNAL_GALLERY_H_
+#include <FSysISettingEventListener.h>
#include "FUi_Control.h"
#include "FUi_ITouchFlickGestureEventListener.h"
#include "FUi_ITouchTapGestureEventListener.h"
, virtual public Tizen::Ui::_ITouchGestureEventListener
, virtual public Tizen::Ui::_IUiEventPreviewer
, virtual public Tizen::Base::Runtime::IEventListener
+ , virtual public Tizen::System::ISettingEventListener
{
public:
virtual ~_Gallery(void);
void ResizeGalleryAccessibilityElement(void);
+ virtual void OnSettingChanged(Tizen::Base::String& key);
+
private:
_Gallery(void);
result Construct(_GalleryItemProviderAdaptorImpl* pGalleryItemProviderAdaptor);
virtual void OnFontInfoRequested(unsigned long& style, int& size);
+ void UpdateEmptyString(void);
+
protected:
_GalleryPresenter(_IGalleryRenderer& galleryRenderer);
result Construct(_GalleryItemProviderAdaptorImpl* pGalleryItemProviderAdaptor, _Gallery* pGalleryView);
int __emptyFontSize;
Tizen::Graphics::FontStyle __emptyFontStyle;
+ bool __userSetEmptyText;
_Gallery* __pGalleryView;
long long touchPressedTick;
Tizen::Graphics::FloatRectangle itemBounds;
-
_TableViewReorderInfo(void)
: groupIndex(-1)
, itemIndex(-1)
bool operator!= (const _TableViewSectionStringAlignment& rhs) const;
};
+struct _TableViewScrollToItemTag
+{
+ int groupIndex;
+ int itemIndex;
+ TableViewScrollItemAlignment itemAlignment;
+ float shiftingDistance;
+ bool startedAnimation;
+
+ _TableViewScrollToItemTag(void)
+ : groupIndex(-1)
+ , itemIndex(-1)
+ , itemAlignment(TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_TOP)
+ , shiftingDistance(0)
+ , startedAnimation(false)
+ {
+
+ }
+};
class _TableView;
class _ListViewModel;
int __itemTouchReleasedEventState;
+ _TableViewScrollToItemTag __scrollToItemTag;
+
static const int TABLEVIEW_MAX_ITEM_COUNT = 30;
static const int REORDER_SCROLL_ANIMATION_TIMER_DURATION = 10;
static const float REORDER_SCROLL_ANIMATION_DISTANCE = 10.0f;
void SetItemList(ProxyList* pItemList);
ProxyList* GetProxyList(void) const;
+ void AlignToDevice(const LayoutPoint layoutPoint, LayoutPoint& alignedPoint);
+ void AlignToDevice(const LayoutSize layoutSize, LayoutSize& alignedSize);
+ void AlignToDevice(const LayoutRect layoutRect, LayoutRect& alignedRect);
+
private:
/**
* This is the copy constructor for this class.
*/
#include <FBaseSysLog.h>
+#include <FGrpCoordinateSystem.h>
+#include <FGrpFloatRectangle.h>
+#include <FGrpFloatDimension.h>
+#include <FGrpFloatPoint.h>
#include "FUi_LayoutLayout.h"
#include "FUi_LayoutLayoutItemProxy.h"
#include "FUi_LayoutProxyList.h"
#include "FUi_LayoutLayoutItemInfo.h"
#include "FUi_LayoutLayoutList.h"
+using namespace Tizen::Graphics;
+
namespace Tizen { namespace Ui { namespace _Layout
{
return __pProxyList;
}
+void
+Layout::AlignToDevice(const LayoutPoint layoutPoint, LayoutPoint& alignedPoint)
+{
+ FloatPoint point(layoutPoint.x, layoutPoint.y);
+ point = CoordinateSystem::AlignToDevice(point);
+
+ alignedPoint.x = point.x;
+ alignedPoint.y = point.y;
+}
+
+void
+Layout::AlignToDevice(const LayoutSize layoutSize, LayoutSize& alignedSize)
+{
+ FloatDimension size(layoutSize.w, layoutSize.h);
+ size = CoordinateSystem::AlignToDevice(size);
+
+ alignedSize.w = size.width;
+ alignedSize.h = size.height;
+}
+
+void
+Layout::AlignToDevice(const LayoutRect layoutRect, LayoutRect& alignedRect)
+{
+ FloatRectangle rect(layoutRect.x, layoutRect.y, layoutRect.w, layoutRect.h);
+ rect = CoordinateSystem::AlignToDevice(rect);
+
+ alignedRect.x = rect.x;
+ alignedRect.y = rect.y;
+ alignedRect.w = rect.width;
+ alignedRect.h = rect.height;
+}
+
}}} // Tizen::Ui::_Layout
{
return r;
}
+ AlignToDevice(curItemRect, curItemRect);
curItemRect.x = targetPosition.x + curItemMargin.left;
}
{
return r;
}
+ AlignToDevice(curItemRect, curItemRect);
curItemRect.y = targetPosition.y + curItemMargin.top;
}
return r;
}
+ AlignToDevice(curItemRect, curItemRect);
if (pCurItemInfo->__pTarget[EDGE_LEFT] != null)
{
curItemRect.w = targetPosition.x - curItemRect.x - curItemMargin.right;
return r;
}
+ AlignToDevice(curItemRect, curItemRect);
if (pCurItemInfo->__pTarget[EDGE_TOP] != null)
{
curItemRect.h = targetPosition.y - curItemRect.y - curItemMargin.bottom;
pItemProxy->GetMeasuredSize(rect.w, rect.h);
ItemMargin margin = pItemProxy->GetItemMargin();
- ItemAlign itemAlign = pItemProxy->GetItemAlignment();
- if (itemAlign.HAlign == ITEM_HORIZONTAL_ALIGN_LEFT || itemAlign.HAlign == ITEM_HORIZONTAL_ALIGN_LEFT_RIGHT)
+ if (!__pColInfo[j].widthStretchable && !__pColInfo[j].widthShrinkable)
{
- rect.w += margin.left;
+ rect.w += margin.left + margin.right;
}
- if (itemAlign.HAlign == ITEM_HORIZONTAL_ALIGN_RIGHT || itemAlign.HAlign == ITEM_HORIZONTAL_ALIGN_LEFT_RIGHT)
- {
- rect.w += margin.right;
- }
- if (itemAlign.VAlign == ITEM_VERTICAL_ALIGN_TOP || itemAlign.VAlign == ITEM_VERTICAL_ALIGN_TOP_BOTTOM)
- {
- rect.h += margin.top;
- }
- if (itemAlign.VAlign == ITEM_VERTICAL_ALIGN_BOTTOM || itemAlign.VAlign == ITEM_VERTICAL_ALIGN_TOP_BOTTOM)
+
+ if (!__pRowInfo[i].heightStretchable && !__pRowInfo[i].heightShrinkable)
{
- rect.h += margin.bottom;
+ rect.h += margin.top + margin.bottom;
}
if (!pItemInfo->__merged)
ProxyListNode* pCurNode = null;
TableItemInfo* pItemInfo = null;
- if (shrinkTotalWidth > 0 && __shrinkColumnCount > 0)
+ if (shrinkTotalWidth >= 0.0f && __shrinkColumnCount > 0)
{
if (pContainerProxy->GetItemWidthMatchMode() == WRAP_CONTENT)
{
delete[] pShrinkedColumns;
}
- if (shrinkTotalHeight > 0.0f && __shrinkRowCount > 0)
+ if (shrinkTotalHeight >= 0.0f && __shrinkRowCount > 0)
{
if (pContainerProxy->GetItemHeightMatchMode() == WRAP_CONTENT)
{
ProxyListNode* pCurNode = null;
TableItemInfo* pItemInfo = null;
- if (stretchTotalWidth > 0 && __stretchColumnCount > 0)
+ if (stretchTotalWidth >= 0.0f && __stretchColumnCount > 0)
{
if (pContainerProxy->GetItemWidthMatchMode() == WRAP_CONTENT)
{
delete[] pStretchedColumns;
}
- if (stretchTotalHeight > 0 && __stretchRowCount > 0)
+ if (stretchTotalHeight >= 0.0f && __stretchRowCount > 0)
{
if (pContainerProxy->GetItemHeightMatchMode() == WRAP_CONTENT)
{