Fix for keypad issue
authorhyun lee <hyunn.lee@samsung.com>
Tue, 10 Sep 2013 02:08:55 +0000 (11:08 +0900)
committerhyun lee <hyunn.lee@samsung.com>
Tue, 10 Sep 2013 02:11:46 +0000 (11:11 +0900)
Change-Id: I132de87d785aba22c9761e812985658bd50a56e5
Signed-off-by: hyun lee <hyunn.lee@samsung.com>
src/controls/FWebCtrl_WebImpl.cpp

index b8377c6..11560bf 100755 (executable)
@@ -1310,6 +1310,13 @@ OnLoadingCompleted(void* pUserData, Evas_Object* pView, void* pEventInfo)
 
 
 void
+OnLoadingCommitted(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+       evas_object_focus_set(pView, EINA_FALSE);
+}
+
+
+void
 OnFaviconReceived(void* pUserData, Evas_Object* pView, void* pEventInfo)
 {
        _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
@@ -1640,12 +1647,6 @@ OnWebKeypadStateChanged(void* pUserData, Evas_Object* pView, void* pEventInfo)
                if (pFormImpl)
                {
                        pFormImpl->DeflateClientRectHeight(pXformer->TransformVertical(rect.height));
-
-                       if (pFormImpl->HasFooter())
-                       {
-                               pFormImpl->GetCore().SetKeypadShowState(true);
-                               pFormImpl->Draw();
-                       }                       
                }
 
                if (pImpl->GetWebKeypadEventListener())
@@ -1680,6 +1681,21 @@ OnWebKeypadOpened(void* pUserData, Evas_Object* pView, void* pEventInfo)
 
        pImpl->SetKeypadVisibleState(true);
 
+       _FormImpl* pFormImpl = pImpl->GetParentFormImpl(dynamic_cast< _ControlImpl* >(pImpl));
+       if (pFormImpl)
+       {
+               _ICoordinateSystemTransformer* pXformer = _CoordinateSystem::GetInstance()->GetInverseTransformer();
+               SysAssertf(pXformer, "Failed to get CoordinateTransformer");
+
+               pFormImpl->DeflateClientRectHeight(pXformer->TransformVertical(pImpl->GetPreviousKeypadBounds().height));
+
+               if (pFormImpl->HasFooter())
+               {
+                       pFormImpl->GetCore().SetKeypadShowState(true);
+                       pFormImpl->Draw();
+               }
+       }
+
        if (pImpl->GetWebKeypadEventListener())
        {
                pImpl->GetWebKeypadEventListener()->OnWebKeypadOpened(*static_cast< Web* >(&pImpl->GetPublic()));
@@ -3545,6 +3561,7 @@ _WebImpl::SetEventListenerCallback(void) const
                evas_object_smart_callback_add(pWebNativeNode, "load,stop", OnLoadingCanceled, this);
                evas_object_smart_callback_add(pWebNativeNode, "load,error", OnLoadingErrorOccurred, this);
                evas_object_smart_callback_add(pWebNativeNode, "title,changed", OnPageTitleReceived, this);
+               evas_object_smart_callback_add(pWebNativeNode, "load,committed", OnLoadingCommitted, this);
 
                evas_object_smart_callback_add(pWebNativeNode, "requestToNative,json", OnHandleJavaScriptRequest, this);
 
@@ -3633,6 +3650,7 @@ _WebImpl::RemoveEventListenerCallback(void) const
                evas_object_smart_callback_del(pWebNativeNode, "load,stop", OnLoadingCanceled);
                evas_object_smart_callback_del(pWebNativeNode, "load,error", OnLoadingErrorOccurred);
                evas_object_smart_callback_del(pWebNativeNode, "title,changed", OnPageTitleReceived);
+               evas_object_smart_callback_del(pWebNativeNode, "load,committed", OnLoadingCommitted);
 
                evas_object_smart_callback_del(pWebNativeNode, "requestToNative,json", OnHandleJavaScriptRequest);