__pTouchAniVE->SetBounds(FloatRectangle(rect.x, rect.y, width, height));
__pTouchAniVE->SetShowState(true);
+ Canvas* pCanvas = __pTouchAniVE->GetCanvasN();
+ SysTryReturn(NID_UI_CTRL, pCanvas != null, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
+ pCanvas->Clear();
+
+
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(bitmap))
{
- Canvas* pCanvas = __pTouchAniVE->GetCanvasN();
- SysTryReturn(NID_UI_CTRL, pCanvas != null, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
- pCanvas->Clear();
pCanvas->DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, bitmap.GetWidthF(), bitmap.GetHeightF()), bitmap);
- delete pCanvas;
}
else
{
- String imagePath = _BitmapImpl::GetInstance(bitmap)->GetFileName();
-
- if (!imagePath.IsEmpty())
- {
- __pTouchAniVE->SetImageSource(imagePath);
- }
- else
- {
- __pTouchAniVE->SetImageSource(L"");
- Canvas* pCanvas = __pTouchAniVE->GetCanvasN();
- SysTryReturn(NID_UI_CTRL, pCanvas != null, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
- pCanvas->Clear();
- pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, width, height), bitmap);
- delete pCanvas;
- }
+ pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, width, height), bitmap);
}
+ delete pCanvas;
if (!_FloatCompareGE(ratio, REFERENCE_FACTOR))
{
__pFocusVE->SetBounds(FloatRectangle(focusUiBounds.x, focusUiBounds.y, focusUiBounds.width, focusUiBounds.height));
}
- if (isFocused)
- {
- Canvas* pCanvas = __pFocusVE->GetCanvasN();
- SysTryReturn(NID_UI_CTRL, pCanvas != null, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ Canvas* pCanvas = __pFocusVE->GetCanvasN();
+ SysTryReturn(NID_UI_CTRL, pCanvas != null, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
- pCanvas->Clear();
+ pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
+ pCanvas->Clear();
+ if (isFocused)
+ {
if (__pProperty->GetFocusBitmap() != null)
{
const Bitmap* pShadowBitmap = __pProperty->GetFocusBitmap();
pCanvas->DrawBitmap(__pProperty->GetDropShadowBitmapBounds(), *pShadowBitmap);
}
__pFocusVE->SetShowState(true);
- delete pCanvas;
}
}
else
, __firstTouchMoveDirection(ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL)
, __RequestToDrawAccessibilityFocusUi(false)
, __runningAnimationBackupIndex(INVALID_INDEX)
- , __lazyDecodeBackGroundBitmap(false)
- , __lazyDecodeEmptyListBitmap(false)
{
}
const Bitmap* pBackgroundBitmap = __pIconListView->GetBackgroundBitmap();
if (pBackgroundBitmap != null)
{
+ Canvas* pCanvas = __pVE->GetCanvasN();
+ SysTryCatch(NID_UI_CTRL, (pCanvas!= null), , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ pCanvas->SetBackgroundColor(backgroundColor);
+ pCanvas->Clear();
FloatRectangle bounds(__pIconListView->GetBoundsF());
bounds.SetPosition(0.0f, 0.0f);
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBackgroundBitmap))
{
- Canvas* pCanvas = __pVE->GetCanvasN();
- SysTryCatch(NID_UI_CTRL, (pCanvas!= null), , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- pCanvas->SetBackgroundColor(backgroundColor);
- pCanvas->Clear();
pCanvas->DrawNinePatchedBitmap(bounds, *pBackgroundBitmap);
- delete pCanvas;
}
else
{
- String imagePath = _BitmapImpl::GetInstance(*pBackgroundBitmap)->GetFileName();
-
- if (!imagePath.IsEmpty())
- {
- __pVE->SetImageSource(imagePath);
- __lazyDecodeBackGroundBitmap = true;
- }
- else
- {
- __pVE->SetImageSource(L"");
- __lazyDecodeBackGroundBitmap = false;
- Canvas* pCanvas = __pVE->GetCanvasN();
- SysTryCatch(NID_UI_CTRL, (pCanvas!= null), , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- pCanvas->SetBackgroundColor(backgroundColor);
- pCanvas->Clear();
- pCanvas->DrawBitmap(bounds, *pBackgroundBitmap);
- delete pCanvas;
- }
+ pCanvas->DrawBitmap(bounds, *pBackgroundBitmap);
}
+ delete pCanvas;
+
__needBaseCanvas = true;
}
else
}
// set visual element or canvas for empty list
- if (pBitmap != null && __pEmptyListVE == null)
+ if (!__needBaseCanvas && __pEmptyListVE == null)
{
__pEmptyListVE = new (std::nothrow) _VisualElement();
SysTryCatch(NID_UI, __pEmptyListVE != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
}
// draw empty list
- if (pBitmap != null && __pEmptyListVE != null)
+ if (!__needBaseCanvas)
{
__pEmptyListVE->SetBounds(bounds);
__pEmptyListVE->SetShowState(true);
+ pCanvas = __pEmptyListVE->GetCanvasN();
+ SysTryCatch(NID_UI, pCanvas != null, , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ Color backgroundColor = __pIconListView->GetBackgroundColor();
+ pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
+ pCanvas->Clear();
+
bounds.x = 0.0f;
bounds.y = 0.0f;
}
FloatRectangle bitmapBounds(bounds.x + bitmapXPosition, bounds.y, bitmapWidth, bitmapHeight);
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBitmap))
{
- pCanvas = __pEmptyListVE->GetCanvasN();
- SysTryCatch(NID_UI, pCanvas != null, , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
- pCanvas->Clear();
pCanvas->DrawNinePatchedBitmap(bitmapBounds, *pBitmap);
}
else
{
- String imagePath = _BitmapImpl::GetInstance(*pBitmap)->GetFileName();
-
- if (!imagePath.IsEmpty())
- {
- __pEmptyListVE->SetImageSource(imagePath);
- __lazyDecodeEmptyListBitmap = true;
- }
- else
- {
- __pEmptyListVE->SetImageSource(L"");
- __lazyDecodeEmptyListBitmap = false;
- pCanvas = __pEmptyListVE->GetCanvasN();
- SysTryCatch(NID_UI, pCanvas != null, , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
- pCanvas->Clear();
- pCanvas->DrawBitmap(bitmapBounds, *pBitmap);
- }
+ pCanvas->DrawBitmap(bitmapBounds, *pBitmap);
}
}
if (pCanvas == null)
{
- if (__pEmptyListVE != null)
- {
- pCanvas = __pEmptyListVE->GetCanvasN();
- }
- else
- {
- pCanvas = __pVE->GetCanvasN();
- }
+ pCanvas = __pEmptyListVE->GetCanvasN();
SysTryCatch(NID_UI, pCanvas != null, , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
pCanvas->Clear();
__listStatusChanged = false;
+ if (__needBaseCanvas && __pEmptyListVE != null)
+ {
+ __pEmptyListVE->Destroy();
+ __pEmptyListVE = null;
+ }
+
delete pCanvas;
delete pTextObject;
return r;
DrawFocusUi(__highlightedIndex);
}
-
-Canvas*
-_IconListPresenter::OnCanvasRequestedN(const FloatRectangle& bounds)
-{
- int itemCount = __pListModel->GetItemCountInGroup(DEFAULT_GROUP_INDEX);
-
- if (__pIconListView->GetBackgroundBitmap() != null && itemCount > 0)
- {
- if (__pVE != null && __lazyDecodeBackGroundBitmap == true)
- {
- const Bitmap* pBackgroundBitmap = __pIconListView->GetBackgroundBitmap();
-
- if (pBackgroundBitmap != null)
- {
- Canvas* pCanvas = __pVE->GetCanvasN();
- SysTryCatch(NID_UI_CTRL, (pCanvas!= null), , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- Color backgroundColor = __pIconListView->GetBackgroundColor();
- pCanvas->SetBackgroundColor(backgroundColor);
- pCanvas->Clear();
-
- pBackgroundBitmap->IsNinePatchedBitmap();
- Draw();
- return pCanvas;
- }
- }
- }
- else if (__pIconListView->GetBitmapOfEmptyList() != null && itemCount <= 0)
- {
- if (__pEmptyListVE != null && __lazyDecodeEmptyListBitmap == true)
- {
- const Bitmap* pEmptyBitmap = __pIconListView->GetBitmapOfEmptyList();
-
- if (pEmptyBitmap != null)
- {
- Canvas* pCanvas = __pEmptyListVE->GetCanvasN();
- SysTryCatch(NID_UI_CTRL, (pCanvas!= null), , GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
- pCanvas->Clear();
-
- pEmptyBitmap->IsNinePatchedBitmap();
- DrawEmptyList();
- return pCanvas;
- }
- }
- }
-
-CATCH:
- return null;
-}
-
// Tizen::Ui::_IKeyEventPreviewer
bool
_IconListPresenter::OnPreviewKeyPressed(const _Control& source, const _KeyInfo& keyInfo)