Fix nabi issue(N_SE-35747), display logic about no contects image and Add no contents...
authorTaeHo Choi <thanks.choi@samsung.com>
Mon, 22 Apr 2013 10:47:43 +0000 (19:47 +0900)
committerTaeHo Choi <thanks.choi@samsung.com>
Mon, 22 Apr 2013 11:30:41 +0000 (20:30 +0900)
Change-Id: I3455780288214bfef09330a2862733b2a1a2b3a8
Signed-off-by: TaeHo Choi <thanks.choi@samsung.com>
inc/StScreenTypeForm.h
src/StCertificateTrustedRootForm.cpp
src/StDisplayForm.cpp
src/StDownloadedApplicationForm.cpp
src/StMainMenuForm.cpp
src/StPrivacyForm.cpp
src/StRegionForm.cpp
src/StScreenTypeForm.cpp
src/StWallpaperAlbumListDetailForm.cpp
src/StWallpaperAlbumListForm.cpp
src/StWallpaperAlbumListPresentationModel.cpp

index 2fcc8ef..9af9ce2 100644 (file)
@@ -54,6 +54,7 @@ public:
        virtual void OnGroupedTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated);
        virtual void OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, Tizen::Ui::Controls::TableViewGroupItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
        virtual void OnGroupedTableViewItemStateChanged(Tizen::Ui::Controls::GroupedTableView& tableView, int groupIndex, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status);
+       virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
 
 private:
        Tizen::Base::String GetTitleText(void);
@@ -64,6 +65,7 @@ private:
        void RemovePackageInfoList(void);
        Tizen::Base::String GetScreenType(void);
        Tizen::Base::String GetItemString(int itemIndex);
+       void UpdateTableViewAndNoContent(void);
 
 private:
        int __wallpaperIndex;
index b8c62a6..3dc728d 100644 (file)
@@ -360,7 +360,23 @@ CertificateTrustedRootForm::OnOrientationChanged(const Tizen::Ui::Control& sourc
        {
                if (GetTrustedRootCertificateStoreCount() == 0)
                {
-                       CreateNoContents();
+                       Label* pLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS, false));
+                       if (pLabel != null)
+                       {
+                               Rectangle clientRect = GetClientAreaBounds();
+                               Rectangle labelBound = pLabel->GetBounds();
+
+                               int xPos = (clientRect.width / LINE_COUNT_2) - (labelBound.width / LINE_COUNT_2);
+                               int yPos = (clientRect.height / LINE_COUNT_2) -(labelBound.height / LINE_COUNT_2);
+
+                               pLabel->SetBounds(Rectangle(xPos, yPos, labelBound.width, labelBound.height));
+                               yPos = yPos + pLabel->GetBounds().height;
+                               Label* pTextLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS_TEXT, false));
+                               if (pTextLabel != null)
+                               {
+                                       pTextLabel->SetBounds(Rectangle(0, yPos, clientRect.width, pTextLabel->GetBounds().height));
+                               }
+                       }
                }
                return;
        }
