Fixed Nabi Issues N_SE-53372,54974,55228,48389,55044
authorVinay Sachdeva <v.sachdeva@samsung.com>
Sun, 13 Oct 2013 19:08:53 +0000 (00:38 +0530)
committerVinay Sachdeva <v.sachdeva@samsung.com>
Sun, 13 Oct 2013 19:08:53 +0000 (00:38 +0530)
Change-Id: I8e8d6ee1a2b49802052520cbea647991382c3b7e
Signed-off-by: Vinay Sachdeva <v.sachdeva@samsung.com>
inc/IntMainForm.h
inc/IntTypes.h
src/IntAddBookmarkForm.cpp
src/IntMainForm.cpp
src/IntSettingForm.cpp

index ec71fa1..dcf7ff0 100644 (file)
@@ -323,6 +323,7 @@ private:
        Tizen::Base::String     __currentSelectedStr;
        int __distanceMoved;
        int __webControlHeight;
+       float __webControlHeightF;
        float __previousZoomLevel;
        int     __maxOccurrances;
        int     __currentWordIndex;
@@ -384,6 +385,7 @@ private:
        Tizen::Graphics::Point __touchPoint1;
        Tizen::Graphics::Point __touchPoint2;
        Tizen::Graphics::Point __webControlPosition;
+       Tizen::Graphics::FloatPoint __webControlPositionF;
 
        Tizen::Ui::Controls::ListContextItem* __pItemContext;
        Tizen::Ui::Controls::ListContextItem* __pItemContextLandscape;
index 8caa8d2..6a43068 100644 (file)
@@ -35,6 +35,7 @@ static const int MAX_NOTEBOOK_TABLE_COLUMN = 8;
 static const int IDA_BUTTON_NO = 1000;
 static const int IDA_BUTTON_YES = 1001;
 
+const int UPDATE_LIST_COMPLETE = 995;
 const int UPDATE_MAINFORM_FOOTER_ON_WINDOWCLOSED = 996;
 const int APPCONTROL_LAUNCH_MAX_LIMIT_REACHED = 997;
 const int FORE_GROUND_APP_EVENT = 998;
index 3dcb831..3f139a4 100644 (file)
@@ -233,13 +233,21 @@ AddBookmarkForm::OnActionPerformed(const Control& source, int actionId)
                }
                else
                {
-                       String tempUrl = L"http://";
-                       tempUrl.Append(Url);
+                       String tempUrl;
+                       if(Url.Contains("http://") == true)
+                       {
+                               tempUrl.Append(Url);
+                       }
+                       else
+                       {
+                               tempUrl = L"http://";
+                               tempUrl.Append(Url);
+                       }
 
-                       if (flag == true)
+                       if(flag == true)
                        {
                                valid = true;
-                               Url= tempUrl ;
+                               Url = tempUrl;
                        }
                }
 
index bf032c7..c8b8d66 100644 (file)
@@ -201,6 +201,7 @@ MainForm::MainForm(void)
        __pBlankPanel = null;
        __pArticleReaderLabel = null;
        __webControlHeight = 0;
+       __webControlHeightF = 0;
        __prevAddressBarMode = ADDRESSBAR_MODE_INVALID;
        __curAddressBarMode = ADDRESSBAR_MODE_INVALID;
        __pMostVisitedSites = null;
@@ -458,6 +459,7 @@ MainForm::InitWebControl()
        const int Y_WEBCONTROL_POSITION = 0;
 
        __webControlHeight = GetHeight() - __pFooterPanel->GetHeight();
+       __webControlHeightF = GetHeightF() - __pFooterPanel->GetHeightF();
 
        if (__pMostVisitedListView)
        {
@@ -495,6 +497,7 @@ MainForm::InitWebControl()
                        return r;
                }
                __webControlPosition = __pWebViewer->GetPosition();
+               __webControlPositionF = __pWebViewer->GetPositionF();
                r = __pWebViewer->SetSetting(SettingPresentationModel::GetInstance()->GetWebSettings());
                if (IsFailed(r))
                {
@@ -563,6 +566,7 @@ MainForm::InitFooter(void)
        {
                return E_FAILURE;
        }
+//     __pFooterPanel->SetBackgroundColor(Color(255,0,0));
        //__pFooterPanel->SetBackgroundColor(CUSTOM_COLOR_TRANSPARENT);
        Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_SEARCH_INPUT_FIELD_BG, __pFooterLabel->GetWidth(), __pFooterLabel->GetHeight());
        if (pBitmap != null)
