Fixed Jira issue and fixed the issue that is changed to ContextItem pos
authorMyunkyu <mk70.kang@partner.samsung.com>
Mon, 22 Apr 2013 09:38:35 +0000 (18:38 +0900)
committerMyunkyu <mk70.kang@partner.samsung.com>
Mon, 22 Apr 2013 09:38:35 +0000 (18:38 +0900)
Change-Id: I495cc0aadb91888b5d061dbfe57b18e376dddde6

inc/MpMusicPlayerForm.h
src/MpAlbumListPanel.cpp
src/MpAllListPanel.cpp
src/MpArtistContentListForm.cpp
src/MpArtistListPanel.cpp
src/MpCommonUtil.cpp
src/MpFolderListPanel.cpp
src/MpMusicPlayerApp.cpp
src/MpMusicPlayerForm.cpp
src/MpPlaylistListPanel.cpp

index dbfc04e..b5bbd99 100644 (file)
@@ -120,7 +120,7 @@ public:
 
        virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
 
-       virtual void OnChangedContentList(Tizen::Base::Collection::IList* pArgs);
+       virtual void OnChangedContentListByAppControlN(Tizen::Base::Collection::IList* pArgs);
        virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
 
        virtual void OnThumbnailInfoReveivedN(ThumbnailInfo* pThumbnailInfo);
index 4898fa9..eb0fd29 100644 (file)
@@ -283,10 +283,6 @@ AlbumListPanel::OnTableViewContextItemActivationStateChanged(Tizen::Ui::Controls
        if (activated == true)
        {
                __itemIndex = itemIndex;
-
-               pContextItem->SetSize(GetWidth(), ITEM_HEIGHT);
-               (pContextItem->GetControl(0))->SetSize(pContextItem->GetSize());
-               pContextItem->Invalidate(true);
        }
        AppLogDebug("EXIT");
 }
index d9d4e1e..883eb2c 100644 (file)
@@ -504,10 +504,6 @@ AllListPanel::OnTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::
        if (activated == true)
        {
                __itemIndex = itemIndex;
-
-               pContextItem->SetSize(GetWidth(), ITEM_HEIGHT);
-               (pContextItem->GetControl(0))->SetSize(pContextItem->GetSize());
-               pContextItem->Invalidate(true);
        }
        AppLogDebug("EXIT");
 }
index b7bbc87..eeb5525 100644 (file)
@@ -376,10 +376,6 @@ ArtistContentListForm::OnGroupedTableViewContextItemActivationStateChanged(Tizen
        {
                __activatedStateContextItem.__groupIndex = groupIndex;
                __activatedStateContextItem.__itemIndex = itemIndex;
-
-               pContextItem->SetSize(GetWidth(), ITEM_HEIGHT);
-               (pContextItem->GetControl(0))->SetSize(pContextItem->GetSize());
-               pContextItem->Invalidate(true);
        }
        AppLogDebug("EXIT");
 }
index 4083099..33459ce 100644 (file)
@@ -301,10 +301,6 @@ ArtistListPanel::OnTableViewContextItemActivationStateChanged(Tizen::Ui::Control
        if (activated == true)
        {
                __itemIndex = itemIndex;
-
-               pContextItem->SetSize(GetWidth(), ITEM_HEIGHT);
-               (pContextItem->GetControl(0))->SetSize(pContextItem->GetSize());
-               pContextItem->Invalidate(true);
        }
        AppLogDebug("EXIT");
 }
