Change select all in AlbumListEditor
authorHyukSoon Choi <hs619.choi@samsung.com>
Wed, 20 Mar 2013 05:55:03 +0000 (14:55 +0900)
committerHyukSoon Choi <hs619.choi@samsung.com>
Wed, 20 Mar 2013 05:55:03 +0000 (14:55 +0900)
Change-Id: I4557d0eaa6d7e00f9429577438cc94c95ac4d8a4
Signed-off-by: HyukSoon Choi <hs619.choi@samsung.com>
inc/GlAlbumListEditorForm.h
inc/GlTypes.h
res/screen-density-xhigh/00_icon_select_all_press_web.png [new file with mode: 0644]
res/screen-density-xhigh/00_icon_select_all_web.png [new file with mode: 0644]
res/screen-size-normal/IDL_FORM_ALBUM_LIST_EDITOR.xml [new file with mode: 0644]
src/GlAlbumListEditorForm.cpp
src/GlAlbumListForm.cpp
src/GlTypes.cpp

index 77d5a8b..85b79d2 100644 (file)
@@ -95,13 +95,10 @@ private:
 
 private:
        int __checkedCount;
-       Tizen::Ui::Controls::CheckButton* __pAllCheckButton;
        Tizen::Ui::Controls::Label* __pSelectCountLabel;
-
        Tizen::Ui::Controls::IconListView* __pEditorFolderIconList;
        Tizen::Ui::Controls::ContextMenu* __pShareContextMenu;
        Tizen::Ui::Controls::Popup* __pDeletePopup;
-
        Tizen::Graphics::Bitmap* __pEditFolderBitmap;
        AlbumListPresentationModel* __pPresentationModel;
 };
index fd495c1..c047127 100644 (file)
@@ -29,8 +29,7 @@ enum ACTION_ID_
        ACTION_ID_BUTTON_CREATE_NAME_DONE = 103,
        ACTION_ID_BUTTON_MOVE_TO_SELECTION = 104,
        ACTION_ID_BUTTON_UNCHECKED = 105,
-       ACTION_ID_CHECK_SELECT_OFF = 201,
-       ACTION_ID_CHECK_SELECT_ON = 202,
+       ACTION_ID_ALBUM_LIST_SELECT_ALL = 201,
        ACTION_ID_CONTEXT_MENU_MESSAGE = 301,
        ACTION_ID_CONTEXT_MENU_EMAIL = 302,
        ACTION_ID_CONTEXT_MENU_MORE_ADD_TAG = 303,
@@ -126,6 +125,7 @@ enum FileActionCompleteRes
 };
 
 extern const wchar_t* IDL_FORM_ALBUM_LIST;
+extern const wchar_t* IDL_FORM_ALBUM_LIST_EDITOR;
 extern const wchar_t* IDL_FORM_FILE_LIST;
 extern const wchar_t* IDL_FORM_SETTING_MAIN;
 extern const wchar_t* IDL_FORM_SETTING_INTERVAL;
@@ -250,6 +250,8 @@ extern const wchar_t* IDB_LIST_EXPAND_CLOSED;
 extern const wchar_t* IDB_LIST_EXPAND_CLOSED_PRESS;
 extern const wchar_t* IDB_LIST_EXPAND_OPENED;
 extern const wchar_t* IDB_LIST_EXPAND_OPENED_PRESS;
+extern const wchar_t* IDB_ICON_SELECT_ALL;
+extern const wchar_t* IDB_ICON_SELECT_ALL_PRESS;
 
 extern const wchar_t* DEVICE_STORAGE_CARD_MOUNTED;
 extern const wchar_t* DEVICE_STORAGE_CARD_UNMOUNTED;
