Token Effect Bitmap draw
authorKunal Sinha <kunal.sinha@samsung.com>
Mon, 8 Apr 2013 15:04:23 +0000 (20:34 +0530)
committerKunal Sinha <kunal.sinha@samsung.com>
Tue, 9 Apr 2013 12:46:09 +0000 (18:16 +0530)
Change-Id: I383b9a6f22ee7ef9edb4725fed3b334bcce32618
Signed-off-by: Kunal Sinha <kunal.sinha@samsung.com>
17 files changed:
res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg_ef.#.png [deleted file]
res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg_press_ef.#.png [deleted file]
res/common/usr/share/osp/bitmaps/480x800/black/00_contacts_button_bg_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/480x800/black/00_contacts_button_bg_press_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/480x800/default/00_contacts_button_bg_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/480x800/default/00_contacts_button_bg_press_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/480x800/white/00_contacts_button_bg_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/480x800/white/00_contacts_button_bg_press_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg_ef.#.png [deleted file]
res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg_press_ef.#.png [deleted file]
res/common/usr/share/osp/bitmaps/720x1280/black/00_contacts_button_bg_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/720x1280/black/00_contacts_button_bg_press_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/720x1280/default/00_contacts_button_bg_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/720x1280/default/00_contacts_button_bg_press_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/720x1280/white/00_contacts_button_bg_ef.#.png [new file with mode: 0644]
res/common/usr/share/osp/bitmaps/720x1280/white/00_contacts_button_bg_press_ef.#.png [new file with mode: 0644]
src/ui/controls/FUiCtrl_TokenEditPresenter.cpp

diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg_ef.#.png
deleted file mode 100644 (file)
index 41b3a65..0000000
Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg_ef.#.png and /dev/null differ
diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg_press_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg_press_ef.#.png
deleted file mode 100644 (file)
index 6c2c34e..0000000
Binary files a/res/common/usr/share/osp/bitmaps/480x800/00_contacts_button_bg_press_ef.#.png and /dev/null differ
diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_contacts_button_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_contacts_button_bg_ef.#.png
new file mode 100644 (file)
index 0000000..3321413
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_contacts_button_bg_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/480x800/black/00_contacts_button_bg_press_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/black/00_contacts_button_bg_press_ef.#.png
new file mode 100644 (file)
index 0000000..7770c74
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/black/00_contacts_button_bg_press_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/480x800/default/00_contacts_button_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/default/00_contacts_button_bg_ef.#.png
new file mode 100644 (file)
index 0000000..3321413
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/default/00_contacts_button_bg_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/480x800/default/00_contacts_button_bg_press_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/default/00_contacts_button_bg_press_ef.#.png
new file mode 100644 (file)
index 0000000..7770c74
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/default/00_contacts_button_bg_press_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_contacts_button_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_contacts_button_bg_ef.#.png
new file mode 100644 (file)
index 0000000..3321413
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_contacts_button_bg_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/480x800/white/00_contacts_button_bg_press_ef.#.png b/res/common/usr/share/osp/bitmaps/480x800/white/00_contacts_button_bg_press_ef.#.png
new file mode 100644 (file)
index 0000000..7770c74
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/white/00_contacts_button_bg_press_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg_ef.#.png
deleted file mode 100644 (file)
index 622f16d..0000000
Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg_ef.#.png and /dev/null differ
diff --git a/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg_press_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg_press_ef.#.png
deleted file mode 100644 (file)
index a0e05a6..0000000
Binary files a/res/common/usr/share/osp/bitmaps/720x1280/00_contacts_button_bg_press_ef.#.png and /dev/null differ
diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_contacts_button_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_contacts_button_bg_ef.#.png
new file mode 100644 (file)
index 0000000..b73b634
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_contacts_button_bg_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/720x1280/black/00_contacts_button_bg_press_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/black/00_contacts_button_bg_press_ef.#.png
new file mode 100644 (file)
index 0000000..34fb75c
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/black/00_contacts_button_bg_press_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/720x1280/default/00_contacts_button_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/default/00_contacts_button_bg_ef.#.png
new file mode 100644 (file)
index 0000000..b73b634
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/default/00_contacts_button_bg_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/720x1280/default/00_contacts_button_bg_press_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/default/00_contacts_button_bg_press_ef.#.png
new file mode 100644 (file)
index 0000000..34fb75c
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/default/00_contacts_button_bg_press_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_contacts_button_bg_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_contacts_button_bg_ef.#.png
new file mode 100644 (file)
index 0000000..b73b634
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_contacts_button_bg_ef.#.png differ
diff --git a/res/common/usr/share/osp/bitmaps/720x1280/white/00_contacts_button_bg_press_ef.#.png b/res/common/usr/share/osp/bitmaps/720x1280/white/00_contacts_button_bg_press_ef.#.png
new file mode 100644 (file)
index 0000000..34fb75c
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/720x1280/white/00_contacts_button_bg_press_ef.#.png differ
index 5f148c2..4bbfb17 100755 (executable)
@@ -511,6 +511,7 @@ CATCH:
 void
 _TokenEditPresenter::DrawText(void)
 {
+       bool isCustomBitmap = IS_CUSTOM_BITMAP(TOKENEDIT::BG_NORMAL);
        //Checking IsBlocked() is additional check for handler movement in token edit mode
        if ((__isEditingToken) && (__edittingTokenIndex >= 0))
        {
@@ -546,7 +547,18 @@ _TokenEditPresenter::DrawText(void)
                        {
                                pTokenCanvas->FillRectangle(selectedTokenColor, tokenRect);
                        }
-                       //TODO: Token Effect bitmap draw
+
+                       if (__pTokenBgPressedEffectBitmap && (!isCustomBitmap))
+                       {
+                               if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pTokenBgPressedEffectBitmap))
+                               {
+                                       pTokenCanvas->DrawNinePatchedBitmap(tokenRect, *__pTokenBgPressedEffectBitmap);
+                               }
+                               else
+                               {
+                                       pTokenCanvas->DrawBitmap(tokenRect, *__pTokenBgPressedEffectBitmap);
+                               }
+                       }
 
                        _EditPresenter::DrawText(*pTokenCanvas);
 
