UI issues, hide icon changes
authorGAURAV JAIN <gaurav.j3@samsung.com>
Mon, 29 Apr 2013 08:01:34 +0000 (13:31 +0530)
committerGAURAV JAIN <gaurav.j3@samsung.com>
Mon, 29 Apr 2013 08:01:34 +0000 (13:31 +0530)
Change-Id: If7d7473d99570b1582ea98e8848eff3ce072071f
Signed-off-by: GAURAV JAIN <gaurav.j3@samsung.com>
14 files changed:
inc/MsgComposerForm.h
inc/MsgTypes.h
res/screen-density-xhigh/00_icon_SIP_close.png [new file with mode: 0644]
res/screen-density-xhigh/00_icon_SIP_close_ef.png [new file with mode: 0644]
res/screen-density-xhigh/M01_input_close.png [deleted file]
src/MsgBitmapUtility.cpp
src/MsgComposerForm.cpp
src/MsgConversationForm.cpp
src/MsgMediaTextExpandEditArea.cpp
src/MsgMessageComposePanel.cpp
src/MsgMessagesApp.cpp
src/MsgMmsDetailForm.cpp
src/MsgSubjectControl.cpp
src/MsgTypes.cpp

index f46c3c9..2914be9 100644 (file)
@@ -142,7 +142,9 @@ private:
        int __volumeLevel;\r
        bool __isLaunchedAsForward;\r
        bool __isTypeAlreadyMms;\r
-\r
+       bool __isOverlapping;   // message compose panel and recipient panel\r
+       int __sizeToReduce;\r
+       int __isDraftMessage;\r
 };\r
 \r
 #endif  //_MSG_COMPOSE_FORM_H_\r
index bb4d1a0..baeff77 100644 (file)
@@ -427,6 +427,7 @@ enum RequestType
        REQUEST_MSGCOMPOSEPANEL_BUTTON_STATE,
        REQUEST_HEADER_BUTTON_STATE,
        REQUEST_HIDE_RECIPIENT_LIST,
+       REQUEST_SET_MAXIMUM_SIZE,
 };
 
 enum SpamFilterType
diff --git a/res/screen-density-xhigh/00_icon_SIP_close.png b/res/screen-density-xhigh/00_icon_SIP_close.png
new file mode 100644 (file)
index 0000000..906a3e7
Binary files /dev/null and b/res/screen-density-xhigh/00_icon_SIP_close.png differ
diff --git a/res/screen-density-xhigh/00_icon_SIP_close_ef.png b/res/screen-density-xhigh/00_icon_SIP_close_ef.png
new file mode 100644 (file)
index 0000000..0d7d4f9
Binary files /dev/null and b/res/screen-density-xhigh/00_icon_SIP_close_ef.png differ
diff --git a/res/screen-density-xhigh/M01_input_close.png b/res/screen-density-xhigh/M01_input_close.png
deleted file mode 100644 (file)
index ba334a9..0000000
Binary files a/res/screen-density-xhigh/M01_input_close.png and /dev/null differ
index 1ee768a..31ede5a 100644 (file)
@@ -484,11 +484,11 @@ BitmapUtility::GetIconN(MessageIconType iconType, const Dimension& size)
                break;\r
 \r
        case MSG_ICON_SIP_CLOSE:\r
-               pngFile.Append("M01_input_close.png");\r
+               pngFile.Append("00_icon_SIP_close_ef.png");\r
                break;\r
 \r
        case MSG_ICON_SIP_CLOSE_PRESS:\r
-               pngFile.Append("M01_input_close.png");\r
+               pngFile.Append("00_icon_SIP_close.png");\r
                break;\r
 \r
        default:\r
index 6a392bb..1903060 100644 (file)
@@ -55,6 +55,8 @@ ComposerForm::ComposerForm(void)
        , __volumeLevel(-1)
        , __isLaunchedAsForward(false)
        , __isTypeAlreadyMms(false)
+       , __isOverlapping(false)
+       , __isDraftMessage(false)
 {
        //Empty implementation
 }
@@ -146,15 +148,20 @@ ComposerForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
                        delete __pDurationPopup;
                        __pDurationPopup = null;
                }