diff --git a/res/screen-density-xhigh/00_icon_select_all_press_web.png b/res/screen-density-xhigh/00_icon_select_all_press_web.png
new file mode 100644 (file)
index 0000000..57e1eed
Binary files /dev/null and b/res/screen-density-xhigh/00_icon_select_all_press_web.png differ
diff --git a/res/screen-density-xhigh/00_icon_select_all_web.png b/res/screen-density-xhigh/00_icon_select_all_web.png
new file mode 100644 (file)
index 0000000..56e3fbb
Binary files /dev/null and b/res/screen-density-xhigh/00_icon_select_all_web.png differ
diff --git a/res/screen-size-normal/IDL_FORM_ALBUM_LIST_EDITOR.xml b/res/screen-size-normal/IDL_FORM_ALBUM_LIST_EDITOR.xml
new file mode 100644 (file)
index 0000000..1fcbe8e
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+       This XML file was automatically generated by UiBuilder - do not modify by hand.
+-->
+<!DOCTYPE Scene SYSTEM "UIForm.dtd">
+
+<Scene Bversion="2.0.0.201303182057" Dversion="20120315">
+    <LogicalCoordinate>720</LogicalCoordinate>
+    <Form id="IDL_FORM_ALBUM_LIST_EDITOR">
+        <property backgroundColor="" backgroundColorOpacity="100" notificationTrayOpenEnabled="false" orientation="Portrait" softKey0NormalIcon="" softKey0PressedIcon="" softKey0Text="" softKey1NormalIcon="" softKey1PressedIcon="" softKey1Text="" title="" titleAlign="ALIGN_CENTER" titleIcon="" translucentFooter="false" translucentHeader="false" translucentIndicator="false"/>
+        <layout mode="Portrait" style="FORM_STYLE_INDICATOR|FORM_STYLE_HEADER|FORM_STYLE_FOOTER" type="NONE"/>
+        <layout mode="Landscape" style="FORM_STYLE_INDICATOR|FORM_STYLE_HEADER|FORM_STYLE_FOOTER" type="NONE"/>
+    </Form>
+    <Footer>
+        <property backgroundBitmapPath="" color="" colorOpacity="100" disabledButtonColor="" disabledButtonColorOpacity="100" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="100" disabledItemTextColor="" footerStyle="FOOTER_STYLE_BUTTON_ICON" highlightedButtonColor="" highlightedButtonColorOpacity="100" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="100" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="100" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="100" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="100" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="100" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="100" selectedItemTextColor="" showBackButton="true"/>
+        <itemSet/>
+    </Footer>
+    <Header>
+        <property accessibilityHint="" backgroundBitmapPath="" color="" colorOpacity="100" descriptionText="" descriptionTextColor="" disabledButtonColor="" disabledButtonColorOpacity="100" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="100" disabledItemTextColor="" headerStyle="HEADER_STYLE_TITLE" highlightedButtonColor="" highlightedButtonColorOpacity="100" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="100" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="100" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="100" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="100" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="100" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="100" selectedItemTextColor="" titleIconPath="" titleText="" titleTextColor=""/>
+        <itemSet/>
+    </Header>
+    <IconListView id="IDC_ICONLISTVIEW_ALBUM_LIST_EDITOR" parent="IDL_FORM_ALBUM_LIST_EDITOR">
+        <property backgroundBitmapPath="" backgroundColor="" backgroundColorOpacity="0" bitmapPathOfEmptyList="" checkBoxPosition="ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_RIGHT" colorOfEmptyListText="" highlightedItemTextColor="" itemBitmapHeight="100.0" itemBitmapWidth="100.0" itemBorderStyle="ICON_LIST_VIEW_ITEM_BORDER_STYLE_SHADOW" itemHorizontalAlignment="ALIGNMENT_CENTER" itemHorizontalSpacing="2.0" itemTextHorizontalAlignment="ALIGNMENT_CENTER" itemTextSize="30.0" itemTextVerticalAlignment="ICON_LIST_VIEW_ITEM_TEXT_VERTICAL_ALIGNMENT_INSIDE_BOTTOM" itemVerticalAlignment="ALIGNMENT_MIDDLE" itemVerticalSpacing="2.0" magneticScrollSize="0.0" normalItemTextColor="" pressedItemTextColor="" scrollDirection="ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL" scrollInputMode="SCROLL_INPUT_MODE_ALLOW_ANY_DIRECTION" textOfEmptyList="" touchAnimationEnabled="true"/>
+        <layout height="1010.0" mode="Portrait" style="" width="720.0" x="0.0" y="0.0"/>
+        <layout height="124.0" mode="Landscape" style="" width="730.0" x="165.0" y="20.0"/>
+    </IconListView>
+</Scene>
index 4fe5fc4..88eb3cb 100644 (file)
@@ -57,9 +57,6 @@ static const int H_DELETE_LABEL = 180;
 static const int Y_DELETE_BUTTON = 180;
 static const int H_DELETE_BUTTON = 80;
 
-static const int X_POSITION_ICON_LIST_VIEW = 0;
-static const int Y_POSITION_ICON_LIST_VIEW = 80;
-
 static const int H_CHECKBOX = 80;
 static const int GAP_H_ICON_LIST_VIEW = 40;
 