@@ -739,7 +751,18 @@ _TokenEditPresenter::DrawToken(int count)
                                pTokenCanvas->FillRectangle(selectedTokenColor, tokenRect);
                        }
 
-                       //TODO: Token Effect bitmap draw
+
+                       if (__pTokenBgPressedEffectBitmap && (!isCustomBitmap))
+                       {
+                               if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pTokenBgPressedEffectBitmap))
+                               {
+                                       pTokenCanvas->DrawNinePatchedBitmap(tokenRect, *__pTokenBgPressedEffectBitmap);
+                               }
+                               else
+                               {
+                                       pTokenCanvas->DrawBitmap(tokenRect, *__pTokenBgPressedEffectBitmap);
+                               }
+                       }
 
                        isSelected = true;
                }
@@ -763,7 +786,18 @@ _TokenEditPresenter::DrawToken(int count)
                                pTokenCanvas->FillRectangle(normalTokenColor, tokenRect);
                        }
 
-                       //TODO: Token Effect bitmap draw
+
+                       if (__pTokenBgNormalEffectBitmap && (!isCustomBitmap))
+                       {
+                               if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pTokenBgNormalEffectBitmap))
+                               {
+                                       pTokenCanvas->DrawNinePatchedBitmap(tokenRect, *__pTokenBgNormalEffectBitmap);
+                               }
+                               else
+                               {
+                                       pTokenCanvas->DrawBitmap(tokenRect, *__pTokenBgNormalEffectBitmap);
+                               }
+                       }
                }
 
                pTokenElement->SetAnimationProvider(null);
@@ -2091,6 +2125,9 @@ _TokenEditPresenter::ProcessTokeningByTouchEvent(const _Control& source, const _
                        __edittingTokenIndex = -1;
                        __isTokenEditingFinished = true;
                        __isEditingToken = false;
+                       //Flex height adjusted since token can move to another line
+                       AdjustFlexibleHeight();
+
                        SetCursorDisabled(true);
                }
                else
@@ -2206,6 +2243,9 @@ _TokenEditPresenter::ProcessTokeningByTouchEvent(const _Control& source, const _
 
                        ClearText();
 
+                       //Flex height adjusted since token can move to another line
+                       AdjustFlexibleHeight();
+
                        SysTryReturnResult(NID_UI_CTRL, (inputTokenString.GetLength() > 0), E_INVALID_ARG, "Invalid argument is used. Token length is (%d)", inputTokenString.GetLength());
 
                        DrawText();
@@ -2555,6 +2595,10 @@ bool
 _TokenEditPresenter::OnFocusLost(void)
 {
        result r = E_SUCCESS;
+
+       //Remove pressed state on focus lost
+       __pressedTokenIndex = -1;
+
        __isFocus = false;
 
        _EditPresenter::StopTitleSlidingTimer();