@@ -2403,7 +2407,9 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                if (__pAddressbar != null && __pWebViewer != NULL)
                {
                        __webControlPosition.y = __pAddressbar->GetHeight() - 12;
+                       __webControlPositionF.y = __pAddressbar->GetHeightF() - 12.0f;
                        __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight() - ( /*__pAddressbar->GetY() +*/ __pAddressbar->GetHeight() - 12);
+                       __webControlHeightF = GetClientAreaBoundsF().height - __pFooterPanel->GetHeightF() - ( /*__pAddressbar->GetY() +*/ __pAddressbar->GetHeightF() - 12.0f);
 
                        if (__pFooterPanel->GetShowState() == false)
                                __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, GetClientAreaBounds().height - ( /*__pAddressbar->GetY() +*/ __pAddressbar->GetHeight() - 12)));
@@ -2837,7 +2843,8 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
        InitFooter();
        InitAddressbar();
 
-       __pFooterPanel->SetBounds(0, GetClientAreaBounds().height - __pFooterPanel->GetHeight(), GetClientAreaBounds().width, __pFooterPanel->GetHeight());
+       FloatRectangle footerPanelBounds = FloatRectangle(0.0f, (GetClientAreaBoundsF().height) - __pFooterPanel->GetHeightF(), GetClientAreaBoundsF().width, __pFooterPanel->GetHeightF());
+       __pFooterPanel->SetBounds(CoordinateSystem::AlignToDevice(footerPanelBounds));
 
        // hiding the address bar
        //      __pAddressbar->SetBounds(__pAddressbar->GetX(), __pAddressbar->GetY() - __pAddressbar->GetHeight(), __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
@@ -3754,6 +3761,7 @@ MainForm::OnAddressBarModeChanged(/*const Addressbar& addBar*/)
                if (__pAddressbar != null)
                {
                        __webControlPosition.y = __pAddressbar->GetHeight() - 12;
+                       __webControlPositionF.y = __pAddressbar->GetHeightF() - 12.0f;
                        __pAddressbar->SetBounds(Rectangle(0,0,GetClientAreaBounds().width,__pAddressbar->GetHeight()));
                        __pAddressbar->Invalidate(true);
                }
@@ -3768,6 +3776,7 @@ MainForm::OnAddressBarModeChanged(/*const Addressbar& addBar*/)
                if (__pAddressbar != null)
                {
                        __webControlPosition.y = 0;
+                       __webControlPositionF.y = 0.0f;
                        __pAddressbar->SetBounds(Rectangle(0, __pAddressbar->GetY() - __pAddressbar->GetHeight(), GetClientAreaBounds().width, __pAddressbar->GetHeight()));
                        __pAddressbar->Invalidate(true);
                }
