Fixed nabi issues 39867 and 39650
authorp.srinivasa <p.srinivasa@samsung.com>
Wed, 29 May 2013 13:45:09 +0000 (19:15 +0530)
committerp.srinivasa <p.srinivasa@samsung.com>
Wed, 29 May 2013 13:45:09 +0000 (19:15 +0530)
Change-Id: I68dafe2ba205fd30ad1fb2940cb984bab32659f8
Signed-off-by: p.srinivasa <p.srinivasa@samsung.com>
src/CtGroupContactListEditorForm.cpp
src/CtGroupEditorForm.cpp

index dd139cb..d01a6d3 100644 (file)
@@ -888,6 +888,28 @@ GroupContactListEditorForm::OnContactsChanged(void)
                __pSearchBar->SetMode(SEARCH_BAR_MODE_NORMAL);
                SetFocus();
        }
+       __pPresentationModel->InitializeContactList();
+       if (__pPresentationModel->GetContactCount() == 0)
+       {
+               __pSearchBar->SetShowState(false);
+               __pListView->SetShowState(false);
+               __pCheckLabel->SetShowState(false);
+               __pSelectAllButton->SetShowState(false);
+               __pEmptyImageLabel->SetShowState(true);
+               __pEmptyCommentLabel->SetShowState(true);
+               __pBottomLabel->SetShowState(false);
+       }
+       else
+       {
+               __pSearchBar->SetShowState(true);
+               __pListView->SetShowState(true);
+               __pCheckLabel->SetShowState(true);
+               __pSelectAllButton->SetShowState(true);
+               __pEmptyImageLabel->SetShowState(false);
+               __pEmptyCommentLabel->SetShowState(false);
+               __pBottomLabel->SetShowState(true);
+       }
+
        __pSelectAllButton->SetSelected(false);
 
        for (int groupIndex = 0; groupIndex < __pListView->GetGroupCount(); groupIndex++)
@@ -901,11 +923,10 @@ GroupContactListEditorForm::OnContactsChanged(void)
                        }
                }
        }
-
        UpdateBottomLabel();
-       __pPresentationModel->InitializeContactList();
        __pListView->SetFastScrollIndex(__pPresentationModel->GetAllKeys(), false);
        __pListView->UpdateList();
+       Invalidate(true);
 }
 
 void
index 52d7b99..1b87dcd 100644 (file)
@@ -41,6 +41,7 @@ static const int IDA_HEADER_SAVE = 0;
 static const int IDA_BUTTON_GALLERY = 10;
 static const int IDA_BUTTON_TAKE_PHOTO = 11;
 static const int IDA_BUTTON_REMOVE = 12;
+static const int IDA_BUTTON_RINGTONE_CLEAR = 13;
 
 static const wchar_t* IDB_ICON_ADD_NORMAL = L"C02_caller_id_icon_add.png";
 static const wchar_t* IDB_ICON_ADD_PRESSED = L"C02_caller_id_icon_add_press.png";
@@ -50,6 +51,8 @@ static const wchar_t* IDB_ICON_REMOVE_NORMAL = L"00_button_expand_minus_press.pn
 static const wchar_t* IDB_ICON_REMOVE_PRESSED = L"00_button_expand_minus_press.png";
 static const wchar_t* IDB_REMOVE_BG_NORMAL = L"00_circle_button_delete.png";
 static const wchar_t* IDB_REMOVE_BG_PRESSED = L"00_circle_button_delete_press.png";
+static const wchar_t* IDB_DETAILS_RESET_NORMAL = L"00_button_refresh.png";
+static const wchar_t* IDB_DETAILS_RESET_PRESSED = L"00_button_refresh_press.png";
 
 static const int H_ITEM = 128;
 static const int H_THUMBNAIL = 360;
@@ -57,6 +60,7 @@ static const int Y_THUMBNAIL = 57;
 static const int H_ICON_BUTTON = 74;
 static const int Y_REMOVE_BUTTON = 26;
 static const int X_REMOVE_BUTTON_MARGIN = 40;
+static const int X_REFRESH_BUTTON_MARGIN = 88;
 
 static const int X_RINGTONE_TEXT = 3;
 static const int Y_RINGTONE_TITLE = 10;
@@ -195,6 +199,12 @@ GroupEditorForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionI
                        __pTableView->RefreshItem(1, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
                }
                break;
+       case IDA_BUTTON_RINGTONE_CLEAR:
+               {
+                       __pPresentationModel->SetRingtone(String());
+                       __pTableView->RefreshItem(2, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
+               }
+               break;
        default:
                break;
        }
@@ -283,8 +293,6 @@ GroupEditorForm::CreateItem(int itemIndex, int itemWidth)
 
        TableViewItem* pItem = new (std::nothrow) TableViewItem();
        pItem->Construct(Dimension(itemWidth, itemHeight), TABLE_VIEW_ANNEX_STYLE_NORMAL);
-       pItem->SetBackgroundColor(COLOR_TABLE_BG, TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
-       pItem->SetBackgroundColor(COLOR_TABLE_BG, TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED);
 
        if (itemIndex == 0)
        {
@@ -391,6 +399,8 @@ GroupEditorForm::CreateItem(int itemIndex, int itemWidth)
                {
                        pButtonAdd->SetShowState(false);
                }
+               pItem->SetBackgroundColor(COLOR_TABLE_BG, TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
+               pItem->SetBackgroundColor(COLOR_TABLE_BG, TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED);
        }
        else if (itemIndex == 1)
        {
@@ -426,6 +436,8 @@ GroupEditorForm::CreateItem(int itemIndex, int itemWidth)
                        pEditField->SetText(categoryName);
                }
                pItem->AddControl(pEditField);
+               pItem->SetBackgroundColor(COLOR_THUMBNAIL, TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
+               pItem->SetBackgroundColor(COLOR_THUMBNAIL, TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED);
        }
        else if (itemIndex == 2)
        {
@@ -462,6 +474,30 @@ GroupEditorForm::CreateItem(int itemIndex, int itemWidth)
                pContentLabel->SetTextColor(Color(COLOR_RINGTONE));
                pContentLabel->SetTextConfig(FONT_SIZE_RINGTONE, LABEL_TEXT_STYLE_BOLD);
                pItem->AddControl(pContentLabel);
+
+               Button* pClearButton = new (std::nothrow) Button();
+               pClearButton->Construct(Rectangle(itemWidth - X_REFRESH_BUTTON_MARGIN, (pItem->GetHeight() - H_ICON_BUTTON) / 2, H_ICON_BUTTON, H_ICON_BUTTON));
+               pClearButton->SetActionId(IDA_BUTTON_RINGTONE_CLEAR);
+               pClearButton->AddActionEventListener(*this);
+
+               Bitmap* pReset = ResourceManager::GetBitmapN(IDB_DETAILS_RESET_NORMAL);
+               if (pReset != null)
+               {
+                       pClearButton->SetNormalBitmap(Point(0, 0), *pReset);
+                       delete pReset;
+               }
+               pReset = ResourceManager::GetBitmapN(IDB_DETAILS_RESET_PRESSED);
+               if (pReset != null)
+               {
+                       pClearButton->SetPressedBitmap(Point(0, 0), *pReset);
+                       delete pReset;
+               }
+
+               pItem->AddControl(pClearButton);
+               pItem->SetIndividualSelectionEnabled(pClearButton, true);
+
+               pItem->SetBackgroundColor(COLOR_THUMBNAIL, TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
+               pItem->SetBackgroundColor(COLOR_THUMBNAIL, TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED);
        }
 
        return pItem;