Fixed jira issues
[apps/osp/MusicPlayer.git] / src / MpSearchForm.cpp
index 8e7a497..4014777 100644 (file)
@@ -78,7 +78,7 @@ SearchForm::OnInitializing(void)
 
        __pSearchTableView = new (std::nothrow) TableView();
        __pSearchTableView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height - __pSearchBar->GetHeight()),
-                                       true,
+                                       false,
                                        TABLE_VIEW_SCROLL_BAR_STYLE_FADE_OUT);
 
        __pSearchTableView->SetItemProvider(this);
@@ -168,7 +168,8 @@ SearchForm::OnKeypadActionPerformed(Tizen::Ui::Control& source,
        if (keypadAction == KEYPAD_ACTION_SEARCH)
        {
                __pSearchBar->HideKeypad();
-               if (__pSearchBar->GetText().GetLength() != INIT_VALUE)
+
+               if (__pSearchBar->GetTextLength() != INIT_VALUE)
                {
                        __pPresentationModel->InitializeContentList(__pSearchBar->GetText());
                }
@@ -193,6 +194,11 @@ SearchForm::OnKeypadClosed(Tizen::Ui::Control& source)
        GetFooter()->SetShowState(true);
        Rectangle clientBounds = GetClientAreaBounds();
        __pSearchTableView->SetBounds(Rectangle(0, 0, clientBounds.width, clientBounds.height - __pSearchBar->GetHeight()));
+
+       if (__pNoContentTextLabel != null && __pNoContentTextLabel->GetShowState())
+       {
+               __pNoContentTextLabel->SetBounds(X_GAP,(clientBounds.height - H_NO_CONTENT)/2,GetWidth() - (X_GAP * 2),H_NO_CONTENT);
+       }
        AppLogDebug("EXIT");
 }
 
@@ -202,6 +208,12 @@ SearchForm::OnKeypadOpened(Tizen::Ui::Control& source)
        AppLogDebug("ENTER");
        Rectangle clientBounds = GetClientAreaBounds();
        __pSearchTableView->SetBounds(Rectangle(0, 0, clientBounds.width, clientBounds.height - __pSearchBar->GetHeight()));
+
+       if (__pNoContentTextLabel != null && __pNoContentTextLabel->GetShowState())
+       {
+               //Rectangle(X_GAP, Y_GAP_NO_CONTENT, GetWidth() - (X_GAP * 2), H_NO_CONTENT)
+               __pNoContentTextLabel->SetBounds(Rectangle(X_GAP,(clientBounds.height - H_NO_CONTENT)/2,GetWidth() - (X_GAP * 2),H_NO_CONTENT));
+       }
        AppLogDebug("EXIT");
 }
 
@@ -218,6 +230,12 @@ SearchForm::OnKeypadBoundsChanged(Tizen::Ui::Control& source)
 {
        Rectangle clientBounds = GetClientAreaBounds();
        __pSearchTableView->SetBounds(Rectangle(0, 0, clientBounds.width, clientBounds.height - __pSearchBar->GetHeight()));
+
+       if (__pNoContentTextLabel != null && __pNoContentTextLabel->GetShowState())
+       {
+               //Rectangle(X_GAP, Y_GAP_NO_CONTENT, GetWidth() - (X_GAP * 2), H_NO_CONTENT)
+               __pNoContentTextLabel->SetBounds(Rectangle(X_GAP,(clientBounds.height - H_NO_CONTENT)/2,GetWidth() - (X_GAP * 2),H_NO_CONTENT));
+       }
 }
 
 int
@@ -247,6 +265,8 @@ Tizen::Ui::Controls::TableViewItem*
 SearchForm::CreateItem(const int itemIndex, int itemWidth)
 {
        AppLogDebug("ENTER");
+       Label* pDividerLabel;
+       bool addDivider = true;
        RelativeLayout layout;
        layout.Construct();
 
@@ -300,6 +320,11 @@ SearchForm::CreateItem(const int itemIndex, int itemWidth)
                pArtistNameLabel->SetTextConfig(MAIN_TEXT_SIZE, LABEL_TEXT_STYLE_NORMAL);
                pArtistNameLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
                pItem->AddControl(pArtistNameLabel);
+
+               if (itemIndex == __pPresentationModel->GetAlbumIndex()-1)
+               {
+                       addDivider = false;
+               }
        }
        else if (itemIndex < __pPresentationModel->GetSongIndex())
        {
@@ -317,6 +342,11 @@ SearchForm::CreateItem(const int itemIndex, int itemWidth)
 
                pItem->AddControl(pAlbumNameLabel);
                pItem->AddControl(pArtistNameLabel);
+
+               if (itemIndex == __pPresentationModel->GetSongIndex()-1)
+               {
+                       addDivider = false;
+               }
        }
        else
        {
@@ -327,9 +357,22 @@ SearchForm::CreateItem(const int itemIndex, int itemWidth)
                pSongNameLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
 
                pItem->AddControl(pSongNameLabel);
+
+               if (itemIndex == __pPresentationModel->GetTotalContentCount()-1)
+               {
+                       addDivider = false;
+               }
        }
        delete pContentInfo;
 
+       if (addDivider)
+       {
+               pDividerLabel = new (std::nothrow) Label();
+               pDividerLabel->Construct(FloatRectangle(0, ITEM_HEIGHT-SEARCH_ITEM_DIVIDER_HEIGHT, W_CLIENT_AREA,SEARCH_ITEM_DIVIDER_HEIGHT ), L"");
+               pDividerLabel->SetBackgroundColor(__pSearchTableView->GetItemDividerColor());
+               pItem->AddControl(pDividerLabel);
+       }
+
        AppLogDebug("EXIT");
        return pItem;