TizenRefApp-6771 Input panel is visible in selection mode 67/96667/5 submit/tizen_3.0/20161114.154524
authorOleksander Kostenko <o.kostenko@samsung.com>
Wed, 9 Nov 2016 15:42:56 +0000 (17:42 +0200)
committerOleksandr Kostenko <o.kostenko@samsung.com>
Mon, 14 Nov 2016 12:38:56 +0000 (04:38 -0800)
Change-Id: I89216a614552f6017f9878fb62e053df1016342e
Signed-off-by: Oleksander Kostenko <o.kostenko@samsung.com>
src/Conversation/Main/Controller/inc/Conversation.h
src/Conversation/Main/Controller/src/Conversation.cpp

index 0331793..10acbfa 100644 (file)
@@ -157,7 +157,9 @@ namespace Msg
             void showConvList(bool show);
             void showRecipPanel(bool show);
             void showContactList(bool show);
-            void showMsgInputPanel(bool show);
+            void createMsgInputPanel();
+            void destroyMsgInputPanel();
+            void showMsgInputPanelIfNeeded(bool show);
             void updateMsgInputPanel();
             void updateNavibar();
             void updateSelectMsgTitle();
index 2cad664..e28437a 100644 (file)
@@ -283,7 +283,7 @@ void Conversation::setThreadId(ThreadId id, const char *searchWord, bool updateC
         m_AddressList.reset();
 
     setMode(m_ThreadId.isValid() ? ConversationMode : NewMessageMode);
-    showMsgInputPanel(!isHiddenAddress());
+    isHiddenAddress() ? destroyMsgInputPanel() : showMsgInputPanelIfNeeded(true);
 
     if(m_pBody)
         m_pBody->setMmsRecipFlag(getMsgEngine().getStorage().hasEmail(m_ThreadId));
@@ -374,7 +374,7 @@ void Conversation::setNewMessageMode()
 
     m_Mode = NewMessageMode;
     m_pLayout->showRecipEditMode(true);
-    showMsgInputPanel(true);
+    showMsgInputPanelIfNeeded(true);
     showRecipPanel(true);
     showContactList(true);
     m_pRecipPanel->update(m_ThreadId);
@@ -480,41 +480,60 @@ void Conversation::showContactList(bool show)
     }
 }
 
-void Conversation::showMsgInputPanel(bool show)
+void Conversation::createMsgInputPanel()
 {
-    if(show)
+    if(!m_pMsgInputPanel)
     {
-        if(!m_pMsgInputPanel)
-        {
-            m_pMsgInputPanel = new MessageInputPanel(*m_pConvList);
-            m_pMsgInputPanel->setListener(this);
-            m_pLayout->setMsgInputPanel(*m_pMsgInputPanel);
-        }
-        if(!m_pBody && m_pConvList)
-        {
-            m_pBody = new Body(*m_pMsgInputPanel, getApp(), m_WorkingDir, *m_pConvList);
-            m_pBody->setListener(this);
+        m_pMsgInputPanel = new MessageInputPanel(*m_pConvList);
+        m_pMsgInputPanel->setListener(this);
+        m_pLayout->setMsgInputPanel(*m_pMsgInputPanel);
+    }
+    if(!m_pBody && m_pConvList)
+    {
+        m_pBody = new Body(*m_pMsgInputPanel, getApp(), m_WorkingDir, *m_pConvList);
+        m_pBody->setListener(this);
+        m_pMsgInputPanel->setEntry(*m_pBody);
+        updateMsgInputPanel();
+    }
+}
+
+void Conversation::destroyMsgInputPanel()
+{
+    if(m_pBody)
+    {
+        m_pBody->setListener(this);
+        m_pBody->destroy();
+        m_pBody = nullptr;
+    }
+    if(m_pMsgInputPanel)
+    {
+        m_pMsgInputPanel->setListener(this);
+        m_pMsgInputPanel->destroy();
+        m_pMsgInputPanel = nullptr;
+    }
+    m_pLayout->showMsgInputPanel(false);
+}
+
+void Conversation::showMsgInputPanelIfNeeded(bool show)
+{
+    if(show && !isHiddenAddress())
+    {
+        createMsgInputPanel();
+        if(m_pBody)
             m_pBody->show();
-            m_pMsgInputPanel->setEntry(*m_pBody);
-            updateMsgInputPanel();
-        }
+        if(m_pMsgInputPanel)
+            m_pMsgInputPanel->show();
     }
     else
     {
         if(m_pBody)
-        {
-            m_pBody->setListener(this);
-            m_pBody->destroy();
-            m_pBody = nullptr;
-        }
+            m_pBody->hide();
         if(m_pMsgInputPanel)
-        {
-            m_pMsgInputPanel->setListener(this);
-            m_pMsgInputPanel->destroy();
-            m_pMsgInputPanel = nullptr;
-        }
+            m_pMsgInputPanel->hide();
     }
     m_pLayout->showMsgInputPanel(show);
+    if(m_pConvList)
+        m_pConvList->getComposeItem().show(show);
 }
 
 void Conversation::write(const Message &msg)
@@ -1171,6 +1190,7 @@ void Conversation::onHwBackButtonClicked()
     {
         m_pConvList->setMode(ConvList::NormalMode);
         updateNavibar();
+        showMsgInputPanelIfNeeded(true);
         return;
     }
 
@@ -1210,6 +1230,7 @@ void Conversation::onNaviOkButtonClicked()
         m_pConvList->deleteSelectedItems();
         m_pConvList->setMode(ConvList::NormalMode);
         updateNavibar();
+        showMsgInputPanelIfNeeded(true);
     }
 }
 
@@ -1368,6 +1389,7 @@ void Conversation::onDeleteItemPressed(PopupListItem &item)
         m_AttachPanel.show(false);
     m_pConvList->setMode(ConvList::SelectMode);
     updateNavibar();
+    showMsgInputPanelIfNeeded(false);
 }
 
 void Conversation::onAddRecipientsItemPressed(PopupListItem &item)