TSAM-8885 Message reply don't display on Active notification after tap REPLY 61/95761/1 submit/tizen_3.0/20161104.145726
authorOleksander Kostenko <o.kostenko@samsung.com>
Fri, 4 Nov 2016 13:04:15 +0000 (15:04 +0200)
committerOleksander Kostenko <o.kostenko@samsung.com>
Fri, 4 Nov 2016 13:04:15 +0000 (15:04 +0200)
Change-Id: I2286568d9a0a357a0cebc1ef1a10d9c46e3214d2
Signed-off-by: Oleksander Kostenko <o.kostenko@samsung.com>
src/Common/AppControl/inc/AppControlDefault.h
src/Common/AppControl/src/AppControlDefault.cpp
src/Common/View/src/NaviFrameItem.cpp
src/Conversation/Body/Controller/inc/Body.h
src/Conversation/Body/Controller/src/Body.cpp
src/Conversation/Main/Controller/src/Conversation.cpp

index 5c7a45e74c4d3e5a4a156050d76189f6687cdb48..b10340d043d30b32daa7cc814a07a034ca4db341 100644 (file)
@@ -35,10 +35,10 @@ namespace Msg
             {
                 UnknownType,
                 MainType, //Type from home screen
-                ReplyType, //Type for reply message button clicked
-                ViewType, //Type for view message button clicked
+                ReplyType, //Type for reply message button clicked from Active Notification
+                ViewType, //Type for view message button clicked from Active Notification
                 NotificationType, //Type from notification panel
-                SendFailedType //Send failed message type
+                SendFailedType //Send failed message type from notification panel
             };
 
         public:
@@ -47,16 +47,19 @@ namespace Msg
 
             MsgId getMessageId() const;
             DefaultType getDefaultType() const;
+            const std::string& getReplyText() const;
 
         private:
             bool isNotificationPanel(app_control_h handle) const;
             void parse(app_control_h handle);
             void replyMessage(app_control_h handle);
             void viewMessage(app_control_h handle);
+            void makeReplyText(app_control_h handle);
 
         private:
             MsgId m_MsgId;
             DefaultType m_DefaultType;
+            std::string m_ReplyText;
     };
 }
 
index 7d298fda631a951ffc58f8ec5a94cff29b8a7314..3e17959f5ccf301e1311fc02d0ab4cc8bfac4dde 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include "AppControlDefault.h"
+#include "AppControlUtils.h"
 
 using namespace Msg;
 
@@ -22,7 +23,6 @@ namespace
 {
     const char *notificationPanel = "http://tizen.org/appcontrol/data/notification";
     const char *keyType = "type";
-    const char *valueReply = "reply";
     const char *valueNewMsg = "new_msg";
     const char *valueSendFailed = "send_failed_msg";
     const char *keyMsgId = "msgId";
@@ -51,6 +51,11 @@ AppControlDefault::DefaultType AppControlDefault::getDefaultType() const
     return m_DefaultType;
 }
 
+const std::string& AppControlDefault::getReplyText() const
+{
+    return m_ReplyText;
+}
+
 void AppControlDefault::parse(app_control_h handle)
 {
     char *key = nullptr;
@@ -63,9 +68,7 @@ void AppControlDefault::parse(app_control_h handle)
 
     std::string type = key;
     free(key);
-    if(type == valueReply)
-        m_DefaultType = ReplyType;
-    else if(type == valueNewMsg)
+    if(type == valueNewMsg)
         viewMessage(handle);
     else if(type == valueSendFailed)
         m_DefaultType = SendFailedType;
@@ -96,8 +99,14 @@ bool AppControlDefault::isNotificationPanel(app_control_h handle) const
 
 void AppControlDefault::viewMessage(app_control_h handle)
 {
+    makeReplyText(handle);
     if(isNotificationPanel(handle))
         m_DefaultType = NotificationType;
     else
-        m_DefaultType = ViewType;
+        m_DefaultType = m_ReplyText.empty() ? ViewType : ReplyType;
+}
+
+void AppControlDefault::makeReplyText(app_control_h handle)
+{
+    m_ReplyText = AppControlUtils::getExtraData(handle, APP_CONTROL_DATA_TEXT);
 }
index 352255d4735a5b5b62021616857fa2625c248883..9bcbb89870c92f06241190bf048ab5f07ac7d336 100644 (file)
@@ -40,7 +40,7 @@ namespace
     const char *cancelButtonDefTextId = "IDS_MSG_ACBUTTON_CANCEL_ABB";
     const char *okButtonDefTextId = "IDS_MSG_ACBUTTON_DONE_ABB";
     const char *buttonTypeKey = "BTkey";
-    const char *textColorBlueDisableButtons = "#216959";
+    const char *textColorBlueDisableButtons = "#abd1d6";
     const char *textColorBlueTitleButtons = "#2e8b99";
     const char *textColorWhiteTitleButtons = "#fafafa";
     const int textSizeCenterButton = 50;
index 367f1451f3852b1277388c56f116723ce41184bd..dfdacfab8b27fdaafd80118f8d3e37b95e861971 100644 (file)
@@ -22,6 +22,7 @@
 #include "MessageMms.h"
 #include "WorkingDir.h"
 #include "AppControlCompose.h"
+#include "AppControlDefault.h"
 #include "AttachmentHandler.h"
 #include "ComposeListItem.h"
 
@@ -61,6 +62,7 @@ namespace Msg
             void read(Message &msg);
             void write(const Message &msg);
             void execCmd(const AppControlComposeRef &cmd);
+            void execCmd(const AppControlDefaultRef &cmd);
 
         private:
             ComposeListItem &getComposeItem();
index e66d73cde41d7119316cbb79f7709aa68533862c..21ad0cf5c3be048aab2502f47bf955420a738094 100644 (file)
@@ -333,6 +333,7 @@ void Body::readText(MessageMms &msg)
 
 void Body::execCmd(const AppControlComposeRef &cmd)
 {
+    clear();
     setText(cmd->getMessageText());
     std::list<std::string> path = cmd->getFileList();
     if(!cmd->getVcfInfo().contactsIdList.empty())
@@ -341,6 +342,15 @@ void Body::execCmd(const AppControlComposeRef &cmd)
     addAttachments(path);
 }
 
+void Body::execCmd(const AppControlDefaultRef &cmd)
+{
+    if(cmd->getDefaultType() == AppControlDefault::ReplyType)
+    {
+        clear();
+        setText(cmd->getReplyText());
+    }
+}
+
 void Body::onMaxLengthReached()
 {
     MSG_LOG("");
index 45fd33c865439ca7df6beea1879ece987a5980cd..2cad66416d1fb044881f416027f7d05105cb8207 100644 (file)
@@ -159,7 +159,10 @@ void Conversation::execCmd(const AppControlDefaultRef &cmd)
     else
         navigateToBottom();
     if(cmd->getDefaultType() == AppControlDefault::ReplyType)
+    {
+        m_pBody->execCmd(cmd);
         m_pBody->setFocus(true);
+    }
 }
 
 void Conversation::create()
@@ -1335,7 +1338,10 @@ void Conversation::onNoRecipDiscardButtonClicked(Popup &popup, int buttonId)
                 if(msg)
                     setThreadId(msg->getThreadId());
                 if(m_DefferedCmd.defaultCmd->getDefaultType() == AppControlDefault::ReplyType && m_pBody)
+                {
+                    m_pBody->execCmd(m_DefferedCmd.defaultCmd);
                     m_pBody->setFocus(true);
+                }
             }
         }
         else if(m_DefferedCmd.composeCmd)