index 3d5a2e8..cc4c36b 100644 (file)
@@ -113,6 +113,7 @@ DisplayForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId
 {
        if (previousSceneId == IDSCN_FONT)
        {
+               __pTableView->RefreshAllItems();
                return;
        }
        __pTableView->UpdateTableView();
@@ -475,12 +476,42 @@ DisplayForm::UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::Tabl
 
        switch (groupIndex)
        {
+       case ID_GROUP_FONT:
+               //fall through
+       case ID_GROUP_AUTO_ROTATE_SCREEN:
+               //fall through
+       case ID_GROUP_BACKLIGHT_TIME_LIST:
+               {
+                       int fontSize = GetFontSize();
+                       Label* pLabel = static_cast<Label*>(pItem->GetControl(0));
+
+                       pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
+                       pLabel->Invalidate(false);
+               }
+               break;
+
        case ID_GROUP_BACKLIGHT_TIME:
                {
                        Bitmap* pBitmap = null;
+                       Label* pLabel = static_cast<Label*>(pItem->GetControl(0));
                        Label* pLabelBitmap = static_cast<Label*>(pItem->GetControl(1));
                        pSubLabel = static_cast<Label*>(pItem->GetControl(2));
 
+                       int fontSize = GetFontSize();
+                       Rectangle mainRectangle;
+                       Rectangle subRectangle;
+                       Rectangle pItemRectangle;
+                       Rectangle detailArrow;
+
+                       pItemRectangle = pItem->GetBounds();
+                       ItemTypeTwoLine(mainRectangle, subRectangle, fontSize);
+
+                       pLabel->SetBounds(mainRectangle);
+                       pLabel->SetTextConfig(fontSize, LABEL_TEXT_STYLE_NORMAL);
+
+                       pItemRectangle.height = (mainRectangle.height + subRectangle.height);
+                       pItem->SetBounds(pItemRectangle);
+
                        if (__pTableView->IsGroupExpanded(ID_GROUP_BACKLIGHT_TIME_LIST))
                        {
                                pBitmap = ResourceManager::GetBitmapN(IDB_DETAIL_BUTTON_EXPAND_OPENED);
@@ -490,18 +521,25 @@ DisplayForm::UpdateItem(int groupIndex, int itemIndex, Tizen::Ui::Controls::Tabl
                                pBitmap = ResourceManager::GetBitmapN(IDB_DETAIL_BUTTON_EXPAND_CLOSED);
                        }
                        pLabelBitmap->SetBackgroundBitmap(*pBitmap);
-                       pLabelBitmap->Invalidate(false);
+
+                       detailArrow = mainRectangle;
+                       detailArrow.y = mainRectangle.y + ((pItemRectangle.height - W_DETAIL_ARROW_BUTTON) / DEVIDE_TWO);
+                       detailArrow.height = W_DETAIL_ARROW_BUTTON;
+                       detailArrow.width = W_DETAIL_ARROW_BUTTON;
+                       pLabelBitmap->SetBounds(detailArrow);
 
                        index = GetBackLightTimeIndex();
                        subItemText = GetBackLightTimeIndexString(index);
-
+                       pSubLabel->SetBounds(subRectangle);
                        pSubLabel->SetText(subItemText);
+                       pSubLabel->SetTextConfig(FONT_SIZE_SUB_TEXT, LABEL_TEXT_STYLE_NORMAL);
+
+                       pLabel->Invalidate(false);
+                       pLabelBitmap->Invalidate(false);
                        pSubLabel->Invalidate(false);
+                       pItem->Invalidate(false);
                }
                break;
-
-       default:
-               break;
        }
 
        Invalidate(true);
index 5a18456..8d24c5d 100644 (file)
@@ -344,7 +344,23 @@ DownloadedApplicationForm::OnGroupedTableViewGroupItemStateChanged(Tizen::Ui::Co
 void
 DownloadedApplicationForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
 {
-       UpdateTableViewAndNoContent();
+       Label* pLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS, false));
+       if (pLabel != null)
+       {
+               Rectangle clientRect = GetClientAreaBounds();
+               Rectangle labelBound = pLabel->GetBounds();
+
+               int xPos = (clientRect.width / LINE_COUNT_2) - (labelBound.width / LINE_COUNT_2);
+               int yPos = (clientRect.height / LINE_COUNT_2) -(labelBound.height / LINE_COUNT_2);
+
+               pLabel->SetBounds(Rectangle(xPos, yPos, labelBound.width, labelBound.height));
+               yPos = yPos + pLabel->GetBounds().height;
+               Label* pTextLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS_TEXT, false));
+               if (pTextLabel != null)
+               {
+                       pTextLabel->SetBounds(Rectangle(0, yPos, clientRect.width, pTextLabel->GetBounds().height));
+               }
+       }
        Invalidate(true);
 }
 