-               // Set Focus to editor.
-//             if (__pRecipientPanel->GetRecipientCount() > 0)
-//             {
-//                     __pMsgComposePanel->SetFocusToLastPage();
-//             }
-//             else
-//             {
-//                     __pRecipientPanel->SetFocus();
-//             }
+       }
+       break;
+
+       case REQUEST_SET_MAXIMUM_SIZE:
+       {
+               if(__pRecipientPanel && __pMsgComposePanel)
+               {
+                       Rectangle clientArea = GetClientAreaBounds();
+                       __pMsgComposePanel->SetMaximumSize(Dimension(__pMsgComposePanel->GetWidth(), clientArea.height - __pRecipientPanel->GetHeight()));
+                       if(__pMsgComposePanel->GetHeight() == __pMsgComposePanel->GetMaximumSize().height)
+                       {
+                               __isOverlapping = true;
+                       }
+               }
        }
        break;
 
@@ -269,7 +276,7 @@ ComposerForm::OnSceneActivatedN(const SceneId& previousSceneId,
                                                                const SceneId& currentSceneId, IList* pArgs)
 {
        AppLogDebug("ENTER");
-
+       SetFocus();
        __pRecipientPanel->SetFocus();
 
        // Set editor text based on font settings
@@ -313,6 +320,7 @@ ComposerForm::OnSceneActivatedN(const SceneId& previousSceneId,
                        __pDraftMessageEntry = (MessageData*) pArgs->GetAt(1);
                        pArgs->RemoveAt(1);
                        LoadDraftMessage();
+                       __isDraftMessage = true;
                }
                break;
                }
@@ -338,26 +346,40 @@ void
 ComposerForm::OnSizeIncrease(const Control& control)
 {
        AppLogDebug("ENTER");
-
        Rectangle clientArea = GetClientAreaBounds();
        int panelHeight = __pMsgComposePanel->GetDisplayHeight();
        if (__pRecipientPanel->Equals(control))
        {
                //Check if compose panel overlap with recipient panel
-               int recipientPanelEndPosY = __pRecipientPanel->GetY() + __pRecipientPanel->GetHeight();
+               int recipientPanelEndPosY = __pRecipientPanel->GetY() + __pRecipientPanel->GetHeight() + 1;
                int composePanelPosY = __pMsgComposePanel->GetY();
+               __isOverlapping = (recipientPanelEndPosY == composePanelPosY);
                if (recipientPanelEndPosY > composePanelPosY)
                {
-                       int sizeToReduce = recipientPanelEndPosY - composePanelPosY;
+                       __isOverlapping = true;
+                       __sizeToReduce = recipientPanelEndPosY - composePanelPosY;
                        __pMsgComposePanel->SetBounds(Rectangle(__pMsgComposePanel->GetX(), recipientPanelEndPosY,
-                                                                                                       __pMsgComposePanel->GetWidth(), (panelHeight - sizeToReduce)));
+                                                                                                       __pMsgComposePanel->GetWidth(), (panelHeight - __sizeToReduce)));
+                       __pMsgComposePanel->Invalidate(true);
                }
        }
        else if (__pMsgComposePanel->Equals(control))
        {
                Point currentPosition = __pMsgComposePanel->GetPosition();
-               __pMsgComposePanel->SetBounds(Rectangle(currentPosition.x, clientArea.height - panelHeight,
+               int recipientPanelEndPosY = __pRecipientPanel->GetY() + __pRecipientPanel->GetHeight() + 1;
+               int composePanelPosY = __pMsgComposePanel->GetY();
+               if (recipientPanelEndPosY > composePanelPosY)
+               {
+                       // last page is not getting focus. That is why this if condition. Ideally this if cond not required.
+                       // Have to find a way out of this.
+                       __pMsgComposePanel->SetBounds(Rectangle(currentPosition.x, recipientPanelEndPosY,
+                                                                                               __pMsgComposePanel->GetWidth(), panelHeight)); // doubtful about this code
+               }
+               else
+               {
+                       __pMsgComposePanel->SetBounds(Rectangle(currentPosition.x, clientArea.height - panelHeight,
                                                                                                __pMsgComposePanel->GetWidth(), panelHeight));
+               }
                __pMsgComposePanel->SetShowState(true);
        }
        AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult()));
