The AlbumList and EditAlbumList look Changes
authorchitta ranjan <chitta.rs@samsung.com>
Thu, 21 Mar 2013 10:46:12 +0000 (19:46 +0900)
committerchitta ranjan <chitta.rs@samsung.com>
Thu, 21 Mar 2013 10:46:12 +0000 (19:46 +0900)
Change-Id: I2f0278068b9539ca82a79d88558aa15461f3145e
Signed-off-by: chitta ranjan <chitta.rs@samsung.com>
inc/GlTypes.h
res/screen-density-xhigh/T01_album_edit_rename.png [new file with mode: 0644]
res/screen-density-xhigh/T01_album_edit_rename_bg.png [new file with mode: 0644]
res/screen-density-xhigh/T01_album_icon_camera.png [new file with mode: 0644]
res/screen-density-xhigh/T01_album_icon_download.png [new file with mode: 0644]
res/screen-density-xhigh/T01_album_icon_folder.png [new file with mode: 0644]
src/GlAlbumListEditorForm.cpp
src/GlAlbumListForm.cpp
src/GlAlbumListPresentationModel.cpp
src/GlTypes.cpp

index c047127..c299f96 100644 (file)
@@ -255,6 +255,12 @@ 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;
+extern const wchar_t* IDB_ALBUM_EDIT_RENAME_BG;
+extern const wchar_t* IDB_ALBUM_EDIT_RENAME;
+extern const wchar_t* IDB_ALBUM_ICON_FOLDER;
+extern const wchar_t* IDB_ALBUM_ICON_DOWNLOAD;
+extern const wchar_t*  IDB_ALBUM_ICON_CAMERA;
+
 
 static const unsigned int CUSTOM_COLOR_GREY = Tizen::Graphics::Color32<124,124,124>::Value;
 static const unsigned int CUSTOM_COLOR_TRANSPARENT = Tizen::Graphics::Color32<0,0,0>::Value;
diff --git a/res/screen-density-xhigh/T01_album_edit_rename.png b/res/screen-density-xhigh/T01_album_edit_rename.png
new file mode 100644 (file)
index 0000000..4a2a2ae
Binary files /dev/null and b/res/screen-density-xhigh/T01_album_edit_rename.png differ
diff --git a/res/screen-density-xhigh/T01_album_edit_rename_bg.png b/res/screen-density-xhigh/T01_album_edit_rename_bg.png
new file mode 100644 (file)
index 0000000..01a75d8
Binary files /dev/null and b/res/screen-density-xhigh/T01_album_edit_rename_bg.png differ
diff --git a/res/screen-density-xhigh/T01_album_icon_camera.png b/res/screen-density-xhigh/T01_album_icon_camera.png
new file mode 100644 (file)
index 0000000..f3d63dd
Binary files /dev/null and b/res/screen-density-xhigh/T01_album_icon_camera.png differ
diff --git a/res/screen-density-xhigh/T01_album_icon_download.png b/res/screen-density-xhigh/T01_album_icon_download.png
new file mode 100644 (file)
index 0000000..e424ba8
Binary files /dev/null and b/res/screen-density-xhigh/T01_album_icon_download.png differ
diff --git a/res/screen-density-xhigh/T01_album_icon_folder.png b/res/screen-density-xhigh/T01_album_icon_folder.png
new file mode 100644 (file)
index 0000000..1ef79e8
Binary files /dev/null and b/res/screen-density-xhigh/T01_album_icon_folder.png differ
index 8b30964..757810a 100644 (file)
@@ -44,8 +44,8 @@ static const unsigned int COLOR_DELETE_BUTTON_NORMAL = Color32<208, 82, 82>::Val
 static const unsigned int COLOR_DELETE_BUTTON_PRESSED = Color32<194, 71, 71>::Value;
 static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Value;
 
-static const int W_FOLDER_SIZE = 334;
-static const int H_FOLDER_SIZE = 334;
+static const int W_FOLDER_SIZE = 348;
+static const int H_FOLDER_SIZE = 348;
 
 static const int GAP_W_POPUP_ITEM = 5;
 static const int W_DELETE_POPUP = 600;
@@ -243,6 +243,7 @@ AlbumListEditorForm::CreateIconListView(void)
        }
        __pEditorFolderIconList->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
        __pEditorFolderIconList->SetItemBorderStyle(ICON_LIST_VIEW_ITEM_BORDER_STYLE_NONE);