index 881237b..c798b52 100644 (file)
@@ -112,8 +112,8 @@ IFlightModeSetValueAsyncResultListener::OnResultReceivedForSetValueAsync(const T
 
 MainMenuForm::MainMenuForm(void)
        : __currentTableViewList(0)
-       , __pFlightModeSetValueAsyncResultListener(null)
        , __isRunningAppControl(false)
+       , __pFlightModeSetValueAsyncResultListener(null)
 {
 }
 
index a10f59f..ac86cf9 100644 (file)
@@ -530,6 +530,22 @@ PrivacyForm::UpdateTableViewAndNoContent(void)
 void
 PrivacyForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
 {
-       UpdateTableViewAndNoContent();
+       Label* pLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS, false));
+       if (pLabel != null)
+       {
+               Rectangle clientRect = GetClientAreaBounds();
+               Rectangle labelBound = pLabel->GetBounds();
+
+               int xPos = (clientRect.width / LINE_COUNT_2) - (labelBound.width / LINE_COUNT_2);
+               int yPos = (clientRect.height / LINE_COUNT_2) -(labelBound.height / LINE_COUNT_2);
+
+               pLabel->SetBounds(Rectangle(xPos, yPos, labelBound.width, labelBound.height));
+               yPos = yPos + pLabel->GetBounds().height;
+               Label* pTextLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS_TEXT, false));
+               if (pTextLabel != null)
+               {
+                       pTextLabel->SetBounds(Rectangle(0, yPos, clientRect.width, pTextLabel->GetBounds().height));
+               }
+       }
        Invalidate(true);
 }
\ No newline at end of file
index ac13f6b..4a891f1 100644 (file)
@@ -507,7 +507,11 @@ LocaleRegionForm::OnTextValueChanged(const Tizen::Ui::Control& source)
                        searchData.ToLower(toLowerSearchData);
                        inputsearchText.ToLower(toLowerInputSearchText);
 