@@ -367,12 +389,34 @@ ComposerForm::OnSizeIncrease(const Control& control)
 void
 ComposerForm::OnSizeDecrease(const Control& control)
 {
-       AppLogDebug("ENTER");
-
        Rectangle clientArea = GetClientAreaBounds();
        if (__pRecipientPanel->Equals(control))
        {
-               // TODO:
+               int recipientPanelEndPosY;
+               if(__isOverlapping)
+               {
+                       __isOverlapping = false;
+                       recipientPanelEndPosY = __pRecipientPanel->GetY() + __pRecipientPanel->GetHeight() + 1;
+                       int sizeToIncrease = __pMsgComposePanel->GetY() - recipientPanelEndPosY;
+                       __pMsgComposePanel->SetMaximumSize(Dimension(__pMsgComposePanel->GetWidth(), clientArea.height - __pRecipientPanel->GetHeight()));
+                       __pMsgComposePanel->SetBounds(Rectangle(__pMsgComposePanel->GetX(), recipientPanelEndPosY,
+                                                                                                       __pMsgComposePanel->GetWidth(), (__pMsgComposePanel->GetHeight() +      sizeToIncrease)));
+                       return; // Reason: Set bounds in this if condition and the following condition are doing the same job and which is why the repetition can be avoided in draft composer
+                       //form
+               }
+               if(__isDraftMessage)
+               {
+                       if(__pMsgComposePanel->GetHeight() >= __pMsgComposePanel->GetMaximumSize().height)
+                       {
+                               recipientPanelEndPosY = __pRecipientPanel->GetY() + __pRecipientPanel->GetHeight() + 1;
+                               int prevMaxHeight = __pMsgComposePanel->GetMaximumSize().height;
+                               __pMsgComposePanel->SetMaximumSize(Dimension(__pMsgComposePanel->GetWidth(), clientArea.height - __pRecipientPanel->GetHeight()));
+                               int currentMaxHeight = __pMsgComposePanel->GetMaximumSize().height;
+                               __pMsgComposePanel->SetBounds(Rectangle(__pMsgComposePanel->GetX(), recipientPanelEndPosY,
+                                                                                                               __pMsgComposePanel->GetWidth(), (__pMsgComposePanel->GetHeight() +      (currentMaxHeight - prevMaxHeight))));
+                       }
+               }
+               __isOverlapping = (recipientPanelEndPosY == __pMsgComposePanel->GetY());
        }
        else if (__pMsgComposePanel->Equals(control))
        {
@@ -608,6 +652,8 @@ ComposerForm::OnActionPerformed(const Control& source, int actionId)
        {
        case IDA_HEADER_BACK:
        {
+               __pMsgComposePanel->HideKeypad();
+               __pRecipientPanel->HideKeypad();
                MessageComposeData* pComposeData = __pMsgComposePanel->GetMessageComposeDataN();
                if (((!pComposeData) && (__pRecipientPanel->IsTextForTokenExist() || __pRecipientPanel->GetRecipientCount() > 0)) ||
                        ((pComposeData) && (__pRecipientPanel->IsTextForTokenExist() || __pRecipientPanel->GetRecipientCount() <= 0)))
@@ -675,8 +721,6 @@ ComposerForm::OnActionPerformed(const Control& source, int actionId)
                }
                else
                {
-                       __pMsgComposePanel->HideKeypad();
-                       __pRecipientPanel->HideKeypad();
                        if (pComposeData)
                        {
                                // Save message to draft
@@ -721,9 +765,6 @@ ComposerForm::OnActionPerformed(const Control& source, int actionId)
 
        case IDA_DISCARD_MESSAGE_OK:
        {
-               __pMsgComposePanel->HideKeypad();
-               __pRecipientPanel->HideKeypad();
-
                DestroyMessagePopup();
                // remove draft entry
                if (__pDraftMessageEntry)
@@ -1021,6 +1062,12 @@ ComposerForm::LoadDraftMessage(void)
                ArrayList* pAddressList = const_cast<ArrayList*>(__pDraftMessageEntry->GetAddressList());
                __pRecipientPanel->SetRecipientList(pAddressList);
                // Set Body text.
+               
+               if (__pRecipientPanel)
+               {
+                       Rectangle rect = GetClientAreaBounds();
+                       __pMsgComposePanel->SetMaximumSize(Dimension(__pMsgComposePanel->GetWidth(), rect.height - __pRecipientPanel->GetHeight()));
+               }
                __pMsgComposePanel->LoadMessageData(*__pDraftMessageEntry);
        }
 
index 4a14f10..a056c81 100644 (file)
@@ -2587,7 +2587,8 @@ ConversationForm::OnSendButtonClick(void)
                }
                delete pComposeData;
        }
-       __pMsgComposePanel->SetFocusToLastPage();
+       // TODO: Focus set to last page done from cleartext.
+       //__pMsgComposePanel->SetFocusToLastPage();
        __pMsgComposePanel->ClearText(true);
        __pMsgComposePanel->Invalidate(true);
 
index 41689a1..973976a 100644 (file)
@@ -203,7 +203,7 @@ MediaTextExpandEditArea::ClearText(void)
                r = RemoveControl(*__pAttachCntrl);
                __pAttachCntrl = null;
        }
-       __pExpandEditArea->SetBounds(0, 0, __prevBounds.width, __prevBounds.height);
+       __pExpandEditArea->SetBounds(0, 0, GetWidth(), MIN_COMPOSE_EDITOR_HEIGHT);
        SetSize(GetWidth(), __pExpandEditArea->GetHeight());
        AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult()));
        return r;