+       __pEditorFolderIconList->SetCheckBoxPosition(ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_LEFT);
        __pEditorFolderIconList->SetItemProvider(*this);
        __pEditorFolderIconList->SetTouchAnimationEnabled(false);
        __pEditorFolderIconList->AddIconListViewItemEventListener(*this);
index be6aee7..36c1196 100644 (file)
@@ -39,8 +39,8 @@ using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
 
-static const int W_FOLDER_SIZE = 334;
-static const int H_FOLDER_SIZE = 334;
+static const int W_FOLDER_SIZE = 348;
+static const int H_FOLDER_SIZE = 348;
 
 AlbumListForm::AlbumListForm(void)
        : __pAlbumViewIconList(null)
index e4217b0..bd7c275 100644 (file)
@@ -22,6 +22,7 @@
 #include <cstdlib>
 #include <FMedia.h>
 #include <FSystem.h>
+
 #include "GlAlbumInfo.h"
 #include "GlAlbumListPresentationModel.h"
 #include "GlGalleryApp.h"
@@ -43,22 +44,33 @@ using namespace Tizen::Ui::Controls;
 
 static const int ICON_CAP = 3;
 static const int FOLDER_CAP = 8;
-static const int ICON_SIZE = 102;
-static const int FOLDER_SIZE_WIDTH = 334;
-static const int FOLDER_SIZE_HEIGHT = 334;
+static const int ICON_SIZE = 107;
+static const int FOLDER_SIZE_WIDTH = 348;
+static const int FOLDER_SIZE_HEIGHT = 348;
+
+static const int CANVAS_HEIGHT = 71;
+static const int CANVAS_WIDTH = 326;
 
 static const int FONT_SIZE_FOLDER_NAME = 32;
 static const int FONT_SIZE_FOLDER_DATE = 25;
-static const int FONT_SIZE_FOLDER_COUNT = 42;
-static const int GAP_FONT = 5;
+static const int FONT_SIZE_FOLDER_COUNT = 45;
+static const int FONT_SIZE_FOLDER_COUNT_SMALL = 35;
+
+static const int CANVAS_IMAGE_FOLDER_HEIGHT = 48;
+static const int CANVAS_IMAGE_FOLDER_WIDTH = 48;
+static const int IMAGE_COUNT_WIDTH  = 100;
+static const int IMAGE_COUNT_HEIGHT = 60;
+static const int CANVAS_MARGIN_LEFT = 10;
+static const int GAP = 10;
+static const int HEIGHT_OFFSET = 5;
+static const int Y_POS_CANVAS = 260;
+static const int FOLDER_NAME_WIDTH = 165;
+static const int FOLDER_NAME_HEIGHT = 38 ;
 
-static const int MAX_FONT_LENGTH = 15;
 
-static const unsigned int COLOR_BLACK = Color32<25, 25, 25>::Value;
-static const unsigned int COLOR_1 = Color32<71, 128, 11>::Value;
-static const unsigned int COLOR_2 = Color32<56, 78, 116>::Value;
-static const unsigned int COLOR_3 = Color32<49, 125, 174>::Value;
-static const unsigned int COLOR_4 = Color32<165, 53, 33>::Value;
+static const int ALPHA_BG = 110;
+
+static const Color COLOR_CANVAS_BG (Color::GetColor(COLOR_ID_BLACK));
 
 static const String RESERVED_MEDIA_PATH = Environment::GetMediaPath();
 static const String RESERVED_CAMERA_PATH = Environment::GetMediaPath() + L"Camera";
@@ -68,12 +80,6 @@ static const String CONTENT_INFO_ORDER = L"ContentFileName";
 
 static const int FORMAT_BUFFER_SIZE = 256;
 
-static const int MAX_RANDOM_COLOR_NUMBER = 4;
-static const int COMPARE_COLOR_NUMBER_0 = 0;
-static const int COMPARE_COLOR_NUMBER_1 = 1;
-static const int COMPARE_COLOR_NUMBER_2 = 2;
-static const int COMPARE_COLOR_NUMBER_3 = 3;
-
 static const int DOUBLE_NUMBER = 2;
 static const int TRIPLE_NUMBER = 3;
 