-                       if ((toLowerSearchData).Contains(toLowerInputSearchText))
+                       StringTokenizer strTok(toLowerSearchData, L":");
+                       String token;
+                       strTok.GetNextToken(token);
+
+                       if ((token).Contains(toLowerInputSearchText))
                        {
                                if (searchData != null)
                                {
index 200a3f4..23007a2 100644 (file)
@@ -91,11 +91,41 @@ ScreenTypeForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousScen
 
                CreateHeader(GetTitleText());
                CreateFooter();
-               CreateTableView();
+               UpdateTableViewAndNoContent();
                AppLogDebug("ENTER");
 
-               __pTableView->UpdateTableView();
-               __pTableView->SetItemChecked(0, 0, true);
+               if (__pPackageAppInfoList != null)
+               {
+                       String applicationId;
+                       String screenType;
+                       if (GetWallpaperIndex() == 0)
+                       {
+                               screenType = SETTING_INFO_KEY_SCREEN_TYPE_HOME;
+                       }
+                       else
+                       {
+                               screenType = SETTING_INFO_KEY_SCREEN_TYPE_LOCK;
+                       }
+                       result r = SettingInfo::GetValue(screenType, applicationId);
+                       AppLogDebug("GetValue(%ls, ..) result=[%s]", applicationId.GetPointer(), GetErrorMessage(r));
+
+                       for (int index = 0; index < __pPackageAppInfoList->GetCount(); index++)
+                       {
+                               PackageAppInfo* pPackageAppInfo = dynamic_cast<PackageAppInfo*>(__pPackageAppInfoList->GetAt(index));
+                               if (pPackageAppInfo)
+                               {
+                                       if (applicationId.CompareTo(pPackageAppInfo->GetAppId()) == 0)
+                                       {
+                                               AppLogDebug("index [%d]", index);
+                                               if (__pTableView != null)
+                                               {
+                                                       __pTableView->SetItemChecked(0, index, true);
+                                               }
+                                               break;
+                                       }
+                               }
+                       }
+               }
        }
        else
        {
@@ -501,4 +531,105 @@ ScreenTypeForm::GetItemString(int itemIndex)
        }
 
        return returnValue;
+}
+
+void
+ScreenTypeForm::UpdateTableViewAndNoContent(void)
+{
+       bool createTableView = false;
+       if (__pTableView != null)
+       {
+               if (GetPackageAppInfoListCount() != 0)
+               {
+                       __pTableView->UpdateTableView();
+                       return;
+               }
+       }
+       else
+       {
+               if (GetPackageAppInfoListCount() != 0)
+               {
+                       createTableView = true;
+               }
+       }
+
+       if (__pTableView != null)
+       {
+               int tableViewControlCount = __pTableView->GetControlCount();
+               for (int i = 0; i < tableViewControlCount; i++)
+               {
+                       __pTableView->RemoveControl(__pTableView->GetControl(0));
+               }
+//             __pTableView->RemoveAllControls();
+               __pTableView = null;
+       }
+       int controlCount = GetControlCount();
+       for (int i = 0; i < controlCount; i++)
+       {
+               RemoveControl(GetControl(0));
+       }
+//     RemoveAllControls();
+
+       if (createTableView)
+       {
+               CreateTableView();
+               __pTableView->UpdateTableView();
+       }
+       else
+       {
+               Label* pLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS, false));
+               if (pLabel == null)
+               {
+                       Rectangle clientRect = GetClientAreaBounds();
+                       Bitmap* pBitmp = ResourceManager::GetBitmapN(IDB_NO_CONTENTS);
+
+                       int bitmapWidth = pBitmp->GetWidth();
+                       int bitmapHeight = pBitmp->GetHeight();
+                       String labelText = ResourceManager::GetString(L"IDS_ST_BODY_NO_CONTENT");
+                       Color textColor = COLOR_HELP_TEXT_TYPE_03_NORMAL;
+                       int noContentTextHeight = GetHeightForStringArea(labelText, bitmapWidth, 32);
+
+                       int xPos = (clientRect.width / LINE_COUNT_2) - (bitmapWidth / DEVIDE_TWO);
+                       int yPos = (clientRect.height / LINE_COUNT_2) - ((bitmapHeight + noContentTextHeight) / DEVIDE_TWO);
+
+                       Label* pLabel = new (std::nothrow) Label();
+                       pLabel->Construct(Rectangle(xPos, yPos, bitmapWidth, bitmapHeight), L"");
+                       pLabel->SetName(NO_CONTENTS);
+                       pLabel->SetBackgroundBitmap(*pBitmp);
+
+                       yPos = yPos + bitmapHeight;
+
+                       Label* pLabelNoContents = new (std::nothrow) Label();
+                       pLabelNoContents->Construct(Rectangle(0, yPos, clientRect.width, noContentTextHeight), L"");
+                       pLabelNoContents->SetName(NO_CONTENTS_TEXT);
+                       pLabelNoContents->SetTextColor(textColor);
+                       pLabelNoContents->SetText(labelText);
+
+                       AddControl(*pLabel);
+                       AddControl(*pLabelNoContents);
+               }
+       }
+}
+
+void
+ScreenTypeForm::OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus)
+{
+       Label* pLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS, false));
+       if (pLabel != null)
+       {
+               Rectangle clientRect = GetClientAreaBounds();
+               Rectangle labelBound = pLabel->GetBounds();
+
+               int xPos = (clientRect.width / LINE_COUNT_2) - (labelBound.width / LINE_COUNT_2);
+               int yPos = (clientRect.height / LINE_COUNT_2) -(labelBound.height / LINE_COUNT_2);
+
+               pLabel->SetBounds(Rectangle(xPos, yPos, labelBound.width, labelBound.height));
+               yPos = yPos + pLabel->GetBounds().height;
+               Label* pTextLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS_TEXT, false));
+               if (pTextLabel != null)
+               {
+                       pTextLabel->SetBounds(Rectangle(0, yPos, clientRect.width, pTextLabel->GetBounds().height));
+               }
+       }
+       Invalidate(true);
 }
