From: Kunal Sinha Date: Mon, 8 Apr 2013 15:04:23 +0000 (+0530) Subject: Token Effect Bitmap draw X-Git-Tag: accepted/tizen_2.1/20130425.033138~338^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae5b5ad69b6e6172db5ec6215ee03f6b7801634d;p=platform%2Fframework%2Fnative%2Fuifw.git Token Effect Bitmap draw Change-Id: I383b9a6f22ee7ef9edb4725fed3b334bcce32618 Signed-off-by: Kunal Sinha --- 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 diff --git a/src/ui/controls/FUiCtrl_TokenEditPresenter.cpp b/src/ui/controls/FUiCtrl_TokenEditPresenter.cpp index 5f148c2..4bbfb17 100755 --- a/src/ui/controls/FUiCtrl_TokenEditPresenter.cpp +++ b/src/ui/controls/FUiCtrl_TokenEditPresenter.cpp @@ -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();