_LiveboxViewPresenter::_LiveboxViewPresenter(const _LiveboxView& liveBoxView)
: __pLiveboxView(const_cast <_LiveboxView*>(&liveBoxView))
, __pLiveboxViewModel(new (std::nothrow) _LiveboxViewModel())
+ , __pSimpleText(null)
{
SysTryReturnVoidResult(NID_UI_CTRL, __pLiveboxViewModel, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
}
result
_LiveboxViewPresenter::Initialize(const AppId& appId, const Tizen::Base::String& providerName)
{
- const int FONT_SIZE = 10;
+ const int FONT_SIZE = 20;
__pLiveboxViewModel->Initialize(appId, providerName);
unique_ptr<Font> pFont(new (std::nothrow) Font());
SysTryReturn(NID_UI_CTRL, pFont, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
- result r = pFont->Construct(FONT_STYLE_PLAIN, FONT_SIZE);
+ result r = pFont->Construct(FONT_STYLE_BOLD, FONT_SIZE);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
std::unique_ptr<TextObject> pTextObject(new (std::nothrow) TextObject());
void
_LiveboxViewPresenter::DrawText(Canvas& canvas)
{
- const int TEXT_OBJECT_HEIGHT = 20;
-
+ const int TEXT_OBJECT_HEIGHT = 25;
+ result r = E_SUCCESS;
String appName(GetDisplayName());
- unique_ptr<TextSimple> pSimpleText(new (std::nothrow) TextSimple(appName.GetPointer(), appName.GetLength()));
- SysTryReturnVoidResult(NID_UI_CTRL, pSimpleText, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+ if (!__pSimpleText)
+ {
+ unique_ptr<TextSimple> pSimpleText(new (std::nothrow) TextSimple(appName.GetPointer(), appName.GetLength()));
+ SysTryReturnVoidResult(NID_UI_CTRL, pSimpleText, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
- result r = __pTextObject->AppendElement(*pSimpleText);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = __pTextObject->AppendElement(*pSimpleText);
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- Rectangle liveboxBounds(__pLiveboxView->GetBounds());
+ __pSimpleText = pSimpleText.release();
+ }
+ Rectangle liveboxBounds(__pLiveboxView->GetBounds());
+
__pTextObject->SetBounds(Rectangle(0, liveboxBounds.height - TEXT_OBJECT_HEIGHT, liveboxBounds.width, TEXT_OBJECT_HEIGHT));
__pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE);
__pTextObject->SetFont(__pFont.get(), 0, __pTextObject->GetTextLength());
r = __pTextObject->Draw(*_CanvasImpl::GetInstance(canvas));
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
- pSimpleText.release();
}
}} // Tizen::Shell