Apply new UX guide for predefined item
authorWoowon <woowon.park@samsung.com>
Wed, 10 Jul 2013 06:36:57 +0000 (15:36 +0900)
committerWoowon <woowon.park@samsung.com>
Wed, 10 Jul 2013 06:36:57 +0000 (15:36 +0900)
Change-Id: Ife189cfde8b6f79c24278615ed62f88d8dba482e
Signed-off-by: Woowon <woowon.park@samsung.com>
src/nfc-push-ui-app-control/res/bounds.png [new file with mode: 0644]
src/nfc-push-ui-app-control/src/NfcPushUiForm.cpp

diff --git a/src/nfc-push-ui-app-control/res/bounds.png b/src/nfc-push-ui-app-control/res/bounds.png
new file mode 100644 (file)
index 0000000..385a09a
Binary files /dev/null and b/src/nfc-push-ui-app-control/res/bounds.png differ
index 78bec50..118a28f 100644 (file)
@@ -158,26 +158,37 @@ NfcPushUiForm::OnInitializing(void)
        __pVisualElementBounds = new (std::nothrow) VisualElement();
        __pVisualElementBounds->Construct();
        __pVisualElementBounds->SetName(L"Grow");
-       __pVisualElementBounds->SetBounds(FloatRectangle((__rect.width / 2.0f) - 75.0f, (__rect.height / 2.0f) - 75.0f, 150.0f, 150.0f));
+       __pVisualElementBounds->SetBounds(FloatRectangle((__rect.width / 2.0f) - 121.0f, __rect.height  - 794.0f, 242.0f, 242.0f));
        __pVisualElementBounds->SetShowState(true);
        __pVisualElementBounds->SetImplicitAnimationEnabled(false);
        __pVisualElement->AttachChild(*__pVisualElementBounds);
 
        __endRect = __pVisualElementBounds->GetBounds();
-       __startRect = FloatRectangle(__endRect.x + 75.0f, __endRect.y + 75.0f, 0, 0);
+       __startRect = FloatRectangle(__endRect.x + 121.0f, __endRect.y + 121.0f, 0, 0);
 
        std::unique_ptr<Canvas> pCanvas(__pVisualElementBounds->GetCanvasN());
        SysTryReturnResult(NID_NET_NFC, pCanvas != null, E_OUT_OF_MEMORY, "Failed to get canvas.");
