Using UI builder at AlbumListEditor
authorHyukSoon Choi <hs619.choi@samsung.com>
Wed, 20 Mar 2013 07:44:16 +0000 (16:44 +0900)
committerHyukSoon Choi <hs619.choi@samsung.com>
Wed, 20 Mar 2013 07:44:16 +0000 (16:44 +0900)
Change-Id: Id0fcac45536c1b267569e97e85f055928205b6a1
Signed-off-by: HyukSoon Choi <hs619.choi@samsung.com>
inc/GlAlbumListEditorForm.h
res/screen-size-normal/IDL_FORM_ALBUM_LIST_EDITOR.xml
src/GlAlbumListEditorForm.cpp

index 85b79d2..d1557bd 100644 (file)
@@ -76,8 +76,6 @@ public:
        virtual void OnThumbnailDecoded(const int index);
 
 private:
-       result InitializeHeader(void);
-       result InitializeFooter(void);
        result InitializeControl(void);
        result InitializePopup(void);
        result SetRenameButtonImage(void);
@@ -99,7 +97,6 @@ private:
        Tizen::Ui::Controls::IconListView* __pEditorFolderIconList;
        Tizen::Ui::Controls::ContextMenu* __pShareContextMenu;
        Tizen::Ui::Controls::Popup* __pDeletePopup;
-       Tizen::Graphics::Bitmap* __pEditFolderBitmap;
        AlbumListPresentationModel* __pPresentationModel;
 };
 
index 1fcbe8e..ca405e0 100644 (file)
     </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/>
+        <itemSet>
+            <footerItem accessibilityHint="" actionId="908" disabledIconPath="T01_toolbar_icon_share_dim_web.png" highlightedIconPath="" normalIconPath="T01_controlbar_icon_share02.png" pressedIconPath="" selectedIconPath="" text=""/>
+            <footerItem accessibilityHint="" actionId="905" disabledIconPath="T01_toolbar_icon_delete_dim_web.png" highlightedIconPath="" normalIconPath="T01_controlbar_icon_delete.png" pressedIconPath="" selectedIconPath="" text=""/>
+        </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/>
+        <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="::IDS_COM_BODY_GALLERY" titleTextColor=""/>
+        <itemSet>
+            <buttonItem accessibilityHint="" actionId="201" disabledBGBitmapPath="" disabledIconPath="" highlightedBGBitmapPath="" highlightedIconPath="" normalBGBitmapPath="" normalIconPath="00_icon_select_all_web.png" position="BUTTON_POSITION_RIGHT" pressedBGBitmapPath="" pressedIconPath="00_icon_select_all_press_web.png" style="BUTTON_ITEM_STYLE_ICON" text="" type="right"/>
+        </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"/>
+        <layout height="124.0" mode="Landscape" style="" width="730.0" x="416.0" y="25.0"/>
     </IconListView>
 </Scene>
index 88eb3cb..b2e250c 100644 (file)
@@ -47,9 +47,6 @@ static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Val
 static const int W_FOLDER_SIZE = 334;
 static const int H_FOLDER_SIZE = 334;
 
-static const int W_BUTTON_RENAME_SIZE = 64;
-static const int H_BUTTON_RENAME_SIZE = 64;
-
 static const int GAP_W_POPUP_ITEM = 5;
 static const int W_DELETE_POPUP = 600;
 static const int H_DELETE_POPUP = 300;
@@ -76,7 +73,6 @@ AlbumListEditorForm::AlbumListEditorForm()
        , __pEditorFolderIconList(null)
        , __pShareContextMenu(null)
        , __pDeletePopup(null)
