From 630b6b81ef08d8d637f22d4298ecbfd33981102d Mon Sep 17 00:00:00 2001 From: Vinay Sachdeva Date: Sat, 6 Apr 2013 22:20:37 +0530 Subject: [PATCH] Fixed Nabi Issues Change-Id: I68a30428d3dda40bca11f69c9047aafc644dcbff Signed-off-by: Vinay Sachdeva --- inc/IntAddressbar.h | 1 + inc/IntHistoryListForm.h | 1 + inc/IntIAddressbarEventListener.h | 2 + inc/IntMainForm.h | 5 + .../00_button_sweep_delete.9.png | Bin 0 -> 980 bytes .../00_button_sweep_delete_press.9.png | Bin 0 -> 762 bytes res/screen-size-normal/IDL_ADDRESSBAR.xml | 17 +- res/screen-size-normal/IDL_FORM.xml | 14 +- src/IntAddBookmarkForm.cpp | 12 +- src/IntAddressbar.cpp | 53 ++- src/IntBookmarkData.cpp | 2 + src/IntBookmarkListForm.cpp | 35 +- src/IntBookmarkPresentationModel.cpp | 2 +- src/IntCreateBookmarkFolderForm.cpp | 8 +- src/IntDropDownCustomItem.cpp | 2 +- src/IntEditBookmarkListForm.cpp | 4 +- src/IntEditHistoryListForm.cpp | 2 +- src/IntHistoryListForm.cpp | 50 ++- src/IntHistoryPresentationModel.cpp | 19 +- src/IntMainForm.cpp | 432 +++++---------------- src/IntMultipleWindowForm.cpp | 9 +- src/IntSettingForm.cpp | 60 +-- 22 files changed, 299 insertions(+), 431 deletions(-) create mode 100644 res/screen-density-high/00_button_sweep_delete.9.png create mode 100644 res/screen-density-high/00_button_sweep_delete_press.9.png diff --git a/inc/IntAddressbar.h b/inc/IntAddressbar.h index 583ecc8..6537f7e 100644 --- a/inc/IntAddressbar.h +++ b/inc/IntAddressbar.h @@ -63,6 +63,7 @@ class Addressbar void OnKeypadClosed(Tizen::Ui::Control& source); void OnKeypadOpened(Tizen::Ui::Control& source); void OnKeypadWillOpen(Tizen::Ui::Control& source); + void OnKeypadBoundsChanged(Tizen::Ui::Control &source); void OnFocusGained(const Tizen::Ui::Control& source); void OnFocusLost(const Tizen::Ui::Control& source){} diff --git a/inc/IntHistoryListForm.h b/inc/IntHistoryListForm.h index de64ef5..96ff8a1 100644 --- a/inc/IntHistoryListForm.h +++ b/inc/IntHistoryListForm.h @@ -128,6 +128,7 @@ private: Tizen::Ui::Controls::GroupedListView* __pSearchListView; // The GroupedListView which contains the Search history lists bool __searchHistory; Tizen::Base::String __searchText; + Tizen::Ui::Scenes::SceneId __previousSceneId; }; /** diff --git a/inc/IntIAddressbarEventListener.h b/inc/IntIAddressbarEventListener.h index 46d31a7..685389f 100644 --- a/inc/IntIAddressbarEventListener.h +++ b/inc/IntIAddressbarEventListener.h @@ -42,6 +42,7 @@ public: virtual void OnAddressBarKeypadClosed(const Addressbar&, bool footerState = true ) = 0; virtual void OnAddressBarKeypadOpened(const Addressbar&) = 0; virtual void OnAddressBarKeypadWillOpen(const Addressbar&) = 0; + virtual void OnAddressBarKeypadBoundsChanged(const Addressbar&) = 0; //virtual void OnAddressBarModeChanged(const Addressbar&) = 0; virtual void OnAddressCancelledClicked(const Addressbar&) = 0; //virtual void OnBackClicked(const Addressbar&) = 0; @@ -49,6 +50,7 @@ public: virtual void OnReaderClicked(const Addressbar&) = 0; virtual void OnRefreshClicked(const Addressbar&) = 0; virtual void OnStopClicked(Addressbar&) = 0; + virtual void OnUrlValueChanged(Addressbar&) = 0; virtual void OnUrlSubmitted(Addressbar&) = 0; }; diff --git a/inc/IntMainForm.h b/inc/IntMainForm.h index 6980777..218c331 100644 --- a/inc/IntMainForm.h +++ b/inc/IntMainForm.h @@ -108,6 +108,8 @@ public: void OnAddressBarKeypadWillOpen(const Addressbar&); + void OnAddressBarKeypadBoundsChanged(const Addressbar& addBar); + void OnAddressBarModeChanged(/*const Addressbar&*/); void OnBackClicked(/*const Addressbar&*/); @@ -142,6 +144,8 @@ public: virtual void OnKeypadClosed(Tizen::Ui::Control& source); + virtual void OnKeypadBoundsChanged (Tizen::Ui::Control &source); + virtual void OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction){} void OnLoadingErrorOccurred(Tizen::Web::Controls::LoadingErrorType error, const Tizen::Base::String& reason); @@ -288,6 +292,7 @@ private: bool __isLoadingData; bool __isLoadingCompleted; + bool __isLongPressedDone; int __progressPercentage; AddressBarMode __currentAddMode; diff --git a/res/screen-density-high/00_button_sweep_delete.9.png b/res/screen-density-high/00_button_sweep_delete.9.png new file mode 100644 index 0000000000000000000000000000000000000000..ad7b154ab011ae280b3e03067e7d32bd9f647f66 GIT binary patch literal 980 zcmV;_11tQAP){x)+Vq0ei`4rTb_8mGUD;b$kwegx^0_`?c6D+a&jijtSyAM;6Cc}jT`9co;@;> zlk?Xeqn?Zm@n>a?n>BXW(XqpazrHFiwuOGzpOq!eZueKS#_lb4y>D&(Ho9ZS&u4dP z7&WD(eKTw9URn1Coamnmva{71Qc}dMvBlmuHOVjrnRKkNQHF6on4*sjZP`Lqzh+Go zv3H@63}$9h=~zR94C3l$s!vXK#@+%Oz#vml#p>&2VDn}w6?+4$AA?L3*0*UBRo&{< z3Kk4X-^PtpD)t)KBMdU>SY4ew+OUDDZq+Jh>=m$w>(^7&GFUGLnRKkSR(joTs@jz+ zow1iSHS%EHI;t8Cdjae|2AMc4J)Np%#R>(hu9kai*HTq$*z>9?xto?oRh^U+MeG@{ zJE^HuRVr3lDYx-khp8$tQNaQMxs7`}lZrhBb_;_{l^PZSb`y6{rpo2ZXJIk}tEiA3 z+^3iVGclQsm6uBo?gmVOgoIhxjJG)s>;?vz{=jCRv$3)=xsDGoQw4?LGsjdBAMcEf zmX^vjT-i(%){Q}?auvhh{@u73naYE_ zha|;(z6$5m{`hj&| zkV(giiliepmWsm8E?7Wi;nhVC>jQQMgG@TMf4`iWKc7m+3JWQy9r+Zj^Ik#0lo@QF zH_x#Xm??^jn=)(cu$Bwkw}0ut-9W>_IA?oZt}kYd9hMTv$cUWBExCQ}T-%NTvv8f| zr>95E8pmzIP(s2)8y1|z!qd|_j<200009?sHp~=J+o1599(a0XRx3i~RU2M9$yUJb75Vqi$35T~fQz^FG*S8Uq~H_9-Xb;)k%HXV8^kU_q;P@~y9kkj+}LZxE;Kcf zIBquU$5s$K50QfW*g1$4j)`Kg5SxNXL2m3NVv`Ul9F-nB3z32_wv1Q?A_cG1*bBtY zK%^i)b{ZlDRcdSru~QH!$c;TmEDe#u5xFs+j}%JrnBW~ye59)NG+q{|g8?nZjYc-s z*;(f^TCw@rk&*38TbnQzYHek%o}O(!qZPBq1_vvXcour0L`%#5^RnA3d`9<}Fl4n> zqb3s@$99t#{z(E`3t~k)MeP3`E|^I(`WrYL*P-rgEt5$OQ) s(9voZtTi01^3PfF(dxf_k&f_x07q}F_v6x0BLDyZ07*qoM6N<$g1drNhyVZp literal 0 HcmV?d00001 diff --git a/res/screen-size-normal/IDL_ADDRESSBAR.xml b/res/screen-size-normal/IDL_ADDRESSBAR.xml index b05aca3..a79a782 100644 --- a/res/screen-size-normal/IDL_ADDRESSBAR.xml +++ b/res/screen-size-normal/IDL_ADDRESSBAR.xml @@ -3,21 +3,21 @@ This XML file was automatically generated by UiBuilder - do not modify by hand. --> - + - + @@ -40,8 +40,8 @@ - - + + - + @@ -73,7 +73,7 @@ diff --git a/src/IntAddBookmarkForm.cpp b/src/IntAddBookmarkForm.cpp index 4a7fd61..0e4f634 100644 --- a/src/IntAddBookmarkForm.cpp +++ b/src/IntAddBookmarkForm.cpp @@ -419,7 +419,7 @@ AddBookmarkForm::OnActionPerformed(const Control& source, int actionId) __pEditFieldUrl->Clear(); } - pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT)); + pSceneManager->GoBackward(BackwardSceneTransition()); } break; @@ -773,7 +773,7 @@ AddBookmarkForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId // Code to handle events when the AddBookmarkForm is activated. String str = "-1"; String pageTitle = L""; - String pageUrl = L"http://"; + String pageUrl = L""; String title = L""; String url = L""; result r = E_FAILURE; @@ -1025,18 +1025,10 @@ AddBookmarkForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId void AddBookmarkForm::OnFocusGained (const Tizen::Ui::Control &source) { - - AppLog("the client area height is %d",GetClientAreaBounds().height); - - // __pScrollPanel->SetBounds(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height)); - - // __pScrollPanel->Invalidate(true); - // __pScrollPanel->SetScrollPosition(source.GetY()-48,false); __pScrollPanel->SetSize(GetClientAreaBounds().width,GetClientAreaBounds().height); __pScrollPanel->SetClientAreaWidth(__pScrollPanel->GetWidth()); __pScrollPanel->SetClientAreaHeight(GetClientAreaBounds().height); Invalidate(true); - AppLog("the scroll panel height is Rect(%d,%d,%d,%d) ClientHeight = %d",__pScrollPanel->GetX(),__pScrollPanel->GetY(),__pScrollPanel->GetWidth(),__pScrollPanel->GetHeight(),__pScrollPanel->GetClientAreaBounds().height); return; } diff --git a/src/IntAddressbar.cpp b/src/IntAddressbar.cpp index b7eb241..b950f90 100644 --- a/src/IntAddressbar.cpp +++ b/src/IntAddressbar.cpp @@ -112,15 +112,6 @@ Addressbar::Initialize(const Rectangle& rect) return E_INVALID_KEY; } - /*__pLabelPrivateOn = static_cast (GetControl(L"IDC_LABEL_PRIVATE_ON",true)); - - if (__pLabelPrivateOn == NULL) - { - AppLogDebug("Control not found returning E_INVALID_KEY"); - return E_INVALID_KEY; - } - __pLabelPrivateOn->SetShowState(false);*/ - __pAddressbarBg = static_cast (GetControl(L"IDC_ADDRESSBAR_BG_LABEL",true)); if (__pAddressbarBg == NULL) { @@ -136,13 +127,13 @@ Addressbar::Initialize(const Rectangle& rect) } //Add the backround label for displaying progressbar - __pProgressbarLabel = static_cast (GetControl(L"IDC_PROGRESS_BAR_LABEL",true)); + /*__pProgressbarLabel = static_cast (GetControl(L"IDC_PROGRESS_BAR_LABEL",true)); if (__pProgressbarLabel == NULL) { AppLogDebug("Control not found returning E_INVALID_KEY"); return E_INVALID_KEY; } - __pProgressbarLabel->SetShowState(false); + __pProgressbarLabel->SetShowState(false);*/ //Add the stop button __pStopBtn = static_cast (GetControl(L"IDC_STOP_BUTTON",true)); @@ -694,7 +685,7 @@ Addressbar::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) case IDA_CANCEL: { - __pListener->OnAddressCancelledClicked(*this); +// __pListener->OnAddressCancelledClicked(*this); __pAddressbarUrlField->SetText(__displayUrl); __editTextUrl = L""; __pAddressbarUrlField->HideKeypad(); @@ -741,6 +732,7 @@ Addressbar::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::Keypa { __pListener->OnUrlSubmitted(*this); } + //UpdateProgressBitmap(); } } @@ -754,21 +746,25 @@ Addressbar::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::Keypa void Addressbar::OnKeypadClosed(Tizen::Ui::Control& source) { - __pListener->OnAddressBarKeypadClosed(*this); + SetShowState(false); + if(__pListener != null) + { + __pListener->OnAddressBarKeypadClosed(*this); + } } void Addressbar::OnKeypadOpened(Tizen::Ui::Control& source) { - - __pListener->OnAddressBarKeypadClosed(*this,false); + if(__pListener != null) + { + __pListener->OnAddressBarKeypadOpened(*this); + } } void Addressbar::OnKeypadWillOpen(Tizen::Ui::Control& source) { - //SetAddressbarMode(ADDRESSBAR_MODE_EDIT); - // SetAddressbarMode(__prevAddMode); if(__pListener != null) { __pListener->OnAddressBarKeypadWillOpen(*this); @@ -776,6 +772,16 @@ Addressbar::OnKeypadWillOpen(Tizen::Ui::Control& source) } void +Addressbar::OnKeypadBoundsChanged(Tizen::Ui::Control &source) +{ + AppLog("Coming here"); + if(__pListener != null) + { + __pListener->OnAddressBarKeypadBoundsChanged(*this); + } +} + +void Addressbar::OrientationChanged(void) { Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_SEARCH_INPUT_FIELD_BG, __pAddressbarBg->GetWidth(), __pAddressbarBg->GetHeight()); @@ -830,6 +836,7 @@ Addressbar::OnFocusGained(const Control& source) { //SetAddressbarMode(ADDRESSBAR_MODE_EDIT); // SetAddressbarMode(__prevAddMode); + __pAddressbarUrlField->SetCursorPosition(__pAddressbarUrlField->GetTextLength()); if (__pListener != null) { __pListener->OnAddressBarKeypadWillOpen(*this); @@ -844,19 +851,11 @@ Addressbar::OnTextValueChanged(const Control& source) { if(__pAddressbarUrlField->GetTextLength() == 0) { - if(__pAddressbarUrlField->IsKeypadActionEnabled() == true) - { - __pAddressbarUrlField->SetKeypadActionEnabled(false); - GetParent()->GetParent()->Invalidate(true); - } + __pAddressbarUrlField->SetKeypadActionEnabled(false); } else { - if(__pAddressbarUrlField->IsKeypadActionEnabled() == false) - { - __pAddressbarUrlField->SetKeypadActionEnabled(true); - GetParent()->GetParent()->Invalidate(true); - } + __pAddressbarUrlField->SetKeypadActionEnabled(true); } } diff --git a/src/IntBookmarkData.cpp b/src/IntBookmarkData.cpp index f8132e4..3e48116 100644 --- a/src/IntBookmarkData.cpp +++ b/src/IntBookmarkData.cpp @@ -36,6 +36,8 @@ BookmarkData::BookmarkData(void) , __iconPath("") , __faviconId("") , __pFavIconData(null) + , __favIconWidth(0) + , __favIconHeight(0) { __createdTime.SetValue(0, 0, 0); __modifiedTime.SetValue(0, 0, 0); diff --git a/src/IntBookmarkListForm.cpp b/src/IntBookmarkListForm.cpp index fb8d68b..868c156 100644 --- a/src/IntBookmarkListForm.cpp +++ b/src/IntBookmarkListForm.cpp @@ -79,6 +79,7 @@ BookmarkListForm::BookmarkListForm(void) __noBookmarks = true; __selectedindex = 0; __searchText = L""; + __previousSceneId = L""; } BookmarkListForm::~BookmarkListForm(void) @@ -358,10 +359,23 @@ BookmarkListForm::OnActionPerformed(const Tizen::Ui::Control& source, int action if (pSceneManager != null) { - if(pSceneManager->GoForward(ForwardSceneTransition(IDSCN_HISTORY_LIST, SCENE_TRANSITION_ANIMATION_TYPE_LEFT)) != E_SUCCESS) + if(__previousSceneId.CompareTo(IDSCN_HISTORY_LIST) != 0) { - AppLogDebug("BookmarkListForm::OnActionPerformed GoForward failed"); - return; + if(pSceneManager->GoForward(ForwardSceneTransition(IDSCN_HISTORY_LIST, SCENE_TRANSITION_ANIMATION_TYPE_LEFT)) != E_SUCCESS) + { + AppLogDebug("BookmarkListForm::OnActionPerformed GoForward failed"); + return; + } + } + else + { + + if(pSceneManager->GoBackward(BackwardSceneTransition())!= E_SUCCESS) + { + AppLogDebug("BookmarkListForm::OnActionPerformed GoBackward failed"); + return; + } + } } } @@ -507,7 +521,14 @@ BookmarkListForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source) SceneManager* pSceneManager = SceneManager::GetInstance(); if (pSceneManager != null) { - pSceneManager->GoBackward(BackwardSceneTransition()); + if(__previousSceneId.CompareTo(IDSCN_HISTORY_LIST) != 0) + { + pSceneManager->GoBackward(BackwardSceneTransition()); + } + else + { + pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_LEFT)); + } } } @@ -1037,6 +1058,7 @@ BookmarkListForm::OnKeypadClosed(Tizen::Ui::Control& source) __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight()); __pListview->SetBounds(__pSearchListView->GetX(), __pSearchBar->GetY() + __pSearchBar->GetHeight(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight()); __pSearchListView->Invalidate(false); + __pSearchListView->SetEnabled(true); __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight())); Invalidate(true); } @@ -1075,6 +1097,9 @@ void BookmarkListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs) { AppLogDebug("BookmarkListForm::OnSceneActivatedN called"); + ArrayListT * pList = dynamic_cast* >(SceneManager::GetInstance()->GetSceneHistoryN()); + + pList->GetAt(pList->GetCount()-1,__previousSceneId); __searchBookmark = false; GetFooter()->SetShowState(true); @@ -1130,7 +1155,7 @@ BookmarkListForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen: __pSearchBar->Invalidate(true); } - __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().width)); + __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height)); } diff --git a/src/IntBookmarkPresentationModel.cpp b/src/IntBookmarkPresentationModel.cpp index d1cd4cc..20bf177 100644 --- a/src/IntBookmarkPresentationModel.cpp +++ b/src/IntBookmarkPresentationModel.cpp @@ -230,7 +230,7 @@ BookmarkPresentationModel::SaveBookmark(BookmarkData& bookmark) columnNames.Append(L"ADDRESS, "); columnNames.Append(L"TITLE, "); columnNames.Append(L"CREATIONDATE, "); - columnNames.Append(L"UPDATEDATE"); + columnNames.Append(L"UPDATEDATE, "); columnNames.Append(L"FAVICON, "); // columnNames.Append(L"FAVICON_LENGTH, "); columnNames.Append(L"FAVICON_W, "); diff --git a/src/IntCreateBookmarkFolderForm.cpp b/src/IntCreateBookmarkFolderForm.cpp index 390a5db..9f6a22f 100644 --- a/src/IntCreateBookmarkFolderForm.cpp +++ b/src/IntCreateBookmarkFolderForm.cpp @@ -270,7 +270,7 @@ CreateBookmarkFolderForm::OnActionPerformed(const Control& source, int actionId) __pFolderTitle->HideKeypad(); } - r = pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT)); + r = pSceneManager->GoBackward(BackwardSceneTransition()); AppLogDebug("SCENE_ADD_BOOKMARK error = %s",GetErrorMessage(r)); TryCatch(!IsFailed(r),L"BookmarkPresentationModel::GetFolderCount failed %s",GetErrorMessage(r)); @@ -319,7 +319,7 @@ CreateBookmarkFolderForm::OnActionPerformed(const Control& source, int actionId) if(__pBookmark && (__pBookmark->GetBookmarkTitle() == folderTitle )) { SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT)); - folderList.RemoveAll(true); + folderList.RemoveAll(false); return; } } @@ -357,7 +357,7 @@ CreateBookmarkFolderForm::OnActionPerformed(const Control& source, int actionId) AppLogDebug("SCENE_ADD_BOOKMARK error = %s",GetErrorMessage(r)); if (pArgList != null) { - pArgList->RemoveAll(true); + pArgList->RemoveAll(false); delete pArgList; } TryCatch( !IsFailed(r),L"BookmarkPresentationModel::GetFolder failed %s",GetErrorMessage(r)); @@ -365,7 +365,7 @@ CreateBookmarkFolderForm::OnActionPerformed(const Control& source, int actionId) } - folderList.RemoveAll(true); + folderList.RemoveAll(false); } break; diff --git a/src/IntDropDownCustomItem.cpp b/src/IntDropDownCustomItem.cpp index 26e1a4c..e3c9af7 100644 --- a/src/IntDropDownCustomItem.cpp +++ b/src/IntDropDownCustomItem.cpp @@ -168,7 +168,7 @@ DropDownCustomItem::Make() pDropperBitmapPressed = pAppResource->GetBitmapN(IDB_LIST_EXPAND_OPENED_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888); } - AddElement(Rectangle(__width - 98, (__height - 74) / 2, 74, 74), IDA_FORMAT_DROPPER, *pDropperBitmapNormal, pDropperBitmapNormal, pDropperBitmapNormal); + AddElement(Rectangle(__width - pDropperBitmapNormal->GetWidth() - 12, (__height - 74) / 2, 74, 74), IDA_FORMAT_DROPPER, *pDropperBitmapNormal, pDropperBitmapNormal, pDropperBitmapNormal); delete pDropperBitmapNormal; delete pDropperBitmapPressed; } diff --git a/src/IntEditBookmarkListForm.cpp b/src/IntEditBookmarkListForm.cpp index 09e2a59..5d60475 100644 --- a/src/IntEditBookmarkListForm.cpp +++ b/src/IntEditBookmarkListForm.cpp @@ -892,10 +892,12 @@ void EditBookmarkListForm::OnOrientationChanged(const Tizen::Ui::Control &source } else { + AppLog("EditBookmarkListForm::OnOrientationChanged 1"); __pCheckButton->SetShowState(true); __pInfoPanel->SetShowState(true); __pListview->SetBounds(__pListview->GetX(), __pListview->GetY(), __pListview->GetWidth(), GetClientAreaBounds().height - __pCheckButton->GetHeight() - __pInfoPanel->GetHeight()); - + __pInfoLabel->SetBounds(__pInfoLabel->GetX(),__pInfoLabel->GetY(), GetClientAreaBounds().width,__pInfoLabel->GetHeight()); + __pInfoLabel->Invalidate(true); } __pCheckButton->Invalidate(true); diff --git a/src/IntEditHistoryListForm.cpp b/src/IntEditHistoryListForm.cpp index 02a5bd0..bacf564 100644 --- a/src/IntEditHistoryListForm.cpp +++ b/src/IntEditHistoryListForm.cpp @@ -643,7 +643,7 @@ EditHistoryListForm::GetItemCount(int groupIndex) if (pGroupItemClass->__pData != null) { - pGroupItemClass->__pData->RemoveAll(true); + pGroupItemClass->__pData->RemoveAll(false); delete pGroupItemClass->__pData; } pGroupItemClass->__pData = new(std::nothrow) Collection::ArrayList(); diff --git a/src/IntHistoryListForm.cpp b/src/IntHistoryListForm.cpp index ec4d014..8932e49 100644 --- a/src/IntHistoryListForm.cpp +++ b/src/IntHistoryListForm.cpp @@ -67,6 +67,7 @@ HistoryListForm::HistoryListForm(void) __searchHistory = false; __isNoHistoryPresent = true; __searchText = L""; + __previousSceneId = L""; } HistoryListForm::~HistoryListForm(void) @@ -248,7 +249,33 @@ HistoryListForm::OnActionPerformed(const Control& source, int actionId) result r = GetHeader()->SetItemSelected(1); AppLog("SetItemSelected result %s",GetErrorMessage(r)); GetHeader()->Invalidate(true); - r = pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT)); + + if (pSceneManager != null) + { + if(__previousSceneId.CompareTo(IDSCN_BOOKMARK_VIEW) != 0) + { + if(pSceneManager->GoForward(ForwardSceneTransition(IDSCN_BOOKMARK_VIEW, SCENE_TRANSITION_ANIMATION_TYPE_LEFT)) != E_SUCCESS) + { + AppLogDebug("BookmarkListForm::OnActionPerformed GoForward failed"); + return; + } + } + else + { + + if(pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT))!= E_SUCCESS) + { + AppLogDebug("BookmarkListForm::OnActionPerformed GoBackward failed"); + return; + } + + } + } + + + + +// r = pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT)); if (IsFailed(r)) { return; @@ -268,7 +295,15 @@ HistoryListForm::OnFormBackRequested(Form& source) { return; } - result r = pSceneManager->GoBackward(BackwardSceneTransition()); + result r = E_FAILURE; + if(__previousSceneId.CompareTo(IDSCN_BOOKMARK_VIEW) != 0) + { + r = pSceneManager->GoBackward(BackwardSceneTransition()); + } + else + { + r = pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT)); + } if(IsFailed(r)) { AppLogDebug("HistoryListForm::OnFormBackRequested GoForward failed %s",GetErrorMessage(r)); @@ -463,6 +498,11 @@ HistoryListForm::CreateItem(int groupIndex, int itemIndex, int itemWidth) delete pItem; return null; } + if (pGroupItemClass->GetHistoryData() == null) + { + delete pItem; + return null; + } pHistory = dynamic_cast< History* >(pGroupItemClass->GetHistoryData()->GetAt(itemIndex)); if (pHistory == null) { @@ -691,6 +731,10 @@ HistoryListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId { GetHeader()->SetItemSelected(1); +// __previousSceneId = previousSceneId; + ArrayListT * pList = dynamic_cast* >(SceneManager::GetInstance()->GetSceneHistoryN()); + + pList->GetAt(pList->GetCount()-1,__previousSceneId); AppLog("HistoryListForm::OnSceneActivatedN called"); //GetHeader()->Invalidate(true); @@ -1188,10 +1232,10 @@ HistoryListForm::OnKeypadClosed(Control& source) __pSearchListView->SetEnabled(true); } + GetFooter()->SetShowState(true); __pSearchListView->SetBounds(__pSearchListView->GetX(), __pSearchListView->GetY(), __pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight()); __pSearchListView->Invalidate(false); __pSearchBar->SetContentAreaSize(Dimension(__pSearchListView->GetWidth(), GetClientAreaBounds().height - __pSearchBar->GetHeight())); - GetFooter()->SetShowState(true); Invalidate(true); } diff --git a/src/IntHistoryPresentationModel.cpp b/src/IntHistoryPresentationModel.cpp index ef939a7..6ac04d1 100644 --- a/src/IntHistoryPresentationModel.cpp +++ b/src/IntHistoryPresentationModel.cpp @@ -663,8 +663,15 @@ HistoryPresentationModel::GetHistoryCountWithTimeRange(Tizen::Base::DateTime& st { int count = 0; result r = E_SUCCESS; - if(__pDataList == null) + + if(__pDataList != null) { + delete __pDataList; + __pDataList = null; + } + + //if(__pDataList == null) + //{ __pDataList = new(std::nothrow) ArrayList(); __pDataList->Construct(); @@ -676,16 +683,16 @@ HistoryPresentationModel::GetHistoryCountWithTimeRange(Tizen::Base::DateTime& st if(count > 0) { r = GetHistory(0, count, *__pDataList); - if(IsFailed(r)) + if (IsFailed(r)) { return r; } } - } - else - { + //} + //else + //{ count = __pDataList->GetCount(); - } + //} for (int counter = 0 ; counter < count; counter++) { diff --git a/src/IntMainForm.cpp b/src/IntMainForm.cpp index fc2c9e1..a5868d8 100644 --- a/src/IntMainForm.cpp +++ b/src/IntMainForm.cpp @@ -129,6 +129,7 @@ static const int HEIGHT_CONTEXT_MENU_BUTTON = 72; MainForm::MainForm(void) { + __isLongPressedDone = false; __pAddressbar = null; // __pMostVisitedSitesPanel = null; __pMostVisitedListView = null; @@ -429,7 +430,7 @@ MainForm::InitWebControl() if (__pAddressbar == null || __pFooterPanel == null) return E_FAILURE; - const int Y_WEBCONTROL_POSITION = __pAddressbar->GetY() + __pAddressbar->GetHeight() - 12; + const int Y_WEBCONTROL_POSITION = 0; __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight(); if (__pMostVisitedListView) { @@ -480,7 +481,6 @@ MainForm::InitWebControl() __pWebViewer->SetTextSearchListener(this); } - __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width,__webControlHeight)); AppLogDebug("MainForm :before return"); Invalidate(true); AppLogDebug("MainForm::InitWebControl Exit"); @@ -607,7 +607,6 @@ MainForm::InitFooter(void) __pFooterUrlField = static_cast (GetControl(L"IDC_URL_EDIT_FIELD",true)); if (__pFooterUrlField == NULL) { - AppLogDebug("__pFooterUrlField Control not found returning E_INVALID_KEY"); return E_INVALID_KEY; } @@ -1193,16 +1192,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) __pMenu->SetShowState(false); __pMenu->Invalidate(false); - /*__adressPanelPosition.y = 0 ; - - if (__pAddressbar != null && __pWebViewer != NULL) - { - __webControlPosition.y = __pAddressbar->GetHeight(); - //__pAddressbar->SetBounds(0,__adressPanelPosition.y,GetClientAreaBounds().width,__pAddressbar->GetHeight()); - //__pAddressbar->Invalidate(true); - __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width,__webControlHeight)); - __pWebViewer->Invalidate(true); - }*/ + __pFindWordEditField->SetFocus(); if (__pWebViewer != null) { // releasing the set block @@ -1428,7 +1418,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) } AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 3"); - if (__pMenu->GetItemCount() == 12) + if (__pMenu->GetItemCount() == 9) { r = __pMenu->SetItemAt(1,L"Add to Bookmarks"/*CommonUtil::GetString(L"IDS_BR_OPT_BOOKMARK")*/, IDA_ADDTOBOOKMARK_CLICKED,*pBitmap); } @@ -1444,7 +1434,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) return ; } AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 4"); - if (__pMenu->GetItemCount() != 12) + if (__pMenu->GetItemCount() != 9) { __pMenu->InsertItemAt(1,L"Add to Bookmarks"/*CommonUtil::GetString(L"IDS_BR_OPT_SHARE")*/, IDA_ADDTOBOOKMARK_CLICKED); @@ -1599,6 +1589,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) __pFindWordEditField->SetText(L""); __currentSearchStr = L"aaaaaabbbbbbccccccc"; StartWordSearch(); + __currentSearchStr = L""; __pFindWordNext->SetEnabled(false); __pFindWordPrev->SetEnabled(false); __pFindWordPanel->Invalidate(true); @@ -1757,12 +1748,12 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) if (__pAddressbar != null && __pWebViewer != NULL) { __webControlPosition.y = __pAddressbar->GetHeight() - 12; - __pAddressbar->SetBounds(0,__adressPanelPosition.y,GetClientAreaBounds().width,__pAddressbar->GetHeight()); - __pAddressbar->Invalidate(true); - __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight() - ( __pAddressbar->GetY() + __pAddressbar->GetHeight() - 12); + //__pAddressbar->SetBounds(0,__adressPanelPosition.y,GetClientAreaBounds().width,__pAddressbar->GetHeight()); + //__pAddressbar->Invalidate(true); + __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight() - ( /*__pAddressbar->GetY() +*/ __pAddressbar->GetHeight() - 12); - if(__pFooterPanel->GetShowState() == false) - __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, GetClientAreaBounds().height - ( __pAddressbar->GetY() + __pAddressbar->GetHeight() - 12))); + if (__pFooterPanel->GetShowState() == false) + __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, GetClientAreaBounds().height - ( /*__pAddressbar->GetY() +*/ __pAddressbar->GetHeight() - 12))); else __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, __webControlHeight)); // __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width,__webControlHeight)); @@ -2209,7 +2200,10 @@ MainForm::OnLoadingStarted(void) } } Bitmap* pBitmap = FaviconManager::GetInstance()->GetDefaultFaviconN(); - __pAddressbar->SetFaviconBitmap(*pBitmap); + if(pBitmap != null) + { + __pAddressbar->SetFaviconBitmap(*pBitmap); + } delete pBitmap; if (__adressPanelPosition.y < (0 - __pAddressbar->GetHeight() + 12)) { @@ -2248,11 +2242,9 @@ MainForm::OnKeypadWillOpen(Tizen::Ui::Control& source) AppLog("MainForm::OnKeypadWillOpen"); if (__pAddressbar != null) { - OnAddressBarKeypadOpened(*__pAddressbar); + OnAddressBarKeypadWillOpen(*__pAddressbar); } - //__pAddressbar->SetAddressbarURLFocus(); - } void @@ -2260,7 +2252,7 @@ MainForm::OnKeypadOpened(Tizen::Ui::Control& source) { if(__pAddressbar != null) { - OnAddressBarKeypadClosed(*__pAddressbar, false); + OnAddressBarKeypadOpened(*__pAddressbar); } } @@ -2275,6 +2267,13 @@ MainForm::OnKeypadClosed(Tizen::Ui::Control& source) } void +MainForm::OnKeypadBoundsChanged(Tizen::Ui::Control &source) +{ + AppLog("KeypadBoundsChanged"); + RelayoutControls(false); +} + +void MainForm::OnLoadingErrorOccurred(LoadingErrorType error, const Tizen::Base::String& reason) { @@ -2423,10 +2422,10 @@ MainForm::OnUrlSubmitted(Addressbar& addBar) String url = addBar.GetUrl(); AppLog("MainForm::OnUrlSubmitted url is %ls", url.GetPointer()); - LoadUrl(url); __pFooterPanel->SetShowState(true); - __pFooterPanel->Invalidate(true); - RequestRedraw(true); +// __pAddressbar->SetShowState(false); +// RelayoutControls(false); + LoadUrl(url); } void @@ -2435,14 +2434,14 @@ MainForm::LoadUrl(String& url) String encodedUrl; // UrlEncoder::Encode(url, L"UTF-8", encodedUrl); AppLogDebug("MainForm::LoadUrl enter"); - encodedUrl = url; + if (__pWebViewer != null) { __pWebViewer->SetShowState(true); __pWebViewer->Invalidate(true); } - if (encodedUrl.CompareTo(L"") == 0) + if (url.CompareTo(L"") == 0) { return; } @@ -2466,17 +2465,17 @@ MainForm::LoadUrl(String& url) secondRegex.Construct(secondPattern, REGEX_CASELESS); // Match - ret = firstRegex.Match(encodedUrl, false); // This returns true value - flag = secondRegex.Match(encodedUrl, false); // Checks whether URL typed is of type abc.com (i.e without protocol in front of it) + ret = firstRegex.Match(url, false); // This returns true value + flag = secondRegex.Match(url, false); // Checks whether URL typed is of type abc.com (i.e without protocol in front of it) if (ret == true && __pWebViewer != null) { - __pWebViewer->LoadUrl(encodedUrl); + __pWebViewer->LoadUrl(url); } else if(__pWebViewer != null) { String tempUrl = L"http://"; - tempUrl.Append(encodedUrl); + tempUrl.Append(url); if (flag == true) { @@ -2484,6 +2483,7 @@ MainForm::LoadUrl(String& url) } else { + UrlEncoder::Encode(url, L"UTF-8", encodedUrl); __pWebViewer->LoadUrl(SettingPresentationModel::GetInstance()->GetSearchUrl(encodedUrl)); } } @@ -2643,7 +2643,7 @@ MainForm::OnAddressCancelledClicked(const Addressbar& addBar) { AppLog("MainForm::OnAddressCancelledClicked 1"); if (__pMostVisitedListView != null && __pAddressbar != null && __pFooterPanel != null) - __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, __pMostVisitedListView->GetHeight()/*GetClientAreaBounds().height - __pAddressbar->GetHeight() - __pFooterPanel->GetHeight() + 14*/)); + __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, GetClientAreaBounds().height - __pFooterPanel->GetHeight())); if (__pMostVisitedListView != null) __pMostVisitedListView->Invalidate(true); @@ -2660,7 +2660,6 @@ MainForm::OnAddressBarModeChanged(/*const Addressbar& addBar*/) if (__pAddressbar != null) { - //__curAddressBarMode = __pAddressbar->GetAddressbarMode(); __curAddressBarMode = GetAddressbarMode(); } @@ -2683,130 +2682,51 @@ MainForm::OnAddressBarModeChanged(/*const Addressbar& addBar*/) __adressPanelPosition.y = 0; if (__pAddressbar != null) { - - __webControlPosition.y = 0;//__pAddressbar->GetHeight() - 12; - __pAddressbar->SetBounds(Rectangle(0,__pAddressbar->GetY() - __pAddressbar->GetHeight(),GetClientAreaBounds().width,__pAddressbar->GetHeight())); + __webControlPosition.y = 0; + __pAddressbar->SetBounds(Rectangle(0, __pAddressbar->GetY() - __pAddressbar->GetHeight(), GetClientAreaBounds().width, __pAddressbar->GetHeight())); __pAddressbar->Invalidate(true); } } - if (__pWebViewer != null) - { - if(__pFooterPanel->GetShowState() == false) - __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, GetClientAreaBounds().height - ( __pAddressbar->GetY() + __pAddressbar->GetHeight() - 12))); - else - __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, __webControlHeight)); - __pWebViewer->Invalidate(true); - } } void MainForm::OnAddressBarKeypadClosed(const Addressbar& addBar, bool footerState) { - - if(__pFooterPanel != null) - { - String homePage = SettingPresentationModel::GetInstance()->GetHomepage(); - if (homePage.CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0) - { - InitMostVisitedSitesView(GetOrientationStatus()); - } - __pFooterPanel->SetBounds(0, GetClientAreaBounds().height - __pFooterPanel->GetHeight(), __pFooterPanel->GetWidth(), __pFooterPanel->GetHeight()); - __pFooterPanel->SetShowState(footerState); - __pFooterPanel->Invalidate(false); - } - - - - //AppLogDebug("MainForm::OnAddressBarKeypadClosed enterd"); - - if (__pWebViewer != null && __pFooterPanel != null) - { - AppLog("MainForm::OnAddressBarKeypadClosed GetClientAreaBounds().height %d ", GetClientAreaBounds().height); - __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight(); - - if(__pFooterPanel->GetShowState() == false) - __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, GetClientAreaBounds().height)); - else - __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, __webControlHeight)); - __pWebViewer->Invalidate(false); - //__pWebViewer->SetBounds(Rectangle(0, 82, GetClientAreaBounds().width,webControlHeight)); - } - if(__pMostVisitedListView != null && __pAddressbar != null && __pFooterPanel != null) - __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, GetClientAreaBounds().height - __pAddressbar->GetHeight() - __pFooterPanel->GetHeight() + 14)); - + __pFooterPanel->SetShowState(true); + RelayoutControls(false); } void MainForm::OnAddressBarKeypadOpened(const Addressbar& addBar) { - AppLog("MainForm::OnAddressBarKeypadOpened"); - if (__pFindWordPanel && __pFindWordPanel->GetShowState() == true) { __pAddressbar->SetShowState(false); - __pAddressbar->Invalidate(true); } else { if (__pAddressbar != null && __pAddressbar->GetShowState() == false) { __pAddressbar->SetShowState(true); - __pAddressbar->Invalidate(true); __pAddressbar->SetBounds(Rectangle(0,0,GetClientAreaBounds().width,__pAddressbar->GetHeight())); __pAddressbar->SetAddressbarURLFocus(); } } - // setting the - //__pAddressbar->SetBounds(__pAddressbar->GetX(), 0, __pAddressbar->GetWidth(), __pAddressbar->GetHeight()); - - - if (__pMostVisitedListView && __pMostVisitedListView->GetShowState() == true) - { - AppLog("MainForm::OnAddressBarKeypadOpened 1"); - if (__pMostVisitedListView != null && __pAddressbar != null && __pFooterPanel != null) - __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, /*__pMostVisitedListView->GetHeight()*/GetClientAreaBounds().height - __pAddressbar->GetHeight() - __pFooterPanel->GetHeight() + 14)); - - if(__pMostVisitedListView != null) - __pMostVisitedListView->Invalidate(true); - } - else if (__pWebViewer != null && __pWebViewer->GetShowState() == true) - { - AppLog("MainForm::OnAddressBarKeypadOpened 2"); - if (__pWebViewer != null && __pAddressbar != null && __pFooterPanel != null) - __pWebViewer->SetBounds(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, /*__pWebViewer->GetHeight()*/GetClientAreaBounds().height - __pAddressbar->GetHeight() - __pFooterPanel->GetHeight() + 14)); - - if(__pWebViewer != null) - __pWebViewer->Invalidate(true); - } - - /*else - { - if (__pWebViewer != null) - { - __pWebViewer->SetShowState(false); - __pWebViewer->Invalidate(true); - } - - __pMostVisitedListView->SetShowState(true); - if (__pMostVisitedListView != null && __pAddressbar != null && __pFooterPanel != null) - __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight()-12 , GetClientAreaBounds().width, __pMostVisitedListView->GetHeight()GetClientAreaBounds().height - __pAddressbar->GetHeight() - __pFooterPanel->GetHeight() + 14)); - - if(__pMostVisitedListView != null) - __pMostVisitedListView->Invalidate(true); - - }*/ - - - __pFooterPanel->SetShowState(false); - __pFooterPanel->Invalidate(true); + RelayoutControls(false); } void MainForm::OnAddressBarKeypadWillOpen(const Addressbar& addBar) { __pFooterPanel->SetShowState(false); - __pFooterPanel->Invalidate(false); +} + +void +MainForm::OnAddressBarKeypadBoundsChanged(const Addressbar& addBar) +{ + AppLog("KeypadBoundsChanged"); + RelayoutControls(false); } void @@ -2823,11 +2743,8 @@ MainForm::OnPageTitleReceived(const Tizen::Base::String& title) if (__pAddressbar != null && __pWebViewer != null) { SetUrl(__pWebViewer->GetUrl()); - //__pAddressbar->SetUrl(__pWebViewer->GetUrl()); - //__pAddressbar->UpdateFaviconBitmap(SettingPresentationModel::GetInstance()->GetPrivateOn()); __pAddressbar->Invalidate(true); } - } void @@ -2868,12 +2785,10 @@ MainForm::UpdateFavicon(void) { if (__pWindowInfo->pFavicon != NULL) { - // delete __pWindowInfo->pFavicon; __pWindowInfo->pFavicon = null; } __pWindowInfo->pFavicon = new(std::nothrow) Bitmap(); __pWindowInfo->pFavicon->Construct(*pBitmap,Rectangle(0,0,pBitmap->GetWidth(),pBitmap->GetHeight())); - //bool isPrivateBrowsing = __pWebViewer->IsPrivateBrowsingEnabled(); __pAddressbar->SetFaviconBitmap(*__pWindowInfo->pFavicon); @@ -2885,10 +2800,12 @@ MainForm::UpdateFavicon(void) } else { - __pAddressbar->SetFaviconBitmap(*FaviconManager::GetInstance()->GetDefaultFaviconN()); + Bitmap *pDefaultBmp = FaviconManager::GetInstance()->GetDefaultFaviconN(); + if(pDefaultBmp != null) + { + __pAddressbar->SetFaviconBitmap(*pDefaultBmp); + } } - - AppLogDebug("Favicon download requested: url: %ls", url.ToString().GetPointer()); } delete tempPath; } @@ -2960,9 +2877,7 @@ MainForm::OnLoadingRequested(const Tizen::Base::String& url, pAppControl = dynamic_cast(AppManager::FindAppControlN(appId, operationId)); if(pAppControl) { - AppLog("Starting AppControl"); result r = pAppControl->Start(null, null, pMap, null); - AppLog("Result of Start %s", GetErrorMessage(r)); } else { @@ -3039,7 +2954,7 @@ MainForm::OnWebPageBlockSelected(Tizen::Web::Controls::Web& source, Tizen::Graph __currentSelectedStr = __pWebViewer->GetTextFromBlock(); AppLog("__currentSelectedStr after GetTextFromBlock %ls",__currentSelectedStr.GetPointer()); - if ((tagName.CompareTo(L"INPUT") == 0) || tagName.CompareTo(L"TEXTAREA") == 0) + if (((tagName.CompareTo(L"INPUT") == 0) || tagName.CompareTo(L"TEXTAREA") == 0) && __isLongPressedDone == true) { AppLog("MainForm::OnWebPageBlockSelected show paste option"); @@ -3048,7 +2963,7 @@ MainForm::OnWebPageBlockSelected(Tizen::Web::Controls::Web& source, Tizen::Graph __pImageMenu->Show(); __pImageMenu->Invalidate(true); } - else /*if (__pHitElementResult->HasUrl() == true )*/ + else if(__isLongPressedDone == true) { AppLog("MainForm::OnWebPageBlockSelected no paste option"); @@ -3118,19 +3033,34 @@ MainForm::OnWebWindowCreateRequested(void) void MainForm::RelayoutControls(bool showAddressbar) { - if (showAddressbar == false) + __webControlPosition.y = 0; + __webControlHeight = GetClientAreaBounds().height; + + AppLog("Client area height: %d", __webControlHeight); + if(__pAddressbar != null && __pAddressbar->GetShowState() == true) { - __pAddressbar->SetShowState(false); - __pWebViewer->SetBounds(__pWebViewer->GetX(), 0, __pWebViewer->GetWidth(), __webControlHeight); - __pFooterPanel->SetBounds(__pFooterPanel->GetX(), GetClientAreaBounds().height - __pFooterPanel->GetHeight(), __pFooterPanel->GetWidth(), __pFooterPanel->GetHeight()); + __webControlPosition.y += __pAddressbar->GetHeight(); + __webControlHeight -= __pAddressbar->GetHeight(); } - else + else if(__pFindWordPanel != null && __pFindWordPanel->GetShowState() == true) { - __pAddressbar->SetShowState(true); - __pWebViewer->SetBounds(__pWebViewer->GetX(), __pWebViewer->GetY(), __pWebViewer->GetWidth(), __webControlHeight); - __pFooterPanel->SetBounds(__pFooterPanel->GetX(), GetClientAreaBounds().height - __pFooterPanel->GetHeight(), __pFooterPanel->GetWidth(), __pFooterPanel->GetHeight()); + __webControlPosition.y += __pFindWordPanel->GetHeight(); + __webControlHeight -= __pFindWordPanel->GetHeight(); } - RequestRedraw(true); + + if(__pFooterPanel != null && __pFooterPanel->GetShowState() == true) + { + __webControlHeight -= __pFooterPanel->GetHeight(); + } + if (__pWebViewer != null && __pWebViewer->GetShowState() == true) + { + __pWebViewer->SetBounds(0, __webControlPosition.y, GetClientAreaBounds().width, __webControlHeight); + __pWebViewer->Invalidate(false); + } + if(__pMostVisitedListView != null && __pAddressbar != null && __pFooterPanel != null) + __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,__webControlPosition.y , GetClientAreaBounds().width, __webControlHeight)); + + Invalidate(true); } void MainForm::ShowFindWordPanel(bool show , bool isTouchPressed) @@ -3145,6 +3075,14 @@ void MainForm::ShowFindWordPanel(bool show , bool isTouchPressed) __pFindWordEditField->SetText(__currentSearchStr); //__pFindWordCountLabel->SetText(L""); __pFindWordCountLabel->SetText(L"0/0"); + __pFindWordPanel->SetShowState(true); + } + else + { + if(__pFindWordPanel != null) + { + __pFindWordPanel->SetShowState(false); + } } AppLog("MainForm::ShowFindWordPanel %d",show); @@ -3162,18 +3100,7 @@ void MainForm::ShowFindWordPanel(bool show , bool isTouchPressed) __pFindWordEditField->HideKeypad(); } - if (__pAddressbar != null) - { - __pAddressbar->SetBounds(__pAddressbar->GetX(), 0 - __pAddressbar->GetHeight(), __pAddressbar->GetWidth(), __pAddressbar->GetHeight()); - __pAddressbar->SetShowState(false); - __pAddressbar->Invalidate(true); - } - if (__pFindWordPanel != null) - { - __pFindWordPanel->SetShowState(show); - __pFindWordPanel->Invalidate(true); - } - Invalidate(true); + RelayoutControls(false); } void @@ -3205,9 +3132,9 @@ void MainForm::OnTextFound(int totalCount, int currentOrdinal) if(totalCount == -1 || totalCount == 0) { - __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),4,__pFindWordCountLabel->GetHeight()); + __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),64,__pFindWordCountLabel->GetHeight()); __pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),214+80,__pFindWordEditField->GetHeight()); - return; +// return; } else if(totalCount > 100) { @@ -3454,6 +3381,7 @@ void MainForm::OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen: __pImageMenu->Show(); __pImageMenu->Invalidate(true); } + __isLongPressedDone = true; __pWebViewer->SetBlockSelectionPosition(currentPosition); @@ -3485,11 +3413,9 @@ MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::Ori AppLog("MainForm::OnOrientationChanged GetClientAreaBounds %d, %d",GetClientAreaBounds().width,GetClientAreaBounds().height); int widthContextItem = 0; - Bitmap *pBitmap = null; - + Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_SEARCH_INPUT_FIELD_BG, __pFooterLabel->GetWidth(), __pFooterLabel->GetHeight()); if (pBitmap != null && __pFooterLabel != null) { - pBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_SEARCH_INPUT_FIELD_BG, __pFooterLabel->GetWidth(), __pFooterLabel->GetHeight()); __pFooterLabel->SetBackgroundBitmap(*pBitmap); delete pBitmap; } @@ -3505,44 +3431,6 @@ MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::Ori widthContextItem = WIDTH_CONTEXT_MENU_BUTTON_PORTRAIT; } - if (__pFindWordPanel != null && __pFindWordPanel->GetShowState() == true) - { - __pFindWordPanel->SetBounds(0,0,GetClientAreaBounds().width,__pFindWordPanel->GetHeight()); - __pFindWordControl->SetBounds(0,0, __pFindWordPanel->GetWidth(), __pFindWordPanel->GetHeight()); - __pFindWordControl->SetShowState(true); - __pFindWordControl->Invalidate(true); - __pFindWordPanel->SetShowState(true); - __pFindWordPanel->Invalidate(true); - } - - if (__pWebViewer != null && __pFooterPanel != null) - { - AppLog("MainForm::OnOrientationChanged GetClientAreaBounds().height %d ", GetClientAreaBounds().height); - __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight(); - - if(__pFooterPanel->GetShowState() == false) - __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, GetClientAreaBounds().height)); - else - __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, __webControlHeight)); - __pWebViewer->Invalidate(true); - - //__pWebViewer->SetBounds(Rectangle(0, 82, GetClientAreaBounds().width,webControlHeight)); - } - if (__pAddressbar != null) - { - if(__pAddressbar->GetShowState() == false) - { - __pAddressbar->SetBounds(__pAddressbar->GetX(), 0 - __pAddressbar->GetHeight(), __pAddressbar->GetWidth(), __pAddressbar->GetHeight()); - } - else - { - __pAddressbar->SetBounds(__pAddressbar->GetX(), 0, __pAddressbar->GetWidth(), __pAddressbar->GetHeight()); - } - //__pAddressbar->SetBounds(Rectangle(0,0,GetClientAreaBounds().width,__pAddressbar->GetHeight())); - //__pAddressbar->SetAddressbarMode(__pAddressbar->GetAddressbarMode()); - SetAddressbarMode(GetAddressbarMode()); - // __pAddressbar->UpdateFaviconBitmap(SettingPresentationModel::GetInstance()->GetPrivateOn()); - } if (__pFindWordBgLabel != null) { // __pFindWordBgLabel->SetSize(GetClientAreaBounds().width,GetClientAreaBounds().height); @@ -3553,7 +3441,7 @@ MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::Ori delete pBitmap; } } - if (__pFooterPanel /*&& __pFooterPanel->GetShowState() == true*/) + if (__pFooterPanel) { AppLog("__pFooterPanel->GetShowState() is true"); InitFooter(); @@ -3569,27 +3457,13 @@ MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::Ori __pMenu->Invalidate(true); } - if (__pFooterPanel) - { - __pFooterPanel->Invalidate(true); - } String homePage = SettingPresentationModel::GetInstance()->GetHomepage(); if (homePage.CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0) { InitMostVisitedSitesView(orientationStatus); } - if(__pMostVisitedListView != null && __pAddressbar != null && __pFooterPanel != null) - { - if(__pAddressbar != null && __pAddressbar->GetShowState() == true) - { - __pMostVisitedListView->SetBounds(__pAddressbar->GetX(),__pAddressbar->GetY()+__pAddressbar->GetHeight(),GetClientAreaBounds().width,GetClientAreaBounds().height - __pAddressbar->GetHeight()- __pFooterPanel->GetHeight()); - } - else if(__pAddressbar != null && __pAddressbar->GetShowState() == false) - { - __pMostVisitedListView->SetBounds(__pAddressbar->GetX(),__pAddressbar->GetY()+__pAddressbar->GetHeight(),GetClientAreaBounds().width,GetClientAreaBounds().height - __pFooterPanel->GetHeight()); - } - } + RelayoutControls(false); if (__pArticleReaderPanel != null) { if (__pArticleReaderPanel->GetShowState() == true) @@ -3785,6 +3659,7 @@ MainForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics AppLog("MainForm::OnTouchPressed %d",__pFindWordPanel->GetShowState()); ShowFindWordPanel(__pFindWordPanel->GetShowState(), true); } + __isLongPressedDone = false; Touch touch; IList* pList = null; @@ -3842,104 +3717,8 @@ MainForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics void MainForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) { - __pWebViewer->ReleaseBlock(); __currentWordIndex = 0; - AppLog("Start MainForm::OnTouchMoved MoveUiControls"); - if(__pFindWordPanel) - { - AppLog("MainForm::OnTouchPressed %d",__pFindWordPanel->GetShowState()); - ShowFindWordPanel(__pFindWordPanel->GetShowState(), true); - } - - if (__pFindWordEditField != null) - { - __pFindWordEditField->HideKeypad(); - } - - /*if (__pAddressbar->GetAddressbarMode() == ADDRESSBAR_MODE_EDIT) - { - return; - }*/ - if (GetAddressbarMode() == ADDRESSBAR_MODE_EDIT) - { - return; - } - static int Count=0; - Touch touch; - IList* pList = null; - pList = touch.GetTouchInfoListN(source); - - if (pList != null) - { - int count = pList->GetCount(); - if (count == 1) - { - AppLogDebug("MainForm::OnTouchMoved count 1"); - TouchInfo* pTouchInfo = static_cast(pList->GetAt(0)); - - if( pTouchInfo == NULL ) - { - return; - } - pTouchInfo->position.y += __pWebViewer->GetY(); - AppLog("MainForm::OnTouchMoved MoveUiControls %d,%d",pTouchInfo->position.x,pTouchInfo->position.y); - - if (__isLoaded == false) - return; - - __distanceMoved = pTouchInfo->position.y - __touchPoint1.y; - __touchPoint1 = pTouchInfo->position; - - // move the address bar and web control according to distance moved - MoveUiControls(); - } - else if (count == 2) - { - AppLogDebug("MainForm::OnTouchMoved count 2"); - - if(Count == 10) - { - TouchInfo* pTouchInfo = static_cast(pList->GetAt(0)); - - if( pTouchInfo == NULL ) - { - return; - } - Point firstPoint = pTouchInfo->position; - - pTouchInfo = static_cast(pList->GetAt(1)); - if( pTouchInfo == NULL ) - { - return; - } - Point secondPoint = pTouchInfo->position; - - if (__touchPoint1 == Point(-1,-1) || __touchPoint2 == Point(-1,-1)) - { - __touchPoint1 = firstPoint; - __touchPoint2 = secondPoint; - delete pList; - return; - } - - int currX1 = firstPoint.x; - int currY1 = firstPoint.y; - int currX2 = secondPoint.x; - int currY2 = secondPoint.y; - - double prevDist = findDistance(__touchPoint1.x,__touchPoint1.y,__touchPoint2.x,__touchPoint2.y); - double dist = findDistance(currX1, currY1, currX2, currY2); - __distanceMoved = prevDist - dist; - - __touchPoint1 = firstPoint; - __touchPoint2 = secondPoint; - MoveUiControls(); - Count = 0; - } - } - Count++; - delete pList; - } + __isLongPressedDone = false; } @@ -4020,15 +3799,20 @@ MainForm::InitMostVisitedSitesView(Tizen::Ui::OrientationStatus orientationStatu __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight(); __pMostVisitedListView = new(std::nothrow) ListView(); - if(__pFooterPanel->GetShowState() == false) + + int height = GetClientAreaBounds().height; + + if(__pFooterPanel->GetShowState() == true) { - r = __pMostVisitedListView->Construct(Tizen::Graphics::Rectangle(0,0 , GetClientAreaBounds().width, GetClientAreaBounds().height),true,false); + height = height - __pFooterPanel->GetHeight(); } - else + if(__pAddressbar->GetShowState() == true) { - r = __pMostVisitedListView->Construct(Tizen::Graphics::Rectangle(0,__pAddressbar->GetBounds().y + __pAddressbar->GetHeight() , GetClientAreaBounds().width, __webControlHeight),true,false); + height -= __pAddressbar->GetHeight(); } + r = __pMostVisitedListView->Construct(Tizen::Graphics::Rectangle(0,0 , GetClientAreaBounds().width, height),true,false); + if (r != E_SUCCESS) { delete __pMostVisitedListView; @@ -4039,12 +3823,6 @@ MainForm::InitMostVisitedSitesView(Tizen::Ui::OrientationStatus orientationStatu __pMostVisitedListView->AddListViewItemEventListener(*this); __pMostVisitedListView->SetTextOfEmptyList(CommonUtil::GetString(L"IDS_BR_BODY_NO_RECENTLY_VISITED_SITES")); AddControl(*__pMostVisitedListView); - AppLog("__pMostVisitedSitesPanel addcontrol %s",GetErrorMessage(r)); - if(__pFooterPanel->GetShowState() == false) - __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,0, GetClientAreaBounds().width, GetClientAreaBounds().height - __pAddressbar->GetHeight() + 14)); - else - __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,0, GetClientAreaBounds().width, GetClientAreaBounds().height - __pAddressbar->GetHeight() - __pFooterPanel->GetHeight() + 14)); - __pMostVisitedListView->UpdateList(); return E_SUCCESS; @@ -4259,7 +4037,7 @@ void MainForm::SetAddressbarMode(AddressBarMode addMode) break; case ADDRESSBAR_MODE_LOADING_COMPLETE: { - SetUrl(__pAddressbar->GetUrl()); +// SetUrl(__pAddressbar->GetUrl()); __pRefreshBtn->SetShowState(true); __pStopBtn->SetShowState(false); diff --git a/src/IntMultipleWindowForm.cpp b/src/IntMultipleWindowForm.cpp index 047c5cd..fdb944b 100644 --- a/src/IntMultipleWindowForm.cpp +++ b/src/IntMultipleWindowForm.cpp @@ -549,12 +549,15 @@ MultipleWindowForm::CreateItem(int index, int itemWidth) __pListIconImage = pAppResource->GetBitmapN(L"I01_icon_default_favicon.png"); } - AppLog("deleteimg %d %d",__pListDeleteImage->GetWidth(),__pListDeleteImage->GetHeight()); + listImageRect.SetBounds(screenBounds.x + 16, screenBounds.y + 28,width, 72); - pagetTitleRect.SetBounds(listImageRect.x + width + 16,10, screenBounds.width - 2 * width - 64, 60); + pagetTitleRect.SetBounds(listImageRect.x + width + 16,10, screenBounds.width - 2 * width - 24 - 64, 60); pageURLRect.SetBounds(pagetTitleRect.x, pagetTitleRect.y + pagetTitleRect.height, screenBounds.width - 2 * width - 120, 48); - deleteImageRect.SetBounds(screenBounds.width - __pListDeleteImage->GetWidth() - 24, (128 - __pListDeleteImage->GetHeight() - 8)/2, __pListDeleteImage->GetWidth() + 8, __pListDeleteImage->GetHeight() + 8); + if(__pListDeleteImage != null) + { + deleteImageRect.SetBounds(screenBounds.width - __pListDeleteImage->GetWidth() - 24, (128 - __pListDeleteImage->GetHeight() - 8)/2, __pListDeleteImage->GetWidth() + 8, __pListDeleteImage->GetHeight() + 8); + } pItem->AddElement(listImageRect, IDA_FORMAT_BITMAP, *__pListIconImage, null, null); if (pageTitle.CompareTo(L"") != 0) diff --git a/src/IntSettingForm.cpp b/src/IntSettingForm.cpp index e932877..176f971 100644 --- a/src/IntSettingForm.cpp +++ b/src/IntSettingForm.cpp @@ -955,46 +955,58 @@ void SettingForm::ClearHistory(void) { String message = CommonUtil::GetString(L"IDS_BR_BODY_DELETE_BROWSER_HISTORY_Q"); - __pConfirmationPopup = new(std::nothrow) ConfirmationPopup(); - __pConfirmationPopup->Initialize(); - __pConfirmationPopup->RemoveActionListener(*this); - __pConfirmationPopup->AddActionListener(*this); - __pConfirmationPopup->setMessage(message); - __pConfirmationPopup->Show(); + if(!__pConfirmationPopup) + { + __pConfirmationPopup = new(std::nothrow) ConfirmationPopup(); + __pConfirmationPopup->Initialize(); + __pConfirmationPopup->RemoveActionListener(*this); + __pConfirmationPopup->AddActionListener(*this); + __pConfirmationPopup->setMessage(message); + __pConfirmationPopup->Show(); + } } void SettingForm::ClearCache(void) { String message = CommonUtil::GetString(L"IDS_BR_POP_DELETE_LOCALLY_CACHED_CONTENT_AND_DATABASES_Q"); - __pConfirmationPopup = new(std::nothrow) ConfirmationPopup(); - __pConfirmationPopup->Initialize(); - __pConfirmationPopup->RemoveActionListener(*this); - __pConfirmationPopup->AddActionListener(*this); - __pConfirmationPopup->setMessage(message); - __pConfirmationPopup->Show(); + if(!__pConfirmationPopup) + { + __pConfirmationPopup = new(std::nothrow) ConfirmationPopup(); + __pConfirmationPopup->Initialize(); + __pConfirmationPopup->RemoveActionListener(*this); + __pConfirmationPopup->AddActionListener(*this); + __pConfirmationPopup->setMessage(message); + __pConfirmationPopup->Show(); + } } void SettingForm::ClearCookie(void) { String message = CommonUtil::GetString(L"IDS_BR_POP_EMPTY_COOKIE_POPUP_BNO"); - __pConfirmationPopup = new(std::nothrow) ConfirmationPopup(); - __pConfirmationPopup->Initialize(); - __pConfirmationPopup->RemoveActionListener(*this); - __pConfirmationPopup->AddActionListener(*this); - __pConfirmationPopup->setMessage(message); - __pConfirmationPopup->Show(); + if(!__pConfirmationPopup) + { + __pConfirmationPopup = new(std::nothrow) ConfirmationPopup(); + __pConfirmationPopup->Initialize(); + __pConfirmationPopup->RemoveActionListener(*this); + __pConfirmationPopup->AddActionListener(*this); + __pConfirmationPopup->setMessage(message); + __pConfirmationPopup->Show(); + } } void SettingForm::ResetToDefault() { String message = CommonUtil::GetString(L"IDS_BR_POP_RESET_ALL_SETTINGS_TO_DEFAULT_Q"); - __pConfirmationPopup = new(std::nothrow) ConfirmationPopup(); - __pConfirmationPopup->Initialize(); - __pConfirmationPopup->RemoveActionListener(*this); - __pConfirmationPopup->AddActionListener(*this); - __pConfirmationPopup->setMessage(message); - __pConfirmationPopup->Show(); + if(!__pConfirmationPopup) + { + __pConfirmationPopup = new(std::nothrow) ConfirmationPopup(); + __pConfirmationPopup->Initialize(); + __pConfirmationPopup->RemoveActionListener(*this); + __pConfirmationPopup->AddActionListener(*this); + __pConfirmationPopup->setMessage(message); + __pConfirmationPopup->Show(); + } } -- 2.7.4