+
+       std::unique_ptr<Bitmap> pBitmap;
+       Image image;
+
+       r = image.Construct();
+       SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to construct an Image instance.");
+
+       // decode the bitmap
+       String iconPath = App::GetInstance()->GetAppRootPath() + L"res/bounds.png";
+       pBitmap.reset(image.DecodeN(iconPath, BITMAP_PIXEL_FORMAT_ARGB8888));
+       SysTryReturnResult(NID_NET_NFC, pBitmap != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+       // scale the bitmap
+       r = pBitmap->Scale(Dimension(242, 242));
+       SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to scale the bitmap.");
+
+       // draw the bitmap
        pCanvas->SetBackgroundColor(Color(0x00000000));
        pCanvas->Clear();
-       pCanvas->SetForegroundColor(Color::GetColor(COLOR_ID_GREY));
-       pCanvas->SetLineStyle(LINE_STYLE_SOLID);
-       pCanvas->SetLineWidth(6);
-       pCanvas->DrawEllipse(Rectangle(25, 25, 100, 100));
-       pCanvas->SetLineWidth(4);
-       pCanvas->DrawEllipse(Rectangle(15, 15, 120, 120));
-       pCanvas->SetLineWidth(2);
-       pCanvas->DrawEllipse(Rectangle(5, 5, 140, 140));
+       r = pCanvas->DrawBitmap(Point(__rect.x, __rect.y), *pBitmap);
+       SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to draw the bitmap.");
 
        __pVisualElementBounds->SetBounds(__startRect);
 
@@ -187,7 +198,7 @@ NfcPushUiForm::OnInitializing(void)
        __pVisualElementOpacity = new (std::nothrow) VisualElement();
        __pVisualElementOpacity->Construct();
        __pVisualElementOpacity->SetName(L"Opacity");
-       __pVisualElementOpacity->SetBounds(FloatRectangle((__rect.width / 2) - 50, (__rect.height / 2) - 50, 100, 100));
+       __pVisualElementOpacity->SetBounds(FloatRectangle((__rect.width / 2) - 53, __rect.height - 726, 106, 106));
        __pVisualElementOpacity->SetShowState(true);
        __pVisualElementOpacity->SetImplicitAnimationEnabled(false);
        __pVisualElement->AttachChild(*__pVisualElementOpacity);
@@ -195,18 +206,12 @@ NfcPushUiForm::OnInitializing(void)
        pCanvas.reset(__pVisualElementOpacity->GetCanvasN());
        SysTryReturnResult(NID_NET_NFC, pCanvas != null, E_OUT_OF_MEMORY, "Failed to get canvas.");
 
-       std::unique_ptr<Bitmap> pBitmap;
-       Image image;
-
-       r = image.Construct();
-       SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to construct an Image instance.");
-
        // decode the bitmap
        pBitmap.reset(image.DecodeN(__iconPath, BITMAP_PIXEL_FORMAT_ARGB8888));
        SysTryReturnResult(NID_NET_NFC, pBitmap != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
 
        // scale the bitmap
-       r = pBitmap->Scale(Dimension(100, 100));
+       r = pBitmap->Scale(Dimension(106, 106));
        SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to scale the bitmap.");
 
        __startOpacity = 0.0f;
@@ -326,7 +331,7 @@ NfcPushUiForm::DrawAppInfoToCanvas(const Tizen::Graphics::Rectangle& rect)
        std::unique_ptr<TextElement> pTextElement(new (std::nothrow) TextElement());
        SysTryReturnResult(NID_NET_NFC, pTextElement != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
 
-       r = pEnrichedText->Construct(Dimension(textAreaWidth, 200));
+       r = pEnrichedText->Construct(Dimension(textAreaWidth, 100));
        SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to construct an enriched text.");
 
        pEnrichedText->SetHorizontalAlignment(TEXT_ALIGNMENT_CENTER);
@@ -341,7 +346,7 @@ NfcPushUiForm::DrawAppInfoToCanvas(const Tizen::Graphics::Rectangle& rect)
        pTextElement->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
        {
                Font font;
-               font.Construct(FONT_STYLE_BOLD, 40);
+               font.Construct(FONT_STYLE_BOLD, 42);
                pTextElement->SetFont(font);
        }
 
@@ -353,7 +358,7 @@ NfcPushUiForm::DrawAppInfoToCanvas(const Tizen::Graphics::Rectangle& rect)
        SysTryReturnResult(NID_NET_NFC, pCanvas != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
 
        // Draws the EnrichedText at the specified Point
-       pCanvas->DrawText(Point(0, (rect.height / 2) + 100), *pEnrichedText);
+       pCanvas->DrawText(Point(0, rect.height - 510), *pEnrichedText);
 
        return r;
 }
@@ -399,7 +404,7 @@ NfcPushUiForm::DrawGuideTextToCanvas(const Tizen::Graphics::Rectangle& rect)
        pTextElement->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
        {
                Font font;
-               font.Construct(FONT_STYLE_BOLD, 40);
+               font.Construct(FONT_STYLE_BOLD, 42);
                pTextElement->SetFont(font);
        }
 
@@ -412,7 +417,7 @@ NfcPushUiForm::DrawGuideTextToCanvas(const Tizen::Graphics::Rectangle& rect)
        SysTryReturnResult(NID_NET_NFC, pCanvas != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
 
        // Draws the EnrichedText at the specified Point
-       r = pCanvas->DrawText(Point((rect.width - textAreaWidth) / 2, (int)(rect.height / 4)), *pEnrichedText);
+       r = pCanvas->DrawText(Point((rect.width - textAreaWidth) / 2, rect.height -1030), *pEnrichedText);
        SysTryReturnResult(NID_NET_NFC, r == E_SUCCESS, r, "Failed to draw text to canvas.");
 
        return r;
@@ -483,7 +488,7 @@ NfcPushUiForm::OnVisualElementAnimationFinished(const VisualElementAnimation& an
        {
                if (keyName == L"opacity")
                {
-                       float margin = (__endRect.width * 0.2f) / 2;
+                       float margin = (__endRect.width * 0.05f) / 2;
                        __startRect = __endRect;
                        __endRect = FloatRectangle(__startRect.x - margin, __startRect.y - margin,
                                        __startRect.width + (margin * 2), __startRect.height + (margin * 2));
@@ -518,7 +523,7 @@ NfcPushUiForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Gr
 
        // reset the circles size
        __startRect = __endRect;
-       __endRect = FloatRectangle(__startRect.x + 90.0f, __startRect.y + 90.0f, 0, 0);
+       __endRect = FloatRectangle(__startRect.x + 127.05f, __startRect.y + 127.05f, 0, 0);
 
        // play animation
        AnimationTransaction::Begin();