Fixed black live box issue
authorHeeJu Kang <mobum.kang@samsung.com>
Fri, 4 Jan 2013 07:53:02 +0000 (16:53 +0900)
committerHeeJu Kang <mobum.kang@samsung.com>
Fri, 4 Jan 2013 07:53:02 +0000 (16:53 +0900)
Change-Id: I6574a87b27aaed23d1ad7dcc307ac669a016782a
Signed-off-by: HeeJu Kang <mobum.kang@samsung.com>
src/FShell_LiveboxFrame.cpp
src/FShell_LiveboxFrame.h
src/FShell_LiveboxPopup.cpp
src/FShell_LiveboxPopup.h

index e9f317f..8a0508f 100644 (file)
@@ -91,7 +91,6 @@ result
 _LiveboxFrame::Initialize(const Dimension& size)
 {
        result r = E_SUCCESS;
-       _VisualElement* pVisualElement = null;
 
        const int DEFAULT_WIDTH = 172;
        const int DEFAULT_HEIGHT = 172;
@@ -109,33 +108,27 @@ _LiveboxFrame::Initialize(const Dimension& size)
 
        SetSystemWindow(true);
 
+       r = CreateRootVisualElement();
+       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
        Rectangle bounds(0, 0, liveboxSize.width, liveboxSize.height);
        r = SetBounds(bounds);
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       FloatRectangle fBounds(0.0f, 0.0f, static_cast<float>(bounds.width), static_cast<float>(bounds.height));
-
        r = __pLiveboxFramePresenter->Initialize();
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       unique_ptr<_LiveboxLayer> pLayer(new (std::nothrow) _LiveboxLayer(*this));
-       SysTryReturn(NID_UI_CTRL, pLayer, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
-
-       pLayer->Construct();
-       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       __pLiveboxLayer = move(pLayer);
-       __pLiveboxFrameRootVisualElement = __pLiveboxLayer->GetRootVisualElement();
-
        __pLiveboxLayer->SetLayerBounds(bounds);
        __pLiveboxLayer->SetShowState(false);
 
+       FloatRectangle fBounds(0.0f, 0.0f, static_cast<float>(bounds.width), static_cast<float>(bounds.height));
+
        __pLiveboxFrameRootVisualElement->SetImplicitAnimationEnabled(false);
        __pLiveboxFrameRootVisualElement->SetName(L"_LiveboxFrame");
        __pLiveboxFrameRootVisualElement->SetBounds(fBounds);
        __pLiveboxFrameRootVisualElement->SetShowState(false);
 
-       pVisualElement = GetVisualElement();
+       _VisualElement* pVisualElement = GetVisualElement();
        r = GetLastResult();
        SysTryReturn(NID_UI_CTRL, pVisualElement, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -206,6 +199,24 @@ _LiveboxFrame::SetLayerBounds(const Rectangle& bounds)
        return r;
 }
 
+result
+_LiveboxFrame::CreateLayer(void)
+{
+       unique_ptr<_LiveboxLayer> pLayer(new (std::nothrow) _LiveboxLayer(*this));
+       SysTryReturn(NID_UI_CTRL, pLayer, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
+       result r = pLayer->Construct();
+       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       __pLiveboxLayer = move(pLayer);
+       __pLiveboxFrameRootVisualElement = __pLiveboxLayer->GetRootVisualElement();
+
+       SetLayer(*__pLiveboxLayer.get());
+       SetRootVisualElement(*__pLiveboxFrameRootVisualElement);
+
+       return r;
+}
+
 void
 _LiveboxFrame::OnActivated(void)
 {
index 17a69c6..7e7cad3 100644 (file)
@@ -69,6 +69,7 @@ private:
        result SetLayerShowState(bool showState);
        result SetLayerBounds(const Tizen::Graphics::Rectangle& bounds);
 
+       virtual result CreateLayer(void);
        virtual void OnActivated(void);
        virtual void OnDeactivated(void);
        virtual void OnBoundsChanged(void);
index bbb88b9..9ab679f 100644 (file)
@@ -188,27 +188,21 @@ _LiveboxPopup::Initialize(const Tizen::Graphics::Dimension& size)
 
        SetSystemWindow(true);
 
+       r = CreateRootVisualElement();
+       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
        Rectangle bounds(0, 0, size.width, size.height);
        r = SetBounds(bounds);
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       FloatRectangle fBounds(0.0f, 0.0f, static_cast<float>(bounds.width), static_cast<float>(bounds.height));
-
        r = __pLiveboxPopupPresenter->Initialize();
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       unique_ptr<_LiveboxPopupLayer> pLayer(new (std::nothrow) _LiveboxPopupLayer(*this));
-       SysTryReturn(NID_UI_CTRL, pLayer, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
-
-       r = pLayer->Construct();
-       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       __pLiveboxPopupLayer = move(pLayer);
-       __pLiveboxPopupRootVisualElement = __pLiveboxPopupLayer->GetRootVisualElement();
-
        __pLiveboxPopupLayer->SetLayerBounds(bounds);
        __pLiveboxPopupLayer->SetShowState(false);
 
+       FloatRectangle fBounds(0.0f, 0.0f, static_cast<float>(bounds.width), static_cast<float>(bounds.height));
+
        __pLiveboxPopupRootVisualElement->SetImplicitAnimationEnabled(false);
        __pLiveboxPopupRootVisualElement->SetName(L"_LiveboxPopup");
        __pLiveboxPopupRootVisualElement->SetBounds(fBounds);
@@ -286,6 +280,24 @@ _LiveboxPopup::SetLayerBounds(const Rectangle& bounds)
        return r;
 }
 
+result
+_LiveboxPopup::CreateLayer(void)
+{
+       unique_ptr<_LiveboxPopupLayer> pLayer(new (std::nothrow) _LiveboxPopupLayer(*this));
+       SysTryReturn(NID_UI_CTRL, pLayer, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+
+       result r = pLayer->Construct();
+       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       __pLiveboxPopupLayer = move(pLayer);
+       __pLiveboxPopupRootVisualElement = __pLiveboxPopupLayer->GetRootVisualElement();
+
+       SetLayer(*__pLiveboxPopupLayer.get());
+       SetRootVisualElement(*__pLiveboxPopupRootVisualElement);
+
+       return r;
+}
+
 void
 _LiveboxPopup::OnActivated(void)
 {
index 3f43810..020c640 100644 (file)
@@ -69,6 +69,7 @@ private:
        result SetLayerShowState(bool showState);
        result SetLayerBounds(const Tizen::Graphics::Rectangle& bounds);
 
+       virtual result CreateLayer(void);
        virtual void OnActivated(void);
        virtual void OnDeactivated(void);
        virtual void OnBoundsChanged(void);