Fix display error in Edit
authorTaejun <tj.twt.park@samsung.com>
Wed, 3 Apr 2013 01:26:25 +0000 (10:26 +0900)
committerTaejun <tj.twt.park@samsung.com>
Wed, 3 Apr 2013 01:26:25 +0000 (10:26 +0900)
Change-Id: Ifb1ca37da3a55bba22c666a79e4c2dab3821183a

src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp
src/ui/controls/FUiCtrl_EditPresenter.cpp
src/ui/controls/FUiCtrl_Keypad.cpp
src/ui/inc/FUiCtrl_EditPresenter.h
src/ui/resource/FUi_ResourceEditConfig.cpp

index 0a966c4..0c32f1c 100755 (executable)
@@ -2079,7 +2079,6 @@ _EditCopyPasteManager::OnActionPerformed(const _Control& source, int actionId)
 
        case COPY_PASTE_CLIPBOARD_ID:
                __needToReleaseBlock = false;
-               pEditPresenter->SetKeypadClosedEventSkipped(true);
                pClipBoard->ShowPopup(CLIPBOARD_DATA_TYPE_TEXT, *__pEdit);
                SendCopyPasteEvent(CORE_COPY_PASTE_STATUS_HIDE, CORE_COPY_PASTE_ACTION_CLIPBOARD);
                break;
index 04e3332..869bd91 100755 (executable)
@@ -218,7 +218,6 @@ _EditPresenter::_EditPresenter(void)
        , __contentTextStyle(TEXT_BOX_TEXT_STYLE_NORMAL)
        , __titleFontFaceName("")
        , __isSearchBar(false)
-       , __isKeypadClosedEventSkipped(false)
        , __pCurrentFrame(null)
        , __pTextFilter(null)
        , __textBlockMoveLeft(false)
@@ -236,6 +235,8 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
                __isKeypadShowing = false;
                __isKeypadExist = true;
 
+               SysLog(NID_UI_CTRL, "[EDIT] INPUT_PANEL_SHOW_STATE_SHOW");
+
                CheckUSBKeyboardStatus();
 
                if (__isInputConnectionBound)
@@ -258,16 +259,6 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
                        }
                }
 
-               if (__isUSBKeyboardConnected)
-               {
-                       __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
-               }
-               else
-               {
-                       __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
-                       __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
-               }
-
                if (!__pEdit->IsFullScreenKeypadEdit())
                {
                        if (__pParentForm)
@@ -276,12 +267,25 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
                                {
                                        __pParentForm->SetKeypadShowState(true);
                                }
+                               SysLog(NID_UI_CTRL, "[EDIT] INPUT_PANEL_SHOW_STATE_SHOW - Draw Form");
                                __pParentForm->Draw();
                        }
                }
+
+               if (__isUSBKeyboardConnected && __isKeypadCommandButtonVisible)
+               {
+                       __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
+               }
+               else
+               {
+                       __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
+                       __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
+               }
        }
        else if (showState == INPUT_PANEL_SHOW_STATE_HIDE)// 1.unbound  2.bounded&usb off -> usb on 3.Flick keypad hide
        {
+               SysLog(NID_UI_CTRL, "[EDIT] INPUT_PANEL_SHOW_STATE_HIDE");
+
                CheckUSBKeyboardStatus();
 
                __isKeypadExist = false;
@@ -322,8 +326,6 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
                        }
                        else// called by focus move or HideKeypad() api call
                        {
-                               SetKeypadClosedEventSkipped(true);//it will adjust only fullscreen keypad edit.
-
                                if (__pCommandButton && __isKeypadCommandButtonVisible)
                                {
                                        SetFooterVisible(true);// must be called ahead of DeflateClientRectHeight
@@ -343,21 +345,6 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
                        }
                }
 