index 942e60b..24fae6f 100644 (file)
@@ -360,8 +360,8 @@ MessageComposePanel::InsertFileToPage(const String& selectFilepath)
                                pPageInFocus = static_cast<ComposeBaseControl*>(pImageTextPanel->GetControl(0));
                        }
                        MediaTextExpandEditArea* pFocusComposePage = static_cast<MediaTextExpandEditArea*>(pPageInFocus);
-                       if ((pFocusComposePage->IsAudioExist() && mediaType == MEDIA_TYPE_IMAGE) ||
-                               (pFocusComposePage->IsImageExist() && mediaType == MEDIA_TYPE_AUDIO) ||
+                       if ((pFocusComposePage->IsAudioExist() && mediaType == MEDIA_TYPE_IMAGE && !pFocusComposePage->IsImageExist()) ||
+                               (pFocusComposePage->IsImageExist() && mediaType == MEDIA_TYPE_AUDIO && !pFocusComposePage->IsAudioExist()) ||
                                ((mediaType == MEDIA_TYPE_VIDEO) && (!pFocusComposePage->IsAudioExist()) && (!pFocusComposePage->IsImageExist()) && (!pFocusComposePage->IsVideoExist())) ||
                                ((mediaType == MEDIA_TYPE_AUDIO) && (!pFocusComposePage->IsAudioExist()) && (!pFocusComposePage->IsVideoExist())) ||
                                ((mediaType == MEDIA_TYPE_IMAGE) && (!pFocusComposePage->IsVideoExist()) && (!pFocusComposePage->IsImageExist())))
@@ -412,7 +412,15 @@ MessageComposePanel::InsertFileToPage(const String& selectFilepath)
                        switch (modalResult)
                        {
                        case MSGBOX_RESULT_CANCEL:
+                       {
+                               if (__pCompressProgressPopup)
+                               {
+                                       delete __pCompressProgressPopup;
+                                       __pCompressProgressPopup = null;
+                               }
+                               SetFocusToLastPage();
                                return MSG_RESPONSE_INVALID_MEDIA_TYPE;
+                       }
                                break;
 
                        default:
@@ -1196,7 +1204,7 @@ result
 MessageComposePanel::LaunchAppControl(RequestType requestType)
 {
        AppLogDebug("ENTER");
-       result r = E_SUCCESS;
+       result r = E_FAILURE;
        AppControl* pAppCntl = null;
 
        String* pUriData = null;
@@ -1305,7 +1313,6 @@ MessageComposePanel::LaunchAppControl(RequestType requestType)
                pArgList->Add((new (std::nothrow) Integer(false)));
 
                GetParent()->SendUserEvent(REQUEST_HEADER_BUTTON_STATE, pArgList);
-               //GetParent()->SendUserEvent(REQUEST_ENABLE_DISABLE_CONTACT_BUTTON, null);
        }
        AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult()));
        return r;