@@ -84,10 +90,10 @@ ThumbnailEvent* AlbumListPresentationModel::__pThumbnailEvent = null;
 IList* AlbumListPresentationModel::__pAlbumInfoList = null;
 
 AlbumListPresentationModel::AlbumListPresentationModel(void)
-       : __pFolderBackgroundBitmap(null)
-       , __appControlMode(APP_CONTROL_MODE_MAIN)
-       , __appControlMediaType(APPCONTROL_MEDIA_TYPE_IMAGE)
-       , __appControlSelectionMode(APPCONTROL_SELECTION_MODE_SINGLE)
+: __pFolderBackgroundBitmap(null)
+, __appControlMode(APP_CONTROL_MODE_MAIN)
+, __appControlMediaType(APPCONTROL_MEDIA_TYPE_IMAGE)
+, __appControlSelectionMode(APPCONTROL_SELECTION_MODE_SINGLE)
 {
        AppLogDebug("ENTER");
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -245,12 +251,14 @@ AlbumListPresentationModel::CallAlbumChangedEvent(void)
        if (__pPresentationModelListener->GetCount() > 0)
        {
                IEnumerator* pEnum = __pPresentationModelListener->GetEnumeratorN();
+
                while (pEnum->MoveNext() == E_SUCCESS)
                {
                        IAlbumEventListener* pListener = null;
                        pListener = static_cast<IAlbumEventListener*>(pEnum->GetCurrent());
                        pListener->OnFileInfoChanged(CONTENT_TYPE_ALL);
                }
+
                delete pEnum;
                pEnum = null;
        }
@@ -268,10 +276,10 @@ AlbumListPresentationModel::DrawPartialImage(Canvas& canvas, AlbumInfo* pAlbumIn
                return;
        }
 
-       Dimension dimSet(ICON_SIZE, ICON_SIZE);
        canvas.DrawBitmap(rectNew, *__pFolderBackgroundBitmap);
 
        Bitmap* pBitmap = pAlbumInfo->GetFolderThumnailBitmap();
+
        if (pBitmap != null)
        {
                Rectangle rectFirst(ICON_CAP+FOLDER_CAP, ICON_CAP,
@@ -279,6 +287,7 @@ AlbumListPresentationModel::DrawPartialImage(Canvas& canvas, AlbumInfo* pAlbumIn
                                ICON_CAP * DOUBLE_NUMBER + ICON_SIZE * TRIPLE_NUMBER);
                canvas.DrawBitmap(rectFirst, *pBitmap);
        }
+
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
@@ -286,6 +295,7 @@ void
 AlbumListPresentationModel::DrawFontImage(Canvas& canvas, AlbumInfo* pAlbumInfo, int index)
 {
        AppLogDebug("ENTER");
+
        if (&canvas == null)
        {
                AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
@@ -293,72 +303,82 @@ AlbumListPresentationModel::DrawFontImage(Canvas& canvas, AlbumInfo* pAlbumInfo,
                return;
        }
 
+       Point pointText;
        String strCnt;
+       Bitmap* pBitmap = null;
+       Font ftFolderName, ftDate, ftCnt,ftCntSmall;
+       EnrichedText enText;
+       EnrichedText enTextCount;
+       TextElement textElement;
+       TextElement textElementCount;
+
        int allContentCount = pAlbumInfo->GetContentIdCount();
        strCnt.Format(FORMAT_BUFFER_SIZE, L"%d", allContentCount);
 
        String strFolderName = pAlbumInfo->GetAlbumName();
-       Color colorBack = COLOR_BLACK;
 
-       if (    strFolderName == ResourceManager::GetString(L"IDS_MEDIABR_BODY_ALL_ALBUMS")
-               || strFolderName == ResourceManager::GetString(L"IDS_MEDIABR_BODY_CAMERA_ROLL_ABB")
-           || strFolderName == ResourceManager::GetString(L"IDS_COM_BODY_DOWNLOADS"))
+       Rectangle rectCanvas(ICON_CAP + FOLDER_CAP, Y_POS_CANVAS, CANVAS_WIDTH, CANVAS_HEIGHT);
+       Color bgColor(COLOR_CANVAS_BG);
+       bgColor.SetAlpha(ALPHA_BG);
+       canvas.FillRectangle(bgColor, rectCanvas);
+
+       if ( strFolderName == ResourceManager::GetString(L"IDS_COM_BODY_DOWNLOADS"))
        {
-               colorBack = COLOR_BLACK;
+               pBitmap = ResourceManager::GetBitmapN(IDB_ALBUM_ICON_DOWNLOAD);
+       }
+       else if ( strFolderName == ResourceManager::GetString(L"IDS_MEDIABR_BODY_CAMERA_ROLL_ABB") )
+       {
+               pBitmap = ResourceManager::GetBitmapN(IDB_ALBUM_ICON_CAMERA);
        }
        else
        {
-               if (index % MAX_RANDOM_COLOR_NUMBER == COMPARE_COLOR_NUMBER_0)
-               {
-                       colorBack = COLOR_1;
-               }
-               else if (index % MAX_RANDOM_COLOR_NUMBER == COMPARE_COLOR_NUMBER_1)
-               {
-                       colorBack = COLOR_2;
-               }
-               else if (index % MAX_RANDOM_COLOR_NUMBER == COMPARE_COLOR_NUMBER_2)
-               {
-                       colorBack = COLOR_3;
-               }
-               else if (index % MAX_RANDOM_COLOR_NUMBER == COMPARE_COLOR_NUMBER_3)
-               {
-                       colorBack = COLOR_4;
-               }
+               pBitmap = ResourceManager::GetBitmapN(IDB_ALBUM_ICON_FOLDER);
        }
 
-       Rectangle rectBack(ICON_CAP + FOLDER_CAP, ICON_CAP, ICON_SIZE * DOUBLE_NUMBER + ICON_CAP, ICON_SIZE);
-       canvas.FillRectangle(colorBack, rectBack);
-
-       Point pointText;
+       if ( pBitmap != null)
+       {
+               canvas.DrawBitmap(Rectangle(ICON_CAP + FOLDER_CAP, rectCanvas.y + HEIGHT_OFFSET, CANVAS_IMAGE_FOLDER_WIDTH,
+                                       CANVAS_IMAGE_FOLDER_HEIGHT), *pBitmap);
+               delete pBitmap;
+       }
 
-       Font ftFolderName, ftDate, ftCnt;
        ftFolderName.Construct(FONT_STYLE_PLAIN, FONT_SIZE_FOLDER_NAME);
        ftDate.Construct(FONT_STYLE_PLAIN, FONT_SIZE_FOLDER_DATE);
        ftCnt.Construct(FONT_STYLE_PLAIN, FONT_SIZE_FOLDER_COUNT);
+       ftCntSmall.Construct(FONT_STYLE_PLAIN, FONT_SIZE_FOLDER_COUNT_SMALL);
 
-       EnrichedText enText;
-       enText.Construct(Dimension(ICON_SIZE * DOUBLE_NUMBER - (ICON_CAP * DOUBLE_NUMBER),
-                       FONT_SIZE_FOLDER_NAME + ICON_CAP * DOUBLE_NUMBER));
+       enText.Construct(Dimension(FOLDER_NAME_WIDTH, FOLDER_NAME_HEIGHT));
        enText.SetHorizontalAlignment(TEXT_ALIGNMENT_LEFT);
 
-       TextElement textElement;
        textElement.Construct(strFolderName);
        textElement.SetFont(ftFolderName);
        textElement.SetTextColor(Color::GetColor(COLOR_ID_WHITE));
        enText.SetTextAbbreviationEnabled(true);
        enText.Add(textElement);
 
-       pointText = Point(ICON_CAP + FOLDER_CAP, ICON_CAP + FONT_SIZE_FOLDER_NAME);
-       canvas.SetFont(ftDate);
-       canvas.SetForegroundColor(Color::GetColor(COLOR_ID_GREY));
+       enTextCount.Construct(Dimension(IMAGE_COUNT_WIDTH, IMAGE_COUNT_HEIGHT));
+       enTextCount.SetHorizontalAlignment(TEXT_ALIGNMENT_RIGHT);
+
+       textElementCount.Construct(strCnt);
+
+       if (strCnt.GetLength() > 3)             // if the count in Album is greater than 3 digit number, use small font
+       {
+               textElementCount.SetFont(ftCntSmall);
+       }
+       else
+       {
+               textElementCount.SetFont(ftCnt);
+       }
+       textElementCount.SetTextColor(Color::GetColor(COLOR_ID_WHITE));
+       enTextCount.SetTextAbbreviationEnabled(true);
+       enTextCount.Add(textElementCount);
 
-       pointText = Point((ICON_SIZE * DOUBLE_NUMBER + ICON_CAP) - ((FONT_SIZE_FOLDER_COUNT / DOUBLE_NUMBER) * strCnt.GetLength() + GAP_FONT),
-                       ICON_CAP + FONT_SIZE_FOLDER_NAME + FONT_SIZE_FOLDER_DATE);
+       pointText = Point(CANVAS_MARGIN_LEFT + CANVAS_IMAGE_FOLDER_WIDTH + GAP + FOLDER_NAME_WIDTH , rectCanvas.y + HEIGHT_OFFSET);
        canvas.SetFont(ftCnt);
        canvas.SetForegroundColor(Color::GetColor(COLOR_ID_WHITE));
-       canvas.DrawText(pointText, strCnt, MAX_FONT_LENGTH);
+       canvas.DrawText(pointText, enTextCount);
 
-       pointText = Point(ICON_CAP + FOLDER_CAP, ICON_CAP);
+       pointText = Point(CANVAS_MARGIN_LEFT + CANVAS_IMAGE_FOLDER_WIDTH + GAP , rectCanvas.y + GAP + HEIGHT_OFFSET);
        canvas.SetForegroundColor(Color::GetColor(COLOR_ID_WHITE));
        canvas.DrawText(pointText, enText);
 
@@ -369,6 +389,7 @@ Bitmap*
 AlbumListPresentationModel::CreateMergeBitmapN(int index)
 {
        AppLogDebug("ENTER index(%d)", index);
+
        if (__pAlbumInfoList == null)
        {
                AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
@@ -415,7 +436,7 @@ AlbumListPresentationModel::CreateMergeBitmapN(int index)
 
 result
 AlbumListPresentationModel::StartAppControl( const String&  providerId, const String&  operationId,
-                                         const IMap* pDataList, IAppControlResponseListener* pListener)
+               const IMap* pDataList, IAppControlResponseListener* pListener)
 {
        AppLogDebug("ENTER");
        AppLogDebug("FindAppControlN(%ls, %ls)", providerId.GetPointer(), operationId.GetPointer());
@@ -526,6 +547,7 @@ AlbumListPresentationModel::InitializeAlbumInfoList(const ContentType& contentTy
                        return;
                }
        }
+
        IList* pContentDirectoryPathList = directory.GetContentDirectoryPathListN(SORT_ORDER_ASCENDING);
        String* pDirPath = null;
        AlbumInfo* pAlbumInfo = null;
@@ -595,7 +617,7 @@ AlbumListPresentationModel::InitializeAlbumInfoList(const ContentType& contentTy
                        }
 
                        if ((*pDirPath == RESERVED_CAMERA_PATH)
-                               ||(*pDirPath == RESERVED_CAMERA_PATH_EXT))
+                                       ||(*pDirPath == RESERVED_CAMERA_PATH_EXT))
                        {
                                IList* pContentIdList = GetContentIdListInDirectoryN(*pDirPath, contentType);
 
@@ -1016,7 +1038,7 @@ AlbumListPresentationModel::CancelThumbnailRequest(const int folderIndex)
                                contentId = pAlbumInfo->GetContentId(i);
                                __pThumbnailProvider->CancelThumbnailRequest(contentId, __pThumbnailEvent);
                        }
-                       */
+                        */
                }
        }
        AppLogDebug("EXIT");
index f75cc60..d38e3dd 100644 (file)
@@ -154,3 +154,9 @@ 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";
+const wchar_t* IDB_ALBUM_EDIT_RENAME_BG = L"T01_album_edit_rename_bg.png";
+const wchar_t* IDB_ALBUM_EDIT_RENAME = L"T01_album_edit_rename.png";
+const wchar_t* IDB_ALBUM_ICON_FOLDER = L"T01_album_icon_folder.png";
+const wchar_t* IDB_ALBUM_ICON_DOWNLOAD = L"T01_album_icon_download.png";
+const wchar_t* IDB_ALBUM_ICON_CAMERA = L"T01_album_icon_camera.png";
+