@@ -4264,29 +4273,37 @@ MainForm::RelayoutControls(bool showAddressbar,bool relayoutFooter)
 {
        AppLog("xyz:: MainForm::RelayoutControls called");
        __webControlPosition.y = 0;
+       __webControlPositionF.y = 0.0f;
        __webControlHeight = GetClientAreaBounds().height;
+       __webControlHeightF = GetClientAreaBoundsF().height;
        AppLog("Client area height: %d width %d", __webControlHeight,GetClientAreaBounds().width);
 
        AppLog("Client area height: %d", __webControlHeight);
        if(__pAddressbar != null && __pAddressbar->GetShowState() == true)
        {
                __webControlPosition.y += __pAddressbar->GetHeight();
+               __webControlPositionF.y += __pAddressbar->GetHeightF();
                __webControlHeight -= __pAddressbar->GetHeight();
+               __webControlHeightF -= __pAddressbar->GetHeightF();
                __pAddressbar->SetBounds(0, 0, __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
        }
        else if(__pFindWordControl != null && __pFindWordControl->GetShowState() == true)
        {
                __webControlPosition.y += __pFindWordControl->GetHeight();
+               __webControlPositionF.y += __pFindWordControl->GetHeightF();
                __webControlHeight -= __pFindWordControl->GetHeight();
+               __webControlHeightF -= __pFindWordControl->GetHeightF();
                __pFindWordControl->SetBounds(0, 0, GetClientAreaBounds().width, __pFindWordControl->GetHeight());
        }
 
        if(__pFooterPanel != null && __pFooterPanel->GetShowState() == true && relayoutFooter == true)
        {
                __webControlHeight -= __pFooterPanel->GetHeight();
+               __webControlHeightF -= __pFooterPanel->GetHeightF();
 
-               __pFooterPanel->SetBounds(0, __webControlPosition.y + __webControlHeight, GetClientAreaBounds().width, __pFooterPanel->GetHeight());
+               __pFooterPanel->SetBounds(CoordinateSystem::AlignToDevice(FloatRectangle(0.0F, __webControlPositionF.y + __webControlHeightF, GetClientAreaBoundsF().width, __pFooterPanel->GetHeightF())));
                __webControlHeight = __webControlHeight + 12;
+               __webControlHeightF = __webControlHeightF + 12.0f;
        }
        if (__pWebViewer != null && __pWebViewer->GetShowState() == true)
        {
@@ -4919,8 +4936,8 @@ MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::Ori
 {
        AppLog("MainForm::OnOrientationChanged GetClientAreaBounds %d, %d",GetClientAreaBounds().width,GetClientAreaBounds().height);
        int widthContextItem = 0;
-       if(__pFindWordCountLabel)
-               __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),124,__pFindWordCountLabel->GetHeight());
+       //if(__pFindWordCountLabel)
+       //      __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),124,__pFindWordCountLabel->GetHeight());
        // As per the platform engineer comment removed this line
        /*if(__pWebViewer != null)
        {
@@ -4997,7 +5014,7 @@ MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::Ori
        {
                AppLog("__pFooterPanel->GetShowState() is true");
                InitFooter();
-               __pFooterPanel->SetBounds(0, GetClientAreaBounds().height - __pFooterPanel->GetHeight(), __pFooterPanel->GetWidth(), __pFooterPanel->GetHeight());
+               __pFooterPanel->SetBounds(CoordinateSystem::AlignToDevice(FloatRectangle(0, GetClientAreaBoundsF().height - __pFooterPanel->GetHeightF(), __pFooterPanel->GetWidthF(), __pFooterPanel->GetHeightF())));
                __pFooterPanel->Invalidate(true);
        }
        InitAddressbar();
@@ -5452,6 +5469,7 @@ MainForm::InitMostVisitedSitesView(Tizen::Ui::OrientationStatus orientationStatu
        HistoryPresentationModel::GetInstance()->GetMostVisitedSites(*__pMostVisitedSites);
 
        __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight();
+       __webControlHeightF = GetClientAreaBoundsF().height - __pFooterPanel->GetHeightF();
        __pMostVisitedListView = new(std::nothrow) ListView();
 
        int height = GetClientAreaBounds().height;
index 62a905f..c8fb37c 100644 (file)
@@ -358,8 +358,8 @@ SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int gr
                }
                settingInfo[parentIndex].subText = settingInfo[effectiveIndex].titleText;
 
-//             listView.RefreshList(groupIndex, itemIndex - (effectiveIndex - parentIndex), LIST_REFRESH_TYPE_ITEM_MODIFY);
-//             listView.RefreshList(groupIndex, parentIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
+               listView.RefreshList(groupIndex, itemIndex - (effectiveIndex - parentIndex), LIST_REFRESH_TYPE_ITEM_MODIFY);
+               listView.RefreshList(groupIndex, parentIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
                for (int iter = 0; iter < settingInfo[parentIndex].childCount; iter++)
                {
                        if (parentIndex + iter + 1 != effectiveIndex)
@@ -377,7 +377,7 @@ SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int gr
                                settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
                                settingInfo[SETTING_FAVORITE_URL].isSelected = true;
                        }
-//                     listView.RefreshList(groupIndex, itemIndex - (effectiveIndex - parentIndex) + iter + 1, LIST_REFRESH_TYPE_ITEM_MODIFY);
+                       listView.RefreshList(groupIndex, itemIndex - (effectiveIndex - parentIndex) + iter + 1, LIST_REFRESH_TYPE_ITEM_MODIFY);
                }
 //             listView.UpdateList();
                //listView.ScrollToItem(groupIndex, itemIndex, LIST_SCROLL_ITEM_ALIGNMENT_TOP);
@@ -413,7 +413,7 @@ SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int gr
                        settingInfo[SETTING_FAVORITE_URL].titleText = __currentURL;
 //                     listView.RefreshList(groupIndex, effectiveIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
 //                     listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
-                       listView.UpdateList();
+//                     listView.UpdateList();
                }
                break;
        case SETTING_BLANK_PAGE:
@@ -421,13 +421,13 @@ SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int gr
                SettingPresentationModel::GetInstance()->SetHomepage((L"IDS_BR_BODY_BLANK_PAGE"));
                AppLog("GetHomepage() %ls",SettingPresentationModel::GetInstance()->GetHomepage().GetPointer());
 //             listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
-               listView.UpdateList();
+//             listView.UpdateList();
 
                break;
        case SETTING_MOST_VISITED_SITE:
                SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_MOST_VISITED_SITES");
 //             listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
-               listView.UpdateList();
+//             listView.UpdateList();
                break;
 
        case SETTING_FAVORITE_URL:
@@ -438,13 +438,13 @@ SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int gr
        case SETTING_FIT_TO_WIDTH:
                SettingPresentationModel::GetInstance()->SetDefaultView(L"IDS_BR_BODY_FIT_TO_WIDTH");
 //             listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
-               listView.UpdateList();
+//             listView.UpdateList();
                break;
 
        case SETTING_READABLE:
                SettingPresentationModel::GetInstance()->SetDefaultView(L"IDS_BR_BODY_READABLE");
 //             listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
-               listView.UpdateList();
+//             listView.UpdateList();
                break;
 
        case SETTING_RUN_JAVASCRIPT:
@@ -498,19 +498,19 @@ SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int gr
        case SETTING_SEARCH_ENGINE_YAHOO:
                SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_YAHOO].titleText);
 //             listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
-               listView.UpdateList();
+//             listView.UpdateList();
                break;
 
        case SETTING_SEARCH_ENGINE_NAVER:
                SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_NAVER].titleText);
 //             listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
-               listView.UpdateList();
+//             listView.UpdateList();
                break;
 
        case SETTING_SEARCH_ENGINE_GOOGLE:
                SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].titleText);
 //             listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
-               listView.UpdateList();
+//             listView.UpdateList();
                break;
 
        case SETTING_RESET_TO_DEFAULT:
@@ -612,10 +612,19 @@ SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
 
                pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
                pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
-               if(__pList != null)
-               {
-                       __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
-               }
+//             if(__pList != null)
+//             {
+//                     __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
+//             }
+
+               ArrayList *pList = new(std::nothrow) ArrayList();
+               pList->Construct();
+               Integer *pGroupIndex = new Integer(groupIndex);
+               Integer *pItemIndex = new Integer(itemIndex);
+               pList->Add(pGroupIndex);
+               pList->Add(pItemIndex);
+               AppLog("sending event UPDATE_LIST_COMPLETE");
+               SendUserEvent(UPDATE_LIST_COMPLETE,pList);
 
                pItem->SetText(settingInfo[effectiveIndex].titleText);
                pItem->Make();
@@ -728,7 +737,15 @@ SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
                //      pItem->AddElement(Rectangle(0, 0, 10, 112), IDA_LIST_LEFT_SIDE_MARGIN, *pBitmap, null);
 
 //             pItem->SetSelected(settingInfo[effectiveIndex].isSelected);
-               __pList->SetItemChecked(groupIndex,itemIndex,settingInfo[effectiveIndex].isSelected);
+//             __pList->SetItemChecked(groupIndex,itemIndex,settingInfo[effectiveIndex].isSelected);
+               ArrayList *pList = new(std::nothrow) ArrayList();
+               pList->Construct();
+               Integer *pGroupIndex = new Integer(groupIndex);
+               Integer *pItemIndex = new Integer(itemIndex);
+               pList->Add(pGroupIndex);
+               pList->Add(pItemIndex);
+               AppLog("sending event UPDATE_LIST_COMPLETE");
+               SendUserEvent(UPDATE_LIST_COMPLETE,pList);
                pItem->Make();
 
                return pItem;
@@ -1207,4 +1224,25 @@ SettingForm::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection:
                        __pConfirmationPopup = null;
                }
        }
+       else if (requestId == UPDATE_LIST_COMPLETE)
+       {
+               AppLog("receiving event UPDATE_LIST_COMPLETE");
+               Integer *pGroupIndex = static_cast<Integer*>(pArgs->GetAt(0));
+               Integer *pItemIndex = static_cast<Integer*>(pArgs->GetAt(1));
+               int groupIndex = pGroupIndex->ToInt();
+               int itemIndex = pItemIndex->ToInt();
+
+               int effectiveIndex = 0;
+               for (int i = 0; i < groupIndex; i++)
+                       effectiveIndex = effectiveIndex + pGroupItemCount[i];
+               effectiveIndex = effectiveIndex + itemIndex;
+
+
+               if(settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE || settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO )
+               {
+                       __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
+               }
+
+       }
 }
+