index 296a0d5..727cbe4 100644 (file)
@@ -189,6 +189,8 @@ MessagesApp::OnForeground(void)
                        pArgList->Add((new (std::nothrow) Integer(true)));
                        requestId = REQUEST_HEADER_BUTTON_STATE;
                        pCurrentForm->SendUserEvent(requestId, pArgList);
+                       requestId = REQUEST_SET_MAXIMUM_SIZE;
+                       pCurrentForm->SendUserEvent(requestId, null);
                }
        }
        AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult()));
index 39df14d..1dad620 100644 (file)
@@ -366,10 +366,9 @@ MmsDetailForm::OnInitializing(void)
                        __pMmsTextBox->SetColor(TEXT_BOX_STATUS_DISABLED, GetBackgroundColor());
                        Color color = __pMmsTextBox->GetTextColor(TEXT_BOX_TEXT_COLOR_NORMAL);
                        __pMmsTextBox->SetTextColor(TEXT_BOX_TEXT_COLOR_DISABLED, color);
-                       //      TODO: If touch event listener is added scroll do not work.
-                       __pMmsTextBox->SetShowState(true);
                        __pMmsTextBox->AddTouchEventListener(*this);
-                       __pMmsTextBox->SetEnabled(false);
+                       __pMmsTextBox->SetShowState(true);
+                       __pMmsTextBox->SetEnabled(true);
                }
                __pGallery = static_cast<Gallery*>(__pScrollPanel->GetControl(L"IDC_GALLERY_MMS_IMAGE"));
                __pGallery->SetShowState(false);