index 64a582c..eb74a90 100644 (file)
@@ -777,23 +777,31 @@ CommonUtil::CreateTableViewContextItemN(Tizen::Ui::IActionEventListener& listene
        pTableViewContextItem->AddControl(*pItem);
        pTableViewContextItem->SetIndividualSelectionEnabled(pItem, true);
 
-//     int controlCount = pItem->GetControlCount();
-//     if (controlCount != INIT_VALUE)
-//     {
-//              Tizen::Ui::GridLayout* pGridLayout = dynamic_cast<Tizen::Ui::GridLayout*>(pItem->GetLandscapeLayoutN());
-//              if (pGridLayout != null)
-//              {
-//                      int margin = 80;
-//                      if (controlCount == 1)
-//                      {
-//                              margin = 106;
-//                      }
-//
-//                      pGridLayout->SetColumnSpacing(controlCount, margin);
-//                      pGridLayout->Update();
-//                      delete pGridLayout;
-//              }
-//     }
+       Form* pForm  = dynamic_cast<Form*>(UiApp::GetInstance()->GetAppFrame()->GetFrame()->GetCurrentForm());
+       if (pForm != null)
+       {
+               if (pForm->GetBounds().width == 1200 || pForm->GetBounds().height == 1200)
+               {
+                       int controlCount = pItem->GetControlCount();
+                       if (controlCount != INIT_VALUE)
+                       {
+                                Tizen::Ui::GridLayout* pGridLayout = dynamic_cast<Tizen::Ui::GridLayout*>(pItem->GetLandscapeLayoutN());
+                                if (pGridLayout != null)
+                                {
+                                        int margin = 80;
+                                        if (controlCount == 1)
+                                        {
+                                                margin = 106;
+                                        }
+
+                                        pGridLayout->SetColumnSpacing(controlCount, margin);
+                                        pGridLayout->Update();
+                                        delete pGridLayout;
+                                }
+                       }
+               }
+       }
+
        AppLogDebug("EXIT");
        return pTableViewContextItem;
 }
index b48de2e..d169427 100644 (file)
@@ -266,10 +266,6 @@ FolderListPanel::OnTableViewContextItemActivationStateChanged(Tizen::Ui::Control
        if (activated == true)
        {
                __itemIndex = itemIndex;
-
-               pContextItem->SetSize(GetWidth(), ITEM_HEIGHT);
-               (pContextItem->GetControl(0))->SetSize(pContextItem->GetSize());
-               pContextItem->Invalidate(true);
        }
        AppLogDebug("EXIT");
 }
index 4ec6395..1df55cf 100644 (file)
@@ -204,20 +204,6 @@ MusicPlayerApp::OnForeground(void)
        Frame* pFrame = GetFrameAt(0);
        AppAssert(pFrame);
 