@@ -75,7 +72,6 @@ static const int ALPHA_FOLDER_BITMAP_DIM = 70;
 
 AlbumListEditorForm::AlbumListEditorForm()
        : __checkedCount(0)
-       , __pAllCheckButton(null)
        , __pSelectCountLabel(null)
        , __pEditorFolderIconList(null)
        , __pShareContextMenu(null)
@@ -98,7 +94,7 @@ result
 AlbumListEditorForm::Initialize(void)
 {
        AppLogDebug("ENTER");
-       result r = Construct(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER | FORM_STYLE_FOOTER);
+       result r = Form::Construct(IDL_FORM_ALBUM_LIST_EDITOR);
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
        return r;
@@ -228,6 +224,22 @@ AlbumListEditorForm::InitializeHeader(void)
 
        pHeader->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_GALLERY"));
        pHeader->AddActionEventListener(*this);
+
+       ButtonItem selectAll;
+       selectAll.Construct(BUTTON_ITEM_STYLE_ICON, ACTION_ID_ALBUM_LIST_SELECT_ALL);
+       Bitmap* pBitmapSelectAll = ResourceManager::GetBitmapN(IDB_ICON_SELECT_ALL);
+       Bitmap* pBitmapSelectAllPress = ResourceManager::GetBitmapN(IDB_ICON_SELECT_ALL_PRESS);
+       if (pBitmapSelectAll != null)
+       {
+               selectAll.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitmapSelectAll);
+       }
+       if (pBitmapSelectAll != null)
+       {
+               selectAll.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pBitmapSelectAllPress);
+       }
+       pHeader->SetButton(BUTTON_POSITION_RIGHT, selectAll);
+       delete pBitmapSelectAll;
+
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
        return E_SUCCESS;
@@ -303,15 +315,6 @@ AlbumListEditorForm::InitializeControl()
        tempString.Format(FORMAT_BUFFER_SIZE, L"%ls (%d)",
                        ResourceManager::GetString(L"IDS_COM_BODY_SELECTED").GetPointer(), __checkedCount);
 
-       __pAllCheckButton = new (std::nothrow) CheckButton();
-       __pAllCheckButton->Construct(Rectangle(0, 0, GetClientAreaBounds().width, H_CHECKBOX),
-                       CHECK_BUTTON_STYLE_MARK, BACKGROUND_STYLE_DEFAULT, false);
-       __pAllCheckButton->SetText(ResourceManager::GetString(L"IDS_COM_BODY_SELECT_ALL"));
-       __pAllCheckButton->SetActionId(ACTION_ID_CHECK_SELECT_ON, ACTION_ID_CHECK_SELECT_OFF);
-       __pAllCheckButton->SetChromaKeyColor(Color(COLOR_SELECT_COUNT_LABEL));
-       __pAllCheckButton->AddActionEventListener(*this);
-       AddControl(*__pAllCheckButton);
-
        __pSelectCountLabel = new (std::nothrow) Label();
        __pSelectCountLabel->Construct(Rectangle(0, GetClientAreaBounds().height - H_SELECT_COUNT_LABEL,
                        GetClientAreaBounds().width, H_SELECT_COUNT_LABEL), tempString);
@@ -389,9 +392,9 @@ AlbumListEditorForm::CreateIconListView(void)
        AppLogDebug("ENTER");
        Dimension itemSize(W_FOLDER_SIZE, H_FOLDER_SIZE);
        __pEditorFolderIconList = new (std::nothrow) IconListView();