@@ -1294,6 +1293,11 @@ MmsDetailForm::NextSlide(void)
 {
        AppLogDebug("ENTER");
 
+       if (IsSlideShowPauseState())
+       {
+               UpdatePlayControl();
+               __isSlideShowInPrgress = true;
+       }
        __pTimer->Cancel();
        if (__currentSlideIndex < (__pMmsSlideData->GetSlideCount() - 1))
        {
@@ -1316,6 +1320,12 @@ MmsDetailForm::PreviousSlide(void)
 {
        AppLogDebug("ENTER");
 
+       if (IsSlideShowPauseState())
+       {
+               UpdatePlayControl();
+               __isSlideShowInPrgress = true;
+       }
+
        __pTimer->Cancel();
        if (__currentSlideIndex > 0)
        {
index 2df902b..46d278c 100644 (file)
@@ -59,7 +59,26 @@ SubjectControl::Construct(const Rectangle& rectangle)
        AppLogDebug("ENTER");\r
        result r = E_SUCCESS;\r
        r = Container::Construct(rectangle);\r
-       __pBgBitmap = BitmapUtility::GetInstance()->GetIconN(MSG_ICON_SEARCH_INPUT_BG);\r
+       // Subject edit filed.\r
+       __pEditArea = new (std::nothrow) EditField();\r
+       __pEditArea->Construct(Rectangle(0, 0, rectangle.width, rectangle.height),\r
+                                                  EDIT_FIELD_STYLE_NORMAL, INPUT_STYLE_OVERLAY);\r
+       __pEditArea->AddFocusEventListener(*this);\r
+       __pEditArea->SetOverlayKeypadCommandButtonVisible(false);\r
+       //__pEditArea->SetGuideText(L"Subject");\r
+       __pEditArea->SetColor(EDIT_STATUS_PRESSED, __pEditArea->GetColor(EDIT_STATUS_NORMAL));\r
+       __pEditArea->SetTextColor(EDIT_TEXT_COLOR_HIGHLIGHTED, __pEditArea->GetTextColor(EDIT_TEXT_COLOR_NORMAL));\r
+       AddControl(*__pEditArea);\r
+       //__pBgBitmap = BitmapUtility::GetInstance()->GetIconN(MSG_ICON_SEARCH_INPUT_BG);\r
+       //Initialize editor background bitmap to avoid flicker\r
+       Rectangle editorBound = __pEditArea->GetBounds();\r
+       __pBgBitmap = new (std::nothrow) Bitmap();\r
+       Canvas* pEditorBgCanvas = new (std::nothrow) Canvas();\r
+       pEditorBgCanvas->Construct(editorBound);\r
+       pEditorBgCanvas->FillRoundRectangle(__pEditArea->GetColor(EDIT_STATUS_NORMAL), editorBound, Dimension(2, 2));\r
+       __pBgBitmap->Construct(*pEditorBgCanvas, editorBound);\r
+       delete pEditorBgCanvas;\r
+\r
        // add delete button\r
        __pDeleteButton = new (std::nothrow) Button();\r
        __pDeleteButton->Construct(Rectangle(rectangle.width - W_ICON_48PX - MARGIN_16PX,\r
@@ -74,16 +93,7 @@ SubjectControl::Construct(const Rectangle& rectangle)
        AddControl(*__pDeleteButton);\r
        delete pPressBitMap;\r
        delete pNormalBitMap;\r
-       // Subject edit filed.\r
-       __pEditArea = new (std::nothrow) EditField();\r
-       __pEditArea->Construct(Rectangle(0, 0, rectangle.width, rectangle.height),\r
-                                                  EDIT_FIELD_STYLE_NORMAL, INPUT_STYLE_OVERLAY);\r
-       __pEditArea->AddFocusEventListener(*this);\r
-       __pEditArea->SetOverlayKeypadCommandButtonVisible(false);\r
-       //__pEditArea->SetGuideText(L"Subject");\r
-       __pEditArea->SetColor(EDIT_STATUS_PRESSED, __pEditArea->GetColor(EDIT_STATUS_NORMAL));\r
-       __pEditArea->SetTextColor(EDIT_TEXT_COLOR_HIGHLIGHTED, __pEditArea->GetTextColor(EDIT_TEXT_COLOR_NORMAL));\r
-       AddControl(*__pEditArea);\r
+\r
        AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult()));\r
        return r;\r
 }\r
@@ -101,7 +111,10 @@ SubjectControl::OnDraw(void)
                                                           Rectangle(0, 0, rect.width, rect.height));\r
                if (__pBgBitmap)\r
                {\r
-                       pCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, rect.width, rect.height), *__pBgBitmap);\r
+               //      pCanvas->DrawNinePatchedBitmap(Rectangle(0, 0, rect.width, rect.height), *__pBgBitmap);\r
+                       pCanvas->DrawBitmap(Rectangle(0, 0, rect.width, rect.height),\r
+                                                               *__pBgBitmap);\r
+\r
                }\r
                delete pCanvas;\r
        }\r
index d5d715b..7134cde 100644 (file)
@@ -281,7 +281,7 @@ const wchar_t* IDS_APPCONTROL_PROVIDER_IMAGE = L"tizen.imageviewer";
 const wchar_t* IDS_APPCONTROL_PROVIDER_CAMERA = L"tizen.camera";
 const wchar_t* IDS_APPCONTROL_PROVIDER_VIDEO = L"tizen.videoplayer";
 const wchar_t* IDS_APPCONTROL_PROVIDER_AUDIO = L"tizen.musicplayer";
-const wchar_t* IDS_APPCONTROL_PROVIDER_CALENDAR = L"tizen.events";
+const wchar_t* IDS_APPCONTROL_PROVIDER_CALENDAR = L"tizen.calendar";
 const wchar_t* IDS_APPCONTROL_PROVIDER_GALLERY = L"tizen.gallery";
 const wchar_t* IDS_APPCONTROL_PROVIDER_MEMO = L"tizen.memo";
 const wchar_t* IDS_MESSAGING = L"Messaging";