-       SceneManager* pSceneManager = SceneManager::GetInstance();
-       AppAssert(pSceneManager);
-
-       SceneId currentSceneId = pSceneManager->GetCurrentSceneId();
-       if (currentSceneId.Equals(__sceneId, false) && __sceneId.Equals(IDSCN_PLAYER, false) == true)
-       {
-               Scene* pScene = pSceneManager->GetCurrentScene();
-               PlayerForm* pPlayerForm = dynamic_cast<PlayerForm*>(pScene->GetForm());
-               if (pPlayerForm != null)
-               {
-                       pPlayerForm->OnChangedContentList(__pDataList);
-               }
-       }
-
        if (pFrame->IsEnabled() == false)
        {
                pFrame->SetEnabled(true);
@@ -300,7 +286,26 @@ MusicPlayerApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::
 
        if (__pMainFrame != null)
        {
-               result r = __pMainFrame->GoToInitialScene(__sceneId, __pDataList);
+               SceneManager* pSceneManager = SceneManager::GetInstance();
+               AppAssert(pSceneManager);
+
+               result r = E_FAILURE;
+               SceneId currentSceneId = pSceneManager->GetCurrentSceneId();
+               if (currentSceneId.Equals(__sceneId, false) && __sceneId.Equals(IDSCN_PLAYER, false) == true)
+               {
+                       Scene* pScene = pSceneManager->GetCurrentScene();
+                       PlayerForm* pPlayerForm = dynamic_cast<PlayerForm*>(pScene->GetForm());
+                       if (pPlayerForm != null)
+                       {       
+                               pPlayerForm->OnChangedContentListByAppControlN(__pDataList);
+                               r = E_SUCCESS;
+                       }
+               }
+               else
+               {
+                        r = __pMainFrame->GoToInitialScene(__sceneId, __pDataList);
+               }
+
                if (r == E_SUCCESS)
                {
                        __pDataList = null;
index 6c4ec31..ce0a5a6 100644 (file)
@@ -1171,6 +1171,9 @@ PlayerForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
                {
                        AppLogDebug("__pPlayerPresentationModel->SetContentList failed(%s)", GetErrorMessage(GetLastResult()));
                        SetPlayerScreenState(PLAYER_SCREEN_STATE_NO_CONTENT_LIST);
+
+                       pArgs->RemoveAll();
+                       delete pArgs;
                        return;
                }
 
@@ -1236,31 +1239,41 @@ PlayerForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
 }
 
 void
-PlayerForm::OnChangedContentList(Tizen::Base::Collection::IList* pArgs)
+PlayerForm::OnChangedContentListByAppControlN(Tizen::Base::Collection::IList* pArgs)
 {
        AppLogDebug("ENTER");
        MusicPlayerApp* pMusicPlayerApp = static_cast<MusicPlayerApp*>(MusicPlayerApp::GetInstance());
        TryReturnVoid(pMusicPlayerApp != null, "Unable to cast UiApp to MusicPlayerApp");
 
-       if (pArgs != null)
+       SetPlayerScreenState(PLAYER_SCREEN_STATE_APP_CONTROL);
+       if (pArgs == null || static_cast<String*>(pArgs->GetAt(0))->Equals(MUSIC, false))
        {
-               AppLogDebug("%d", pArgs->GetCount());
-               __pPlayerPresentationModel->SetContentList(pArgs);
-
-               int playIndex = (static_cast<Integer*>(pArgs->GetAt(1)))->ToInt();
-               __pPlayerPresentationModel->Play(playIndex, MIN_PLAY_STATE_SLIDER_COUNT);
+               AppLogDebug("EXIT(E_FAILURE)");
+               if (pArgs != null)
+               {
+                       pArgs->RemoveAll();
+                       delete pArgs;
+               }
+               return;
        }
 
-       if (__pContentsListViewPanel->GetShowState() == true)
+       result r = __pPlayerPresentationModel->SetContentList(pArgs);
+       if (IsFailed(r))
        {
-               TableView* pContentsTableView = static_cast<TableView*>(__pContentsListViewPanel->GetControl(IDC_CONTENTS_TABLEVIEW));
-               pContentsTableView->UpdateTableView();
-       }
+               AppLogDebug("EXIT(%s)", GetErrorMessage(r));
+               SetPlayerScreenState(PLAYER_SCREEN_STATE_NO_CONTENT_LIST);
+               pArgs->RemoveAll();
+               delete pArgs;
 
-       if (__pPlayerPresentationModel->IsFileExist(__pPlayerPresentationModel->GetCurrentContentIndex()) != true)
-       {
-               SetFileNotExistState(false);
+               return;
        }
+
+       int playIndex = (static_cast<Integer*>(pArgs->GetAt(1)))->ToInt();
+       __pPlayerPresentationModel->Play(playIndex, MIN_PLAY_STATE_SLIDER_COUNT);
+
+       pArgs->RemoveAll();
+       delete pArgs;
+
        Invalidate(true);
        AppLogDebug("EXIT");
 }
@@ -2031,6 +2044,7 @@ PlayerForm::SetPlayerScreenState(unsigned int playerScreenState)
                        __prevRepeatStateRunByAppControl = __pPlayerPresentationModel->GetRepeatState();
                        SetRepeatButtonImage(IDA_TYPE_REPEAT_A);
 
+                       playerScreenState = PLAYER_SCREEN_STATE_APP_CONTROL;
                        __isRunByAppControl = true;
                }
                break;
index bffaca3..9feb07e 100644 (file)
@@ -493,12 +493,6 @@ PlaylistListPanel::OnTableViewContextItemActivationStateChanged(Tizen::Ui::Contr
                AppLogDebug("EXIT");
                return;
        }
-       else
-       {
-               pContextItem->SetSize(GetWidth(), ITEM_HEIGHT);
-               (pContextItem->GetControl(0))->SetSize(pContextItem->GetSize());
-               pContextItem->Invalidate(true);
-       }
        __selectedItemIndex = itemIndex;
        AppLogDebug("EXIT");
 }