float _EditPresenter::__initialParentHeight = 0.0f;
float _EditPresenter::__clipboardHeight = 0.0f;
bool _EditPresenter::__isPanelBoundsChanging = false;
+_EditFooterVisibleStatus _EditPresenter::__initialFooterVisibleStatus = EDIT_FOOTER_VISIBLE_STATUS_NONE;
_EditAnimationProvider::_EditAnimationProvider(void)
{
, __isTextBlocked(false)
, __isGuideTextColorChanged(false)
, __isKeypadCommandButtonVisible(false)
- , __isKeypadHiding(false)
, __isTextComposing(false)
, __isCopyPasteManagerExist(false)
, __isCursorChanged(false)
, __rotated(false)
, __isCutLinkParserEnabled(false)
, __echoChar('*')
- , __footerVisibleStatus(EDIT_FOOTER_VISIBLE_STATUS_NONE)
, __ContentTextStatus(EDIT_TEXT_STATUS_COMPOSE_NON)
, __pEditVEDelegator(null)
, __isAutoShrinkEnabled(false)
void
_EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source, InputPanelShowState showState)
{
- if (showState == INPUT_PANEL_SHOW_STATE_SHOW)// 1. bounded 2.bounded&rotate
+ if (showState == INPUT_PANEL_SHOW_STATE_SHOW)// 1. keypad show 2.usb on&predictive window show
{
__isKeypadShowing = false;
__isKeypadExist = true;
if (__isInputConnectionBound)
{
- if (__isKeypadCommandButtonVisible && !__isUSBKeyboardConnected)
+ if (__isKeypadCommandButtonVisible)
{
SetFooterVisible(false);
}
}
}
- if (__isUSBKeyboardConnected && !__isKeypadCommandButtonVisible)
+ if (__isUSBKeyboardConnected)
{
- __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CREATED);
+ __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
+ }
+ else
+ {
+ __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
+ __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
}
-
- __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
- __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
if (!__pEdit->IsFullScreenKeypadEdit())
{
__isTextBlocked = false;
}
- if (__isInputConnectionBound && __isUSBKeyboardConnected) // hide callback from external condition(usb mode off->on)
+ if (__isInputConnectionBound && __isUSBKeyboardConnected) // hide callback from external condition(usb mode off->on), focus remaining
{
- AdjustParentPanelHeight(true);
-
if (!__pEdit->IsFullScreenKeypadEdit())
{
if (__pParentForm)
__pParentForm->SetKeypadShowState(false);
}
}
+
+ ChangeLayoutInternal(__pEdit->GetOrientation());
+ AdjustParentPanelHeight(true);
}
else
{
__isTextComposing = false;
__composingTextLength = 0;
}
+
+ ChangeLayoutInternal(__pEdit->GetOrientation());
+ AdjustParentPanelHeight(true);
}
else// called by focus move or HideKeypad() api call
{
SetKeypadClosedEventSkipped(true);//it will adjust only fullscreen keypad edit.
- }
-
- AdjustParentPanelHeight(true);
- __isInputConnectionBound = false;
+ if (__pCommandButton && __isKeypadCommandButtonVisible)
+ {
+ SetFooterVisible(true);// must be called ahead of DeflateClientRectHeight
+ __pCommandButton->SetVisibleState(false);
+ __pCommandButton->Invalidate();
+ }
- __pEdit->DetachScrollPanelEvent();
- }
+ __pEdit->DetachScrollPanelEvent();
+ __isInputConnectionBound = false;
- if (__pCommandButton && __pCommandButton->GetVisibleState() == true)
- {
- SetFooterVisible(true);// must be called ahead of DeflateClientRectHeight
- __pCommandButton->SetVisibleState(false);
- __pCommandButton->Invalidate();
- }
+ AdjustParentPanelHeight(true);
- if (__pParentForm)
- {
- __pParentForm->DeflateClientRectHeight(0.0f);
+ if (__pParentForm)
+ {
+ __pParentForm->DeflateClientRectHeight(0.0f);
+ }
+ }
}
- __isKeypadHiding = false;
-
- SetKeypadBounds(FloatRectangle());
-
if (!__isKeypadClosedEventSkipped)
{
- __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CLOSE);
- __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_CLOSED);
+ 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())
}
else
{
+ __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CREATED);
+
ChangeLayoutInternal(__pEdit->GetOrientation());
AdjustParentPanelHeight(false);
__pParentForm->Draw();
}
- __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CREATED);
__pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
}
}
if (__clipboardConnected)
{
+ if (__pClipboard)
+ {
+ __pClipboard->HidePopup();
+ }
+
__isClipboardExist = false;
FloatRectangle absKeypadBounds;
GetKeypadBounds(absKeypadBounds);
ReplaceTextIntoPasswordHyphenString();
+ if (__isClipboardExist)
+ {
+ if (__pClipboard)
+ {
+ __pClipboard->HidePopup();
+ }
+ }
+
if (__isInputConnectionBound)
{
__isTouchReleaseSkipped = false;
__isUSBKeyboardConnected = false;
- if (__isClipboardExist)
- {
- if (__pClipboard)
- {
- __pClipboard->HidePopup();
- }
- }
-
HideKeypad();
}
}
void
-_EditPresenter::CheckFooterVisible(void)
+_EditPresenter::CheckInitialFooterVisibleState(void)
{
if (__pParentForm == null)
{
{
if (pFooter->GetVisibleState() == false)
{
- __footerVisibleStatus = EDIT_FOOTER_VISIBLE_STATUS_HIDE;
+ __initialFooterVisibleStatus = EDIT_FOOTER_VISIBLE_STATUS_HIDE;
}
else
{
- __footerVisibleStatus = EDIT_FOOTER_VISIBLE_STATUS_SHOW;
+ __initialFooterVisibleStatus = EDIT_FOOTER_VISIBLE_STATUS_SHOW;
}
}
else
{
- __footerVisibleStatus = EDIT_FOOTER_VISIBLE_STATUS_NONE;
+ __initialFooterVisibleStatus = EDIT_FOOTER_VISIBLE_STATUS_NONE;
}
return;
}
_Toolbar* pFooter = __pParentForm->GetFooter();
- if (pFooter && __footerVisibleStatus == EDIT_FOOTER_VISIBLE_STATUS_SHOW)
+ if (pFooter && __initialFooterVisibleStatus == EDIT_FOOTER_VISIBLE_STATUS_SHOW)
{
if ((isVisible == true && pFooter->GetVisibleState() == false) ||
(isVisible == false && pFooter->GetVisibleState() == true))
{
pFooter->SetVisibleState(isVisible);
pFooter->Invalidate();
+
+ if (isVisible)
+ {
+ __initialFooterVisibleStatus = EDIT_FOOTER_VISIBLE_STATUS_NONE;
+ }
}
}
result
_EditPresenter::ShowKeypad(bool focus)
{
- //SysTryReturnResult(NID_UI_CTRL, IsKeypadEnabled() == true, E_INVALID_STATE, "[EDIT] Keypad is not enabled.");
-
if (focus)
{
__pEdit->SetFocused();
SetCurrentLanguage(initialKeypadLanguage);
}
- if (!__isUSBKeyboardConnected && IsKeypadEnabled())
+ //layout rearrange
+ if (IsKeypadEnabled())
{
- __pInputConnection->ShowInputPanel();
-
- if (!__isKeypadExist)
+ if (__isUSBKeyboardConnected)
{
- __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CREATED);
- }
+ if (__initialFooterVisibleStatus == EDIT_FOOTER_VISIBLE_STATUS_NONE)
+ {
+ CheckInitialFooterVisibleState();
+ }
+
+ if (__isKeypadCommandButtonVisible)
+ {
+ __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CREATED);
+ __pEdit->AttachScrollPanelEvent();
+ __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_CREATED);
- CheckFooterVisible();
+ SetFooterVisible(false);
+ ChangeLayoutInternal(__pEdit->GetOrientation());
+ AdjustParentPanelHeight(false);
- if (__isKeypadCommandButtonVisible)
- {
- SetFooterVisible(false);
+ __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
+ __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
+ }
}
-
- if (__isKeypadExist)
+ else
{
- ChangeLayoutInternal(__pEdit->GetOrientation());
- AdjustParentPanelHeight(false);
+ __pInputConnection->ShowInputPanel();
+
+ if (!__isKeypadExist)
+ {
+ __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CREATED);
+ __pEdit->AttachScrollPanelEvent();
+ __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_CREATED);
+
+ CheckInitialFooterVisibleState();
+ }
+
+ if (__isKeypadCommandButtonVisible)
+ {
+ SetFooterVisible(false);
+ }
+
+ if (__isKeypadExist)
+ {
+ ChangeLayoutInternal(__pEdit->GetOrientation(), false);
+ //AdjustParentPanelHeight(false);
+ }
}
}
- __pEdit->AttachScrollPanelEvent();
- __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_CREATED);
+ ScrollPanelToExposedRegion(true);
+ ScrollPanelToCursorPosition();
return E_SUCCESS;
}
ChangeLayoutInternal(orientation);
AdjustParentPanelHeight(false);
}
+ else
+ {
+ if (__isKeypadCommandButtonVisible)
+ {
+ __initialParentHeight = 0.0f;
+ ChangeLayoutInternal(orientation);
+ AdjustParentPanelHeight(false);
+ }
+ }
}
if ((__pEdit->GetEditStyle() & EDIT_STYLE_FLEXIBLE) == false)
}
result
-_EditPresenter::ChangeLayoutInternal(_ControlOrientation orientation)
+_EditPresenter::ChangeLayoutInternal(_ControlOrientation orientation, bool deflateForm)
{
result r = E_SUCCESS;
}
}
- if (__isKeypadCommandButtonVisible && !__isUSBKeyboardConnected)
+ if (__isKeypadCommandButtonVisible)
{
if (__isClipboardExist)
{
}
}
- if (__pParentForm)
+ if (__pParentForm && deflateForm)
{
SysLog(NID_UI_CTRL, "ChangeLayoutInternal: formDeflateHeight:%f, KeypadExist(%d), ClipboardExist(%d), CommandButtonVisible(%d)",
formDeflateHeight, __isKeypadExist, __isClipboardExist, __isKeypadCommandButtonVisible);
void
_EditPresenter::OnScrollPanelBoundsChanged(void)
{
- /*
- if (__pParentPanel && __isPanelBoundsChanging == false)
- {
- __initialParentHeight = __pParentPanel->GetBounds().height;
- if (__pParentPanel->GetOrientation() == __pEdit->GetOrientation())
- {
- AdjustParentPanelHeight(false);
- ScrollPanelToExposedRegion(false);
- ScrollPanelToCursorPosition();
- }
- }*/
-
return;
}
return E_SUCCESS;
}
- if (__isInputConnectionBound)
+ if (__isUSBKeyboardConnected)
{
- __pInputConnection->FinishTextComposition();
- __pInputConnection->HideInputPanel();
- __pInputConnection->UnbindInputMethod();
- __isKeypadHiding = true;
- __isTextComposing = false;
- __composingTextLength = 0;
- }
+ SetFooterVisible(true);
+ if (__pCommandButton && __isKeypadCommandButtonVisible)
+ {
+ __pCommandButton->SetVisibleState(false);
- if (__pCommandButton && __pCommandButton->GetVisibleState() == true)
- {
- SetFooterVisible(true);//must be called ahead of DeflateClientRectHeights
- __pCommandButton->SetVisibleState(false);
- }
+ if (__pParentForm)
+ {
+ __pParentForm->DeflateClientRectHeight(0.0f);
+ }
- if (__isKeypadExist)
+ AdjustParentPanelHeight(true);
+
+ __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CLOSE);
+ }
+ }
+ else
{
- if (__pParentForm)
+ if (__pCommandButton && __pCommandButton->GetVisibleState() == true)
{
- __pParentForm->DeflateClientRectHeight(0.0f);
+ if (!__isKeypadExist)
+ {
+ SetFooterVisible(true);//must be called ahead of DeflateClientRectHeights
+ if (__pParentForm)
+ {
+ __pParentForm->DeflateClientRectHeight(0.0f);
+ }
+ }
+ __pCommandButton->SetVisibleState(false);
}
-
- AdjustParentPanelHeight(true);
}
+ __pInputConnection->FinishTextComposition();
+ __pInputConnection->HideInputPanel();
+ __pInputConnection->UnbindInputMethod();
+ __isTextComposing = false;
+ __composingTextLength = 0;
+
__isInputConnectionBound = false;
if (focus && IsInternalFocused())