\ No newline at end of file
index 5083524..5f8b409 100644 (file)
@@ -352,7 +352,23 @@ WallpaperAlbumListDetailForm::OnOrientationChanged(const Tizen::Ui::Control& sou
 {
        if (__pIconListView == null)
        {
-               UpdateIconListView();
+               Label* pLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS, false));
+               if (pLabel != null)
+               {
+                       Rectangle clientRect = GetClientAreaBounds();
+                       Rectangle labelBound = pLabel->GetBounds();
+
+                       int xPos = (clientRect.width / LINE_COUNT_2) - (labelBound.width / LINE_COUNT_2);
+                       int yPos = (clientRect.height / LINE_COUNT_2) -(labelBound.height / LINE_COUNT_2);
+
+                       pLabel->SetBounds(Rectangle(xPos, yPos, labelBound.width, labelBound.height));
+                       yPos = yPos + pLabel->GetBounds().height;
+                       Label* pTextLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS_TEXT, false));
+                       if (pTextLabel != null)
+                       {
+                               pTextLabel->SetBounds(Rectangle(0, yPos, clientRect.width, pTextLabel->GetBounds().height));
+                       }
+               }
        }
        else
        {
@@ -394,7 +410,19 @@ WallpaperAlbumListDetailForm::SetAllAlbumPathList(void)
        delete __pAlbumPathList;
        __pAlbumPathList = null;
        IList* pAlbumInfoList = __pPresentationModel->GetAlbumInfoList();
+       if (pAlbumInfoList == null)
+       {
+               AppLogDebug("pAlbumInfoList is null");
+               return;
+       }
+
        AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(pAlbumInfoList->GetAt(0));
+       if (pAlbumInfo == null)
+       {
+               AppLogDebug("pAlbumInfo is null");
+               return;
+       }
+
        ArrayList* pAlbumPathList = new (std::nothrow) ArrayList(SingleObjectDeleter);
        pAlbumPathList->Construct();
        pAlbumPathList->Add(*(new (std::nothrow) String(allAlbumsString)));
index ddaef8d..57d4968 100644 (file)
@@ -237,7 +237,23 @@ WallpaperAlbumListForm::OnOrientationChanged(const Tizen::Ui::Control& source, T
        }
        else
        {
-               UpdateIconListView();
+               Label* pLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS, false));
+               if (pLabel != null)
+               {
+                       Rectangle clientRect = GetClientAreaBounds();
+                       Rectangle labelBound = pLabel->GetBounds();
+
+                       int xPos = (clientRect.width / LINE_COUNT_2) - (labelBound.width / LINE_COUNT_2);
+                       int yPos = (clientRect.height / LINE_COUNT_2) -(labelBound.height / LINE_COUNT_2);
+
+                       pLabel->SetBounds(Rectangle(xPos, yPos, labelBound.width, labelBound.height));
+                       yPos = yPos + pLabel->GetBounds().height;
+                       Label* pTextLabel = static_cast<Label*>(this->GetControl(NO_CONTENTS_TEXT, false));
+                       if (pTextLabel != null)
+                       {
+                               pTextLabel->SetBounds(Rectangle(0, yPos, clientRect.width, pTextLabel->GetBounds().height));
+                       }
+               }
        }
        Invalidate(true);
 }
index a08813b..d0bd6eb 100644 (file)
@@ -495,12 +495,20 @@ WallpaperAlbumListPresentationModel::GetMinMaxDateTimeString(IList* pContentIdLi
 int
 WallpaperAlbumListPresentationModel::GetFolderCount(void)
 {
+       if (__pAlbumInfoList == null)
+       {
+               return 0;
+       }
        return __pAlbumInfoList->GetCount();
 }
 
 int
 WallpaperAlbumListPresentationModel::GetFileCount(void)
 {
+       if (__pCurrentFolderContentsIdList == null)
+       {
+               return 0;
+       }
        return __pCurrentFolderContentsIdList->GetCount();
 }
 
@@ -525,6 +533,11 @@ WallpaperAlbumListPresentationModel::InitializeFileList(Tizen::Base::Collection:
                __pCurrentFolderContentsIdList = null;
        }
 
+       if (pAlbumPathList == null)
+       {
+               return;
+       }
+
        __pCurrentFolderContentsIdList = new (std::nothrow) ArrayList(SingleObjectDeleter);
        int albumInfoDirectoryIndex = 0;
        while (albumInfoDirectoryIndex < pAlbumPathList->GetCount())