-       , __pEditFolderBitmap(null)
        , __pPresentationModel(null)
 {
        AppLogDebug("ENTER");
@@ -104,27 +100,15 @@ result
 AlbumListEditorForm::OnInitializing(void)
 {
        AppLogDebug("ENTER");
-       result r = E_SUCCESS;
-
-       SetRenameButtonImage();
-
        __pPresentationModel = AlbumListPresentationModel::GetInstance();
        __pPresentationModel->ClearThumbnailRequests();
        __pPresentationModel->AddPresentationModelListener(this);
 
-       r = InitializeHeader();
-       if (r != E_SUCCESS)
-       {
-               AppLogDebug("[%s] Unable to InitializeHeader.", GetErrorMessage(r));
-       }
-
-       r = InitializeFooter();
-       if (r != E_SUCCESS)
-       {
-               AppLogDebug("[%s] Unable to set InitializeFooter.", GetErrorMessage(r));
-       }
+       SetFormBackEventListener(this);
+       GetHeader()->AddActionEventListener(*this);
+       GetFooter()->AddActionEventListener(*this);
 
-       r = InitializeControl();
+       result r = InitializeControl();
        if (r != E_SUCCESS)
        {
                AppLogDebug("[%s] Unable to set InitializeControl.", GetErrorMessage(r));
@@ -146,12 +130,6 @@ AlbumListEditorForm::OnTerminating(void)
                delete __pDeletePopup;
                __pDeletePopup = null;
        }
-
-       if (__pEditFolderBitmap != null)
-       {
-               delete __pEditFolderBitmap;
-               __pEditFolderBitmap = null;
-       }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
        return E_SUCCESS;
@@ -167,144 +145,6 @@ AlbumListEditorForm::OnUpdateContentList()
 }
 
 result
-AlbumListEditorForm::SetRenameButtonImage(void)
-{
-       AppLogDebug("ENTER");
-       Bitmap* pSrcBitmap1 = ResourceManager::GetBitmapN(IDB_BUTTON_CIRCLE_BACKGROUND);
-       Bitmap* pSrcBitmap2 = ResourceManager::GetBitmapN(IDB_BUTTON_RENAME);
-
-       Bitmap* pBitmap = new (std::nothrow) Bitmap();
-       BufferInfo bufferinfo;
-       Canvas canvas;
-       Dimension size(W_BUTTON_RENAME_SIZE, H_BUTTON_RENAME_SIZE);
-       result r = pBitmap->Construct(size, BITMAP_PIXEL_FORMAT_ARGB8888);
-       r = pBitmap->Lock(bufferinfo);
-       r = canvas.Construct(bufferinfo);
-
-       if (pSrcBitmap1 != null)
-       {
-               canvas.DrawBitmap(Point(0, 0), *pSrcBitmap1);
-               delete pSrcBitmap1;
-               pSrcBitmap1 = null;
-       }
-       if (pSrcBitmap2 != null)
-       {
-               canvas.DrawBitmap(Point(0, 0), *pSrcBitmap2);
-               delete pSrcBitmap2;
-               pSrcBitmap2 = null;
-       }
-
-       pBitmap->Unlock();
-
-       __pEditFolderBitmap = pBitmap;
-       AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
-
-       return E_SUCCESS;
-}
-
-result
-AlbumListEditorForm::InitializeHeader(void)
-{
-       AppLogDebug("ENTER");
-       Header* pHeader = GetHeader();
-       if (pHeader == null)
-       {
-               AppLogDebug("EXIT 1");
-
-               return E_SYSTEM;
-       }
-
-       result r = pHeader->SetStyle(HEADER_STYLE_TITLE);
-       if (r != E_SUCCESS)
-       {
-               AppLogDebug("EXIT 2");
-
-               return r;
-       }
-
-       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;
-}
-
-result
-AlbumListEditorForm::InitializeFooter(void)
-{
-       AppLogDebug("ENTER");
-       Footer* pFooter = GetFooter();
-       if (pFooter == null)
-       {
-               AppLogDebug("EXIT 1");
-
-               return E_SYSTEM;
-       }
-
-       pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON);
-       pFooter->RemoveAllItems();
-       pFooter->SetBackButtonEnabled(true);
-       pFooter->SetBackButton();
-       SetFormBackEventListener(this);
-
-       FooterItem itemShare;
-       itemShare.Construct(ACTION_ID_FOOTER_SHARE);
-       itemShare.SetText(ResourceManager::GetString(L"EMPTY_SPACE"));
-       Bitmap* pShareBitmap = ResourceManager::GetBitmapN(IDB_CONTROLBAR_SHARE);
-       Bitmap* pShareBitmapDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_SHARE_DIM);
-       if (pShareBitmap != null && pShareBitmapDim !=null )
-       {
-               itemShare.SetIcon(FOOTER_ITEM_STATUS_NORMAL, pShareBitmap);
-               itemShare.SetIcon(FOOTER_ITEM_STATUS_DISABLED, pShareBitmapDim);
-       }
-
-       pFooter->AddItem(itemShare);
-       delete pShareBitmap;
-       delete pShareBitmapDim;
-
-       FooterItem itemDelete;
-       itemDelete.Construct(ACTION_ID_FOOTER_DELETE);
-       itemDelete.SetText(ResourceManager::GetString(L"EMPTY_SPACE"));
-       Bitmap* pBitmapDelete = ResourceManager::GetBitmapN(IDB_CONTROLBAR_DELETE);
-       Bitmap* pBitmapDeleteDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_DELETE_DIM);
-
-       if (pBitmapDelete != null)
-       {
-               itemDelete.SetIcon(FOOTER_ITEM_STATUS_NORMAL, pBitmapDelete);
-       }
-
-       if( pBitmapDeleteDim != null)
-       {
-               itemDelete.SetIcon(FOOTER_ITEM_STATUS_DISABLED, pBitmapDeleteDim);
-       }
-
-       pFooter->AddItem(itemDelete);
-       delete pBitmapDelete;
-       delete pBitmapDeleteDim;
-
-       pFooter->AddActionEventListener(*this);
-       AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
-
-       return E_SUCCESS;
-}
-
-result
 AlbumListEditorForm::InitializeControl()
 {
        AppLogDebug("ENTER");
@@ -615,7 +455,14 @@ AlbumListEditorForm::OnActionPerformed(const Control& source, int actionId)
        switch (actionId)
        {
        case ACTION_ID_ALBUM_LIST_SELECT_ALL:
-               SetAllCheckState(true);
+               if (__pPresentationModel->GetFolderCount() == GetCheckedFolder())
+               {
+                       SetAllCheckState(false);
+               }
+               else
+               {
+                       SetAllCheckState(true);
+               }
                break;
        case ACTION_ID_FOOTER_DELETE:
                if (__checkedCount > 0)