-       __pEditorFolderIconList->Construct(Rectangle(X_POSITION_ICON_LIST_VIEW, Y_POSITION_ICON_LIST_VIEW,
-                       GetClientAreaBounds().width, GetClientAreaBounds().height - H_CHECKBOX - GAP_H_ICON_LIST_VIEW),
-                       itemSize, ICON_LIST_VIEW_STYLE_MARK, ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL);
+       __pEditorFolderIconList->Construct(Rectangle(0, 0, GetClientAreaBounds().width,
+                       GetClientAreaBounds().height - H_CHECKBOX - GAP_H_ICON_LIST_VIEW), itemSize,
+                       ICON_LIST_VIEW_STYLE_MARK, ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL);
        Bitmap* pBitmap = ResourceManager::GetBitmapN(IDB_LISTVIEW_EMPTY);
        if (pBitmap != null)
        {
@@ -481,20 +484,6 @@ AlbumListEditorForm::OnIconListViewItemStateChanged(IconListView& view, int inde
                __pSelectCountLabel->SetText(tempString);
                __pSelectCountLabel->RequestRedraw();
                __pEditorFolderIconList->RefreshList(index, LIST_REFRESH_TYPE_ITEM_MODIFY);
-               int maxCount = __pPresentationModel->GetFolderCount();
-
-               if (__pAllCheckButton->IsSelected() == true)
-               {
-                       __pAllCheckButton->SetSelected(false);
-               }
-               else
-               {
-                       if (__checkedCount == maxCount)
-                       {
-                               AppLogDebug("SELECTIONTEST(%d)(%d)",__checkedCount,  maxCount);
-                               __pAllCheckButton->SetSelected(true);
-                       }
-               }
        }
        SetButtonState();
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -557,8 +546,6 @@ AlbumListEditorForm::DeleteFolder()
        else
        {
                r = E_SUCCESS;
-               __pAllCheckButton->SetSelected(true);
-               __pAllCheckButton->RequestRedraw(true);
        }
 
        SetAllCheckState(false);
@@ -627,12 +614,9 @@ AlbumListEditorForm::OnActionPerformed(const Control& source, int actionId)
        AppLogDebug("ENTER");
        switch (actionId)
        {
-       case ACTION_ID_CHECK_SELECT_ON:
+       case ACTION_ID_ALBUM_LIST_SELECT_ALL:
                SetAllCheckState(true);
                break;
-       case ACTION_ID_CHECK_SELECT_OFF:
-               SetAllCheckState(false);
-               break;
        case ACTION_ID_FOOTER_DELETE:
                if (__checkedCount > 0)
                {
@@ -707,16 +691,6 @@ AlbumListEditorForm::OnSceneActivatedN(const SceneId& previousSceneId,
        __pSelectCountLabel->SetText(tempString);
        __pSelectCountLabel->RequestRedraw();
 
-       int maxCount = __pPresentationModel->GetFolderCount();
-       if (__checkedCount != 0 && __checkedCount == maxCount)
-       {
-               __pAllCheckButton->SetSelected(true);
-       }
-       else
-       {
-               __pAllCheckButton->SetSelected(false);
-       }
-
        SetButtonState();
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
index 2658145..be6aee7 100644 (file)
@@ -191,7 +191,6 @@ AlbumListForm::InitializeFooter(void)
                }
                pFooter->SetButton(BUTTON_POSITION_LEFT,footerMore);
                delete pBitmapMore;
-               pBitmapMore = null;
 
                __pContextMenuMore = new (std::nothrow) ContextMenu();
                __pContextMenuMore->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
index 1470895..f75cc60 100644 (file)
@@ -25,6 +25,7 @@
 using namespace Tizen::Graphics;
 
 const wchar_t* IDL_FORM_ALBUM_LIST = L"IDL_FORM_ALBUM_LIST";
+const wchar_t* IDL_FORM_ALBUM_LIST_EDITOR = L"IDL_FORM_ALBUM_LIST_EDITOR";
 const wchar_t* IDL_FORM_FILE_LIST = L"IDL_FORM_FILE_LIST";
 const wchar_t* IDL_FORM_SETTING_MAIN = L"IDL_FORM_SETTING_MAIN";
 const wchar_t* IDL_FORM_SETTING_INTERVAL = L"IDL_FORM_SETTING_INTERVAL";
@@ -148,6 +149,8 @@ const wchar_t* IDB_LIST_EXPAND_CLOSED = L"00_circle_button_Expand_closed.png";
 const wchar_t* IDB_LIST_EXPAND_CLOSED_PRESS = L"00_list_expand_closed_press.png";
 const wchar_t* IDB_LIST_EXPAND_OPENED = L"00_circle_button_Expand_open.png";
 const wchar_t* IDB_LIST_EXPAND_OPENED_PRESS = L"00_list_expand_opened_press.png";
+const wchar_t* IDB_ICON_SELECT_ALL = L"00_icon_select_all_web.png";
+const wchar_t* IDB_ICON_SELECT_ALL_PRESS = L"00_icon_select_all_press_web.png";
 
 const wchar_t* DEVICE_STORAGE_CARD_MOUNTED = L"Mounted";
 const wchar_t* DEVICE_STORAGE_CARD_UNMOUNTED = L"Unmounted";