-               if (!__isKeypadClosedEventSkipped)
-               {
-                       if (__isUSBKeyboardConnected)
-                       {
-                               __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
-                       }
-                       else
-                       {
-                               __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CLOSE);
-                               __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_CLOSED);
-                       }
-               }
-
-               __isKeypadClosedEventSkipped = false;
-
                if (!__pEdit->IsFullScreenKeypadEdit())
                {
                        if (__pParentForm)
@@ -366,9 +353,20 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
                                {
                                        __pParentForm->SetKeypadShowState(false);
                                }
+                               SysLog(NID_UI_CTRL, "[EDIT] INPUT_PANEL_SHOW_STATE_HIDE - Draw Form");
                                __pParentForm->Draw();
                        }
                }
+
+               if (__isUSBKeyboardConnected && __isKeypadCommandButtonVisible)
+               {
+                       __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
+               }
+               else
+               {
+                       __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CLOSE);
+                       __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_CLOSED);
+               }
        }
 
        return;
@@ -391,17 +389,22 @@ _EditPresenter::OnInputConnectionPanelBoundsChanged(InputConnection& source, con
 {
        CheckUSBKeyboardStatus();
 
-       if ((__isUSBKeyboardConnected == false) && (__isKeypadExist == false))
+       if ((__isUSBKeyboardConnected == false) && ((__isKeypadExist == false) || (__isKeypadShowing == true)))
        {
+               SysLog(NID_UI_CTRL, "[EDIT] OnInputConnectionPanelBoundsChanged skipped!!!!!!");
                return;
        }
 
+       SysLog(NID_UI_CTRL, "[EDIT] OnInputConnectionPanelBoundsChanged");
        ChangeLayoutInternal(__pEdit->GetOrientation());
        AdjustParentPanelHeight(false, true);
+
        if (__pParentForm)
        {
-               __pParentForm->Draw();
+               ScrollPanelToExposedRegion(true);
                ScrollPanelToCursorPosition();
+               __pParentForm->Draw();
+               SysLog(NID_UI_CTRL, "[EDIT] OnInputConnectionPanelBoundsChanged - Draw Form");
        }
 
        __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
@@ -762,7 +765,7 @@ _EditPresenter::OnClipboardPopupOpened(Tizen::Graphics::Dimension& clipboardPopu
 {
        FloatDimension floatClipboardPopupSize = _CoordinateSystemUtils::ConvertToFloat(clipboardPopupSize);
 
-       SysLog(NID_UI_CTRL, "clipboard opended!: EditPresent(%x), clipboard connected(%d)", this, __clipboardConnected);
+       SysLog(NID_UI_CTRL, "[EDIT] clipboard opended!: EditPresent(%x), clipboard connected(%d)", this, __clipboardConnected);
 
        if (__clipboardConnected)
        {
@@ -773,7 +776,7 @@ _EditPresenter::OnClipboardPopupOpened(Tizen::Graphics::Dimension& clipboardPopu
 
                __clipboardHeight = floatClipboardPopupSize.height;
 
-               SysLog(NID_UI_CTRL, "clipboard height = %f, keypad height = %f", floatClipboardPopupSize.height, absKeypadBounds.height);
+               SysLog(NID_UI_CTRL, "[EDIT] clipboard height = %f, keypad height = %f", floatClipboardPopupSize.height, absKeypadBounds.height);
 
                if (__isKeypadExist) //resize as difference between clipboard height vs keypad height
                {
@@ -818,7 +821,7 @@ _EditPresenter::OnClipboardPopupBoundsChanged(Tizen::Graphics::Dimension& clipbo
 {
        FloatDimension floatClipboardPopupSize = _CoordinateSystemUtils::ConvertToFloat(clipboardPopupSize);
 
-       SysLog(NID_UI_CTRL, "clipboard rotated!: EditPresent(%x), clipboard connected(%d)", this, __clipboardConnected);
+       SysLog(NID_UI_CTRL, "[EDIT] clipboard rotated!: EditPresent(%x), clipboard connected(%d)", this, __clipboardConnected);
 
        if (__clipboardConnected)
        {
@@ -828,7 +831,7 @@ _EditPresenter::OnClipboardPopupBoundsChanged(Tizen::Graphics::Dimension& clipbo
 
                __clipboardHeight = floatClipboardPopupSize.height;
 
-               SysLog(NID_UI_CTRL, "clipboard height = %f, keypad height = %f", floatClipboardPopupSize.height, absKeypadBounds.height);
+               SysLog(NID_UI_CTRL, "[EDIT] clipboard height = %f, keypad height = %f", floatClipboardPopupSize.height, absKeypadBounds.height);
 
                if (__isKeypadExist)
                {
@@ -839,6 +842,7 @@ _EditPresenter::OnClipboardPopupBoundsChanged(Tizen::Graphics::Dimension& clipbo
                                if (__pParentForm)
                                {
                                        __pParentForm->Draw();
+                                       ScrollPanelToExposedRegion(true);
                                        ScrollPanelToCursorPosition();
                                }
 
@@ -852,6 +856,7 @@ _EditPresenter::OnClipboardPopupBoundsChanged(Tizen::Graphics::Dimension& clipbo
                        if (__pParentForm)
                        {
                                __pParentForm->Draw();
+                               ScrollPanelToExposedRegion(true);
                                ScrollPanelToCursorPosition();
                        }
 
@@ -865,7 +870,7 @@ _EditPresenter::OnClipboardPopupBoundsChanged(Tizen::Graphics::Dimension& clipbo
 void
 _EditPresenter::OnClipboardPopupClosed(void)
 {
-       SysLog(NID_UI_CTRL, "clipboard closed!: EditPresent(%x), clipboard connected(%d)", this, __clipboardConnected);
+       SysLog(NID_UI_CTRL, "[EDIT] clipboard closed!: EditPresent(%x), clipboard connected(%d)", this, __clipboardConnected);
 
        if (__clipboardConnected)
        {
@@ -881,13 +886,19 @@ _EditPresenter::OnClipboardPopupClosed(void)
 
                __clipboardHeight = 0.0f;
 
-               SysLog(NID_UI_CTRL, "clipboard closed!keypad height = %f", absKeypadBounds.height);
+               SysLog(NID_UI_CTRL, "[EDIT] clipboard closed! keypad height = %f", absKeypadBounds.height);
 
                ChangeLayoutInternal(__pEdit->GetOrientation());
 
                if (__isKeypadExist)
                {
                        AdjustParentPanelHeight(false, true);
+
+                       if (__pParentForm)
+                       {
+                               __pParentForm->Draw();
+                       }
+
                        __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
                }
                else
@@ -923,7 +934,7 @@ _EditPresenter::Dispose(void)
                __pCurrentFrame = null;
        }
 
-       if (__pCommandButton && __pCommandButton->GetVisibleState() == true)
+       if (__pCommandButton && __isKeypadCommandButtonVisible)
        {
                __pCommandButton->SetVisibleState(false);
                if (__isKeypadCommandButtonVisible  && !__isUSBKeyboardConnected)
@@ -935,14 +946,36 @@ _EditPresenter::Dispose(void)
                __pCommandButton = null;
        }
 
-       if (__pParentForm)
+       if (__isInputConnectionBound)
        {
-               __pParentForm->DeflateClientRectHeight(0.0f);
-       }
+               if (__pParentForm)
+               {
+                       __pParentForm->DeflateClientRectHeight(0.0f);
+                       __pParentForm->SetKeypadShowState(false);
 
-       if (__pEdit && !__pEdit->IsDestroyed())//skip when force deleted
-       {
-               AdjustParentPanelHeight(true);
+                       if (__pParentForm->GetFooter())
+                       {
+                               if (__pParentForm->GetFooter()->GetButton(BACK_BUTTON))
+                               {
+                                       __pParentForm->GetFooter()->Invalidate(true);
+                               }
+                       }
+
+                       if (__pParentForm->GetHeader())
+                       {
+                               if (__pParentForm->GetHeader()->GetButton(BACK_BUTTON))
+                               {
+                                       __pParentForm->GetHeader()->Invalidate(true);
+                               }
+                       }
+               }
+
+               if (__pEdit && !__pEdit->IsDestroyed())//restore ScrollPanel when force deleted
+               {
+                       AdjustParentPanelHeight(true);
+               }
+
+               __isKeypadExist = false;
        }
 
        if (__clipboardConnected)
@@ -1350,13 +1383,6 @@ _EditPresenter::DrawChangeableBackground(Canvas& canvas, bool focused, int bitma
        {
                pEditBgEffectBitmap = __pEdit->GetDefaultBackgroundEffectBitmap();
 
-               if (borderRoundEnable)
-               {
-                       pEditBgEffectBitmap = null;
-                       r = GET_BITMAP_CONFIG_N(EDIT::BG_ROUND_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, pEditBgEffectBitmap);
-                       SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap");
-               }
-
                if (pEditBgEffectBitmap)
                {
                        if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pEditBgEffectBitmap))
@@ -6102,6 +6128,36 @@ _EditPresenter::GetKeypadBounds(FloatRectangle& bounds) const
        return E_SUCCESS;
 }
 
+bool
+_EditPresenter::CheckKeypadExist(void)
+{
+       FloatDimension screenSize;
+       FloatRectangle absKeypadBounds(0.0f, 0.0f, 0.0f, 0.0f);
+       _ControlManager* pControlManager = _ControlManager::GetInstance();
+
+       GetKeypadBounds(absKeypadBounds);
+       SysLog(NID_UI_CTRL, "[EDIT] CheckKeypadExist:absKeypadBounds(%f, %f, %f, %f)", absKeypadBounds.x, absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
+       _ControlOrientation orientation = __pEdit->GetOrientation();
+
+       if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+       {
+               screenSize.height = pControlManager->GetScreenSizeF().height;
+       }
+       else
+       {
+               screenSize.height = pControlManager->GetScreenSizeF().width;
+       }
+
+       if (absKeypadBounds.y != screenSize.height)
+       {
+               return true;
+       }
+       else
+       {
+               return false;
+       }
+}
+
 result
 _EditPresenter::ShowKeypad(bool focus)
 {
@@ -6180,9 +6236,14 @@ _EditPresenter::ShowKeypad(bool focus)
                                __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
                                __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
                        }
+
+                       ScrollPanelToExposedRegion(true);
+                       ScrollPanelToCursorPosition();
                }
                else
                {
+                       __isKeypadExist = CheckKeypadExist(); //call once only from here.
+
                        __pInputConnection->ShowInputPanel();
 
                        if (!__isKeypadExist)
@@ -6201,15 +6262,24 @@ _EditPresenter::ShowKeypad(bool focus)
 
                        if (__isKeypadExist)
                        {
-                               ChangeLayoutInternal(__pEdit->GetOrientation(), false);
-                               //AdjustParentPanelHeight(false);
+                               ChangeLayoutInternal(__pEdit->GetOrientation());
+                               //ChangeLayoutInternal(__pEdit->GetOrientation(), false);
+                               ScrollPanelToExposedRegion(true);
+                               ScrollPanelToCursorPosition();
+                               if (__pParentForm)
+                               {
+                                       __pParentForm->SetKeypadShowState(true);//First show keypad after dispose
+                                       __pParentForm->Draw();
+                               }
+                       }
+                       else
+                       {
+                               ScrollPanelToExposedRegion(true);
+                               ScrollPanelToCursorPosition();
                        }
                }
        }
 
-       ScrollPanelToExposedRegion(true);
-       ScrollPanelToCursorPosition();
-
        return E_SUCCESS;
 }
 
@@ -6234,7 +6304,7 @@ _EditPresenter::ChangeLayout(_ControlOrientation orientation)
                        __pParentForm->DeflateClientRectHeight(0.0f);
                }
 
-               if (__pCommandButton && __pCommandButton->GetVisibleState())
+               if (__pCommandButton && __isKeypadCommandButtonVisible)
                {
                        __pCommandButton->SetVisibleState(false);
                }
@@ -6585,7 +6655,7 @@ _EditPresenter::HideKeypad(bool focus)
        }
        else
        {
-               if (__pCommandButton && __pCommandButton->GetVisibleState() == true)
+               if (__pCommandButton && __isKeypadCommandButtonVisible)
                {
                        if (!__isKeypadExist)
                        {
@@ -9443,17 +9513,6 @@ _EditPresenter::SetEditGroupStyle(GroupStyle groupStyle)
 }
 
 void
-_EditPresenter::SetKeypadClosedEventSkipped(bool enabled)
-{
-       if (__pEdit->IsFullScreenKeypadEdit())
-       {
-               __isKeypadClosedEventSkipped = enabled;
-       }
-
-       return;
-}
-
-void
 _EditPresenter::PostInternalEvent(const Tizen::Base::String& type)
 {
        ClearLastResult();
index 30dd05f..17c71ae 100644 (file)
@@ -482,13 +482,11 @@ _Keypad::ChangeLayoutInternal(void)
                if (!__isPredictionWindowOpendInUSBMode)
                {
                        __pFooter->SetHideButton(true);
-                       __pFooter->Invalidate(true);
                }
        }
        else
        {
                __pFooter->SetHideButton(false);
-               __pFooter->Invalidate(true);
        }
 
        r = __pChildEdit->SetBounds(editRect);
@@ -508,6 +506,8 @@ _Keypad::ChangeLayoutInternal(void)
        __pFooter->SetResizable(false);
        __pFooter->SetMovable(false);
 
+       Invalidate(true);
+
        return r;
 }
 
index 30e8a12..48f6d9c 100644 (file)
@@ -224,6 +224,7 @@ public:
        CoreKeypadAction GetKeypadAction(void) const;
        result GetKeypadBounds(Tizen::Graphics::Rectangle& bounds) const;
        result GetKeypadBounds(Tizen::Graphics::FloatRectangle& bounds) const;
+       bool CheckKeypadExist(void);
        KeypadStyle GetKeypadStyle(void) const;
        int GetTextLimitLength(void) const;
        int GetMaxLineCount(void) const;
@@ -309,7 +310,6 @@ public:
        void ScrollPanelToCursorPosition(bool show = true);
        void SetSearchBarFlag(bool enabled);
        bool GetSearchBarFlag(void) const;
-       void SetKeypadClosedEventSkipped(bool skipped);
        void PostInternalEvent(const Tizen::Base::String& type);
        void ReleaseCopyPastePopup(void);
        bool IsCopyPastePopupExist(void) const;
@@ -564,7 +564,6 @@ private:
        unsigned long __contentTextStyle;
        Tizen::Base::String __titleFontFaceName;
        bool __isSearchBar;
-       bool __isKeypadClosedEventSkipped;
        _Frame* __pCurrentFrame;
        _IEditTextFilter* __pTextFilter;
        bool __textBlockMoveLeft;
index 3a9ddc9..13a9f52 100755 (executable)
@@ -57,7 +57,6 @@ START_UI_CONFIG(EDIT);
        ADD_IMAGE_CONFIG(COPY_PASTE_ICON_REVERSE_RIGHT_PRESSED, #copy&paste_Icon_right_press_reverse.png);
        ADD_IMAGE_CONFIG(COPY_PASTE_SEARCH_ICON, #copy&paste_icon_search.png);
        ADD_IMAGE_CONFIG(BG_ROUND_NORMAL, #00_edit_field_round_bg.#.png);
-       ADD_IMAGE_CONFIG(BG_ROUND_EFFECT, #00_edit_field_line_round_bg_01.#.png);
        ADD_IMAGE_CONFIG(CLEAR_ICON_NORMAL, #00_edit_field_clear.png);
        ADD_IMAGE_CONFIG(CLEAR_ICON_PRESSED, #00_edit_field_clear.png);