Fix the conflict changes. 76/50176/1
authorSung-jae Park <nicesj.park@samsung.com>
Mon, 26 Oct 2015 12:45:10 +0000 (21:45 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Mon, 26 Oct 2015 12:45:50 +0000 (21:45 +0900)
Change-Id: I9648d75d0446ca80e25a5460c0df30112f224f36

20 files changed:
TelegramTizen/inc/tg_audio_player.h [new file with mode: 0644]
TelegramTizen/res/edje/telegram_init_screen.edc
TelegramTizen/res/edje/telegram_theme.edc
TelegramTizen/res/images/telegram_audio_player_pause_dim.png [new file with mode: 0644]
TelegramTizen/res/images/telegram_audio_player_pause_normal.png [new file with mode: 0644]
TelegramTizen/res/images/telegram_audio_player_pause_press.png [new file with mode: 0644]
TelegramTizen/res/images/telegram_audio_player_play_dim.png [new file with mode: 0644]
TelegramTizen/res/images/telegram_audio_player_play_normal.png [new file with mode: 0644]
TelegramTizen/res/images/telegram_audio_player_play_press.png [new file with mode: 0644]
TelegramTizen/res/images/telegram_icon_expand_close.png [new file with mode: 0644]
TelegramTizen/res/images/telegram_icon_expand_open.png [new file with mode: 0644]
TelegramTizen/src/telegramtizen.c
TelegramTizen/src/tg_audio_player.c [new file with mode: 0644]
TelegramTizen/src/tg_messaging_view.c
TelegramTizen/src/tg_settings_view.c
TelegramTizen/src/tg_user_main_view.c
TelegramTizen/tg_utils/tg_common.h
tg-engine-service/inc/tg_db_wrapper.h
tg-engine-service/src/tg_db_wrapper.c
tg-engine-service/tg_engine/tg_engine.c

diff --git a/TelegramTizen/inc/tg_audio_player.h b/TelegramTizen/inc/tg_audio_player.h
new file mode 100644 (file)
index 0000000..2d85368
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * tg_audio_player.h
+ *
+ *  Created on: Oct 22, 2015
+ *      Author: sandeep
+ */
+
+#ifndef TG_AUDIO_PLAYER_H_
+#define TG_AUDIO_PLAYER_H_
+
+#include "tg_common.h"
+#include <player.h>
+
+typedef enum AUDIO_PLAYER_STATE {
+       TG_AUDIO_PLAYER_STATE_NONE = 1,
+       TG_AUDIO_PLAYER_STATE_INITIALIZED,
+       TG_AUDIO_PLAYER_STATE_PLAYING,
+       TG_AUDIO_PLAYER_STATE_INTERRUPTED,
+       TG_AUDIO_PLAYER_STATE_PAUSE,
+       TG_AUDIO_PLAYER_STATE_ERROR,
+       TG_AUDIO_PLAYER_STATE_END
+} TG_AUDIO_PLAYER_STATE;
+
+typedef void (*tg_player_state_changed)(void* handler, TG_AUDIO_PLAYER_STATE state, void *user_data);
+typedef void (*tg_player_progress_updated)(void* handler, int current, int total, void *user_data);
+
+typedef struct tg_player_handler_s {
+       player_h handler;
+       tg_player_state_changed state_callback;
+       tg_player_progress_updated progress_callback;
+       TG_AUDIO_PLAYER_STATE state;
+       void *user_data;
+       Ecore_Timer *timer;
+       int current_pos;
+} tg_player_handler;
+
+tg_player_handler* init_audio_player(const char *audio_file, tg_player_state_changed state_change, tg_player_progress_updated progress_update, void *user_data);
+
+void play_audio_player(tg_player_handler *handler);
+
+void pause_audio_player(tg_player_handler *handler);
+
+void destroy_audio_player(tg_player_handler *handler);
+
+#endif /* TG_AUDIO_PLAYER_H_ */
index 57a38de..9474df1 100644 (file)
@@ -20,6 +20,8 @@ styles {
 
 collections {
 
+base_scale: 2.6; 
+       
  #define WIN_WIDTH 720
  #define WIN_HEIGHT 1280
 
@@ -976,85 +978,211 @@ collections {
                }
                }
        }
+               
+
+group
+{
+       name: "message_title_box";
+       parts{
+               part{
+                       name: "swallow.back_arrow";
+                       type: SWALLOW;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 0.01 0.0; }
+                               rel2 { relative: 0.05 1.0; }
+                       }                               
+               }
+
+               part{
+                       name: "swallow.profile_pic";
+                       type: SWALLOW;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 0.05 0.032; }
+                               rel2 { relative: 0.196 0.968; }
+                       }                               
+               }
+
+               part{
+                       name: "swallow.profile_name";
+                       type: SWALLOW;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 0.196 0.1; }
+                               rel2 { relative: 0.8 0.5; }                             
+                       }                               
+               }
+               part{
+                       name: "swallow.profile_time";
+                       type: SWALLOW;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 0.196 0.5; }
+                               rel2 { relative: 0.8 1.0; }                             
+                       }                               
+               } 
+               part{
+                       name: "swallow.expand_btn";
+                       type: SWALLOW;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 0.8 0.0; }
+                               rel2 { relative: 1.0 1.0; }
+                       }                               
+               }               
+       }
+}
+
+
+group
+{
+       name: "chat_title_box";
+       parts{
+               part{
+                       name: "main_bg";
+                       type: RECT;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 0.0 0.0; }
+                               rel2 { relative: 1.0 1.0; }
+                               color: 45 165 224 255;
+                       }                               
+               }
+               part{
+                       name: "swallow.back_arrow";
+                       type: SWALLOW;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 0.0 0.3; }
+                               rel2 { relative: 0.1 0.7; }
+                       }                               
+               }
+               
+               part{
+                       name: "swallow.profile_pic";
+                       type: SWALLOW;
+                       scale: 1;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: (72+60)/720 (16.8+60)/153.6; }
+                               rel2 { relative: (72+60)/720 (16.8+60)/153.6; }
+                               min: 180 120;
+                               max: 180 120;
+                               fixed: 1 1;
+                       }                               
+               }
+               part{
+                       name: "swallow.profile_name,space";
+                       type: SPACER;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 1.0 0.1; to_x: "swallow.profile_pic"; }
+                               rel2 { relative: 1.0 0.5; to_x: "swallow.profile_pic"; }
+                               min: 15 0;
+                               max: 15 -1;
+                               fixed: 1 0;                             
+                       }                               
+               }       
+               
+               part{
+                       name: "swallow.profile_name";
+                       type: SWALLOW;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 1.0 0.1; to_x: "swallow.profile_name,space"; }
+                               rel2 { relative: 0.8 0.5; }                             
+                       }                               
+               }
+               part{
+                       name: "swallow.profile_time";
+                       type: SWALLOW;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 1.0 0.5; to_x: "swallow.profile_name,space";  }
+                               rel2 { relative: 0.8 1.0; }                             
+                       }                               
+               } 
+               
+               part{
+                       name: "swallow.expand_btn";
+                       type: SWALLOW;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 0.8 0.3; }
+                               rel2 { relative: 1.0 0.7; }
+                       }                               
+               }
+       }
+       programs {
+                       program {
+                               name: "pic_default";
+                               signal: "pro_pic_default";
+                               source: "pro_pic_resize";
+                               action: STATE_SET "default" 0.0;
+                               target: "swallow.profile_pic";
+                       }
+                       program {
+                               name: "pic_land";
+                               signal: "pro_pic_land";
+                               source: "pro_pic_resize";
+                               action: STATE_SET "land" 0.0;
+                               target: "swallow.profile_pic";
+                       }
+       }
+}
        
        group
     {
                name: "chat_messaging_layout";
        parts{
-               part {
-                       name: "bg";
-                       type:RECT;
+          part{
+                       name: "swallow.title_box";
+                       type: SWALLOW;
                        description{
                                state: "default" 0.0;
                                rel1 { relative: 0.0 0.0; }
-                               rel2 { relative: 1.0 1.0; }
+                               rel2 { relative: 1.0 0.12; }
                                color: 0 0 0 0;
                        }
-               }
-               
-
+          }
           part{
-                       name: "swallow.title_box.bg";
-                       type:RECT;
-                       scale: 1;
-                       description{
-                               state: "default" 0.0;
-                               min: WIN_WIDTH 62;
-                               max: WIN_WIDTH 62;
-                               fixed: 1 1;
-                               align: 0 0;
-                               rel1 { relative: 0.0 0.0; to: "bg"; }
-                               rel2 { relative: 0.0 0.0; to: "bg"; }
-                               color: 45 165 224 255;
-                       }
-               }
-               
-          part{
-                       name: "swallow.title_box";
-                       type:SWALLOW;
-                       scale: 1;
+                       name: "swallow.chat_box";
+                       type: SWALLOW;
                        description{
                                state: "default" 0.0;
-                               min: WIN_WIDTH 62;
-                               max: WIN_WIDTH 62;
-                               fixed: 1 1;
-                               align: 0 0;
-                               rel1 { relative: 0.0 0.0; to: "bg"; }
-                               rel2 { relative: 0.0 0.0; to: "bg"; }
-                               color: 50 23 55 255;
+                               rel1 { relative: 0.0 0.12; }
+                               rel2 { relative: 1.0 1.0; }
+                               color: 0 0 0 0;
                        }
                }
-          part{
-                       name: "swallow.chat_box";
-                       type:SWALLOW;
+               part{
+                       name: "swallow.no_msg_text";
+                       type: SWALLOW;
                        description{
                                state: "default" 0.0;
-                               rel1 { relative: 0.0 1.0; to_x: "bg"; to_y: "swallow.title_box"; }
-                               rel2 { relative: 1.0 0.0; to_x: "bg"; to_y: "swallow.entry_box"; }
-                               color: 27 54 87 255;
+                               rel1 { relative: 0.0 0.55; }
+                               rel2 { relative: 1.0 0.65; }
+                               color: 0 0 0 0;
                        }
                }
-               part{
-                       name: "swallow.entry_box";
+               part{
+                       name: "swallow.group_detail_box,bg";
                        type: SWALLOW;
                        description{
                                state: "default" 0.0;
-                               min: 0 0;
-                               max: 0 0;
-                               fixed: 1 1;
-                               align: 0 1;
-                               rel1 { relative: 0.0 1.0; to: "bg"; }
-                               rel2 { relative: 1.0 1.0; to: "bg"; }
-                               color: 50 100 255 255;
+                               rel1 { relative: 0.0 0.12; }
+                               rel2 { relative: 1.0 0.25; }
+                               color: 0 0 0 0;
                        }
                }
                part{
-                       name: "swallow.no_msg_text";
+                       name: "swallow.group_detail_box";
                        type: SWALLOW;
                        description{
                                state: "default" 0.0;
-                               rel1 { relative: 0.0 0.55; }
-                               rel2 { relative: 1.0 0.65; }
+                               rel1 { relative: 0.0 0.12; }
+                               rel2 { relative: 1.0 0.25; }
                                color: 0 0 0 0;
                        }
                }
@@ -1180,51 +1308,6 @@ collections {
        }
     }
     
-group
-{
-       name: "message_title_box";
-       parts{
-
-               part{
-                       name: "swallow.back_arrow";
-                       type:SWALLOW;
-                       description{
-                               state: "default" 0.0;
-                               rel1 { relative: 0.01 0.0; }
-                               rel2 { relative: 0.05 1.0; }
-                       }                               
-               }
-
-               part{
-                       name: "swallow.profile_pic";
-                       type:SWALLOW;
-                       description{
-                               state: "default" 0.0;
-                               rel1 { relative: 0.05 0.032; }
-                               rel2 { relative: 0.196 0.968; }
-                       }                               
-               }
-
-               part{
-                       name: "swallow.profile_name";
-                       type:SWALLOW;
-                       description{
-                               state: "default" 0.0;
-                               rel1 { relative: 0.196 0.1; }
-                               rel2 { relative: 0.8 0.5; }                             
-                       }                               
-               }
-               part{
-                       name: "swallow.profile_time";
-                       type:SWALLOW;
-                       description{
-                               state: "default" 0.0;
-                               rel1 { relative: 0.196 0.5; }
-                               rel2 { relative: 0.8 1.0; }                             
-                       }                               
-               }               
-       }
-}
 
        images {
                image: "bubble_sent_bg.#.png" COMP;
@@ -1458,40 +1541,38 @@ group
        images {
                image: "telegram_button_on_bg.#.png" COMP;
        }
+       
+       
+       
 
        group
     {
        name: "chat_service_item_box";
        parts{
-           part {
-                               name: "chat_service_bg,color";
-                               type: RECT;
-                               description {
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.0 0.0; }
-                                       rel2 { relative: 1.0 1.0; }
-                                       color: 225 237 241 0;
-                               }
-                       }
                part {
-                               name: "chat_service_bg";
-                               type: RECT;
-                               description {
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.0 0.0; to, "swallow.chat_service_text"; }
-                                       rel2 { relative: 1.0 1.0; to, "swallow.chat_service_text"; }
+                       name: "bg";
+                       type:RECT;
+                               scale: 1;                       
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 0.0 0.5; }
+                               rel2 { relative: 1.0 0.5; }
+                                       max: -1 116;
+                                       min: 0 116;
+                                       align: 0.5 0.5;
+                                       fixed: 0 1;
                                        color: 0 0 0 0;
-                               }
-                       }
+                       }                       
+               }
                part{
                        name: "chat_serv_image";
                        type:IMAGE;
                        description{
                                state: "default" 0.0;
-                               rel1 { relative: 0.0 -0.2; to, "chat_service_bg"; }
-                               rel2 { relative: 1.0 0.9; to, "chat_service_bg"; }
+                               rel1 { relative: 32/720 27/116; to, "bg"; }
+                               rel2 { relative: (720-32)/720 (116-41)/116; to, "bg"; }
                                image {
-                                       border: 5 5 5 5;                            
+                                       border: 46 46 0 0;                         
                                                normal: "telegram_button_on_bg.#.png";
                                        }
                                        color: 0 0 0 25;
@@ -1502,8 +1583,8 @@ group
                        type:SWALLOW;
                        description{
                                state: "default" 0.0;
-                               rel1 { relative: 0.1 0.2; }
-                               rel2 { relative: 0.9 0.8; }
+                               rel1 { relative: 0.0 0.0; to: "chat_serv_image"; }
+                               rel2 { relative: 1.0 1.0; to: "chat_serv_image"; }
                        }
                }               
        }
@@ -2419,7 +2500,32 @@ group
          }
       }
     }
-
+    
+    group { 
+         name: "bubble_audio_item_layout";
+      parts {
+         part {
+            name: "swallow.play_icon";
+            type: SWALLOW; 
+            description {
+               state: default 0.0;
+               rel1.relative: 0.0 0.0;
+               rel2.relative: 0.2 1.0;
+               color: 255 0 0 255;                       
+            }
+         }
+         part {
+            name: "swallow.progress_icon";
+            type: SWALLOW; 
+            description { 
+               state: default 0.0;
+               rel1.relative: 0.25 0.0;
+               rel2.relative: 0.75 1.0;
+               color: 0 255 0 255;                       
+            }
+         }
+      }
+    }
 
    group {
          name: "settings_screen";
index 951d624..be2bdd2 100644 (file)
@@ -457,6 +457,1821 @@ styles {
    }
 
 
+/****************** sandeep ****************/
+
+
+group { name: "elm/entry/base-noedit/readmessage_audio";
+      parts {
+         part{
+                       name: "swallow.audio_bg";
+                       type: RECT;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 0.0 0.0; }
+                               rel2 { relative: 0.9 1.0; }
+                               color: 0 0 0 0;                                 
+                       }                               
+               }
+         part {
+            name: "elm.bubble.callerid.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel2.relative: 0.0 0.0;
+               align: 0.0 0.0;
+               min: 0 0;
+               fixed: 1 1;
+            }
+            description {
+               state: "callerid_on" 0.0;
+               inherit: "default" 0.0;
+               min: ENTRY_BUBBLE_CALLERID_PAD 0;
+            }
+         }
+         part {
+            name: "elm.callerid.icon.pad";
+            type: SPACER;
+            scale: 1;
+            description { state: "default" 0.0;
+            rel2.relative: 0.0 0.0;
+               align: 0.0 0.0;
+               min: ENTRY_BUBBLE_CALLERID_ICON_PAD 0;
+               fixed: 1 1;
+            }
+         }
+         part {
+            name: "elm.swallow.callerid";
+            type: SWALLOW;
+            scale: 1;
+            description { state: "default" 0.0;
+               min: ENTRY_BUBBLE_CALLERID_WIDTH ENTRY_BUBBLE_CALLERID_HEIGHT;
+               max: ENTRY_BUBBLE_CALLERID_WIDTH ENTRY_BUBBLE_CALLERID_HEIGHT;
+               fixed: 1 1;
+               align: 0.0 0.0;
+               rel1 {
+                  to: "elm.callerid.icon.pad";
+                  relative: 1.0 0.0;
+               }
+               rel2 {
+                  to: "elm.callerid.icon.pad";
+                  relative: 1.0 0.0;
+               }
+               visible: 0;
+            }
+            description { state: "callerid_on" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+            }
+         }
+         part {
+            name: "elm.callerid.bottom.pad";
+            type: SPACER;
+            scale: 1;
+            description { state: "default" 0.0;
+            }
+            description { state: "callerid_on" 0.0;
+               rel1 {
+                  to: "elm.swallow.callerid";
+                  relative: 0.0 1.0;
+               }
+               rel2 {
+                  to_x: "elm.swallow.callerid";
+                  relative: 0.0 1.0;
+               }
+               align: 0.0 0.0;
+               min: 0 0;
+            }
+         }
+         part {
+            name: "elm.bubble.groupchat.pad";
+            type: SPACER;
+            scale: 1;
+            description { state: "default" 0.0;
+               rel1 {
+                  to: "elm.bubble.callerid.pad";
+                  relative: 1.0 0.0;
+               }
+               rel2 {
+                  to: "elm.bubble.callerid.pad";
+                  relative: 1.0 0.0;
+               }
+               align: 0.0 0.0;
+               min: 0 0;
+               fixed: 1 1;
+            }
+            description {
+               state: "groupchat_on";
+               inherit: "default" 0.0;
+               min: 0 ENTRY_BUBBLE_GROUPCHAT_PAD;
+            }
+         }
+         part {
+            name: "elm.groupchat.text.pad";
+            type: SPACER;
+            scale: 1;
+            description { state: "default" 0.0;
+               rel1.to: "elm.bubble.groupchat.pad";
+               rel2 {
+                  to: "elm.bubble.groupchat.pad";
+                  relative: 0.0 1.0;
+               }
+               align: 0.0 0.5;
+               min: ENTRY_BUBBLE_GROUPCHAT_TEXT_PAD 0;
+               fixed: 1 0;
+            }
+         }
+        part {
+            name: "elm.text.groupchat";
+            type: TEXT;
+            scale: 1;
+            description { state: "default" 0.0;
+               align: 0.0 0.0;
+               text {
+                  font: "Tizen:style=Regular";
+                  size: ENTRY_BUBBLE_GROUPCHAT_SIZE_INC;
+                  align: 0.0 0.0;
+                  text_class: "tizen";
+                  min: 1 1;
+               }
+               rel1 {
+                  to: "elm.groupchat.text.pad";
+                  relative: 1.0 0.0;
+               }
+               rel2 {
+                  to: "elm.groupchat.text.pad";
+                  relative: 1.0 0.0;
+               }
+               color: ENTRY_BUBBLE_GROUPCHAT_COLOR_INC;
+               visible: 0;
+            }
+            description { state: "groupchat_on" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+            }
+         }
+
+         part {
+            name: "elm.bubble.status.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1.relative: 1.0 0.0;
+               align: 1.0 0.5;
+               min: ENTRY_BUBBLE_STATUS_PAD 0;
+               fixed: 1 0;
+            }
+         }
+
+        part {
+            name: "elm.bubble.lefttop_gc.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to_x: "elm.bubble.callerid.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+                  relative: 1.0 1.0;
+               }
+               rel2 {
+                  to_x: "elm.bubble.callerid.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+               }
+               align: 0.0 0.0;
+               min: ENTRY_BUBBLE_READ_LEFTTOP_GC_PAD;
+               fixed: 1 1;
+            }
+         }
+         part {
+            name: "elm.bubble.righttop_gc.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+        /*       rel1 {
+                  to_x: "elm.bubble.status.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+                  relative: 0.0 1.0;
+               }
+               rel2 {
+                  to_x: "elm.bubble.status.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+                  relative: 0.0 1.0;
+               }
+               align: 1.0 0.0;*/
+               rel1 {
+               to: "elm.bubble.lefttop_gc.pad";
+               relative: 0.0 0.0;
+               offset: 374 0;
+               }
+               rel2 {
+               to: "elm.bubble.lefttop_gc.pad";
+               relative: 0.0 0.0;
+               offset: 374 0;
+               }
+               align: 0.0 0.0;
+               min: ENTRY_BUBBLE_READ_RIGHTTOP_GC_PAD;
+               fixed: 1 1;
+            }
+         }
+
+         part {
+            name: "elm.bubble.lefttop.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to_x: "elm.bubble.callerid.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+                  relative: 1.0 1.0;
+               }
+               rel2 {
+                  to_x: "elm.bubble.callerid.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+               }
+               align: 0.0 0.0;
+               min: ENTRY_BUBBLE_READ_LEFTTOP_PAD;
+               fixed: 1 1;
+            }
+         }
+         part {
+            name: "elm.bubble.righttop.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+    /*           rel1 {
+                  to_x: "elm.bubble.status.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+                  relative: 0.0 1.0;
+               }
+               rel2 {
+                  to_x: "elm.bubble.status.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+                  relative: 0.0 1.0;
+               }*/
+               rel1 {
+               to: "elm.bubble.lefttop.pad";
+               relative: 0.0 0.0;
+               offset: 374 0;
+               }
+               rel2 {
+               to: "elm.bubble.lefttop.pad";
+               relative: 0.0 0.0;
+               offset: 374 0;
+               }
+               
+               align: 0.0 0.0;
+               min: ENTRY_BUBBLE_READ_RIGHTTOP_PAD;
+               fixed: 1 1;
+            }
+         }
+         part {
+            name: "elm.image.bg.ef";
+            type: IMAGE;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1.to: "elm.bubble.lefttop.pad";
+               rel2.to: "swallow.audio_bg";
+               image {
+                  normal: "telegram_bubble_bg_receive_ef.#.png";
+               }
+               color: 106 126 204 255;
+            }
+            description { state: "pressed" 0.0;
+               inherit: "default" 0.0;
+               color_class: "W042";
+            }
+            description { state: "disabled" 0.0;
+               inherit: "default" 0.0;
+               color_class: "W0551";
+            }
+         }
+         part {
+            name: "elm.image.bg";
+            type: IMAGE;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1.to: "elm.bubble.lefttop.pad";
+               rel2.to: "swallow.audio_bg";
+               image {
+                  normal: "telegram_bubble_bg_receive.#.png";
+               }
+               color: 106 126 204 255;
+            }
+            description { state: "pressed" 0.0;
+               inherit: "default" 0.0;
+               color_class: "W042";
+            }
+            description { state: "disabled" 0.0;
+               inherit: "default" 0.0;
+               color_class: "W0551";
+            }
+         }
+
+part {
+name: "elm.text.gc";
+type:TEXT;
+            mouse_events: 1;
+            scale: 1;
+
+ description {
+            state: "default" 0.0;
+            min: 1 1;
+            align: 0.0 1.0;
+            rel1 {
+                  to: "elm.bubble.lefttop_gc.pad";
+                  relative: 1.0 1.0;
+               }
+               rel2 {
+                  to: "elm.bubble.righttop_gc.pad";
+                  relative: 0.0 1.0;
+               }
+            visible: 1;
+            color_class: "T058";
+            text {
+               font: "Tizen:style=Regular";
+               size: ENTRY_BUBBLE_GROUPCHAT_SIZE_INC;
+               align: 0.0 0.0;
+               text_class: "tizen";
+               min: 1 1;
+            }
+}
+}
+
+        part {
+            name: "elm.text";
+            type: TEXTBLOCK;
+            mouse_events: 1;
+            scale: 1;
+            entry_mode: PLAIN;
+            select_mode: BLOCK_HANDLE;
+            cursor_mode: BEFORE;
+            multiline: 1;
+            description {
+               state: "default" 0.0;
+               align: 0.0 0.0;
+               min: ENTRY_BUBBLE_TEXT_MIN;
+               rel1 {
+                  to: "elm.bubble.lefttop.pad";
+                  relative: 1.0 1.0;
+               }
+               rel2 {
+                  to: "elm.bubble.righttop.pad";
+                  relative: 0.0 1.0;
+               }
+               text {
+                  style: "entry_bubble_receive_textblock_style";
+                  min: 0 1;
+                  max: 1 0;
+                               align: 0.0 0.0;
+               }
+            }
+            description { state: "gc" 0.0;
+               inherit: "default" 0.0;
+               rel1 {
+                  to: "elm.bubble.lefttop_gc.pad";
+                  relative: 1.0 1.0;
+               }
+               rel2 {
+                  to: "elm.bubble.righttop_gc.pad";
+                  relative: 0.0 1.0;
+               }
+            }
+            description { state: "disabled" 0.0;
+               inherit: "default" 0.0;
+               text {
+                  style: "entry_textblock_disabled_style";
+               }
+            }
+         }
+         part
+               {
+                       name: "media_status_icon";
+                       type: SWALLOW;
+                       description
+                       {
+                               state: "default" 0.0;
+                               visible: 1;
+                               align: 0.5 0;
+                               max: MEDIA_WIDTH MEDIA_HEIGHT-MEDIA_DETAILS_LAYOUT_HT;
+                               rel1
+                               {
+                                       to: "elm.text";
+                                       relative: 0.0 0.0;
+                               }
+                               rel2
+                               {
+                                       to: "elm.text";
+                                       relative: 1.0 1.0;
+                                       offset:0 -(MEDIA_DETAILS_LAYOUT_HT);
+                               }
+                       }
+                       description
+                       {
+                               state: "vcontact" 0.0;
+                               inherit: "default" 0.0;
+                               max: VCONTACT_WIDTH VCONTACT_HEIGHT;
+                               rel2
+                               {
+                                       to: "elm.text";
+                                       relative: 1.0 1.0;
+                               }
+                       }
+               }
+         part { name: "event.rect";
+            type: RECT;
+            repeat_events: 1;
+            scale: 1;
+            description { state: "default" 0.0;
+               color: 0 0 0 0;
+               rel1.to: "elm.image.bg";
+               rel2.to: "elm.image.bg";
+            }
+            description { state: "disabled" 0.0;
+               inherit: "default" 0.0;
+               visible: 0;
+            }
+         }
+         part {
+            name: "elm.rect.middle.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to: "elm.text";
+                  relative: 0.0 1.0;
+               }
+               rel2.to: "elm.text";
+               align: 0.5 0.0;
+               min: 0 0;
+            }
+            description {
+               state: "show" 0.0;
+               inherit: "default" 0.0;
+               min: 0 ENTRY_BUBBLE_MIDDLE_PAD;
+            }
+         }
+         part {
+            name: "elm.swallow.end";
+            type: SWALLOW;
+            scale: 1;
+            description { state: "default" 0.0;
+               rel1 {
+                  to: "elm.rect.middle.pad";
+                  relative: 0.0 1.0;
+               }
+               rel2.to: "elm.rect.middle.pad";
+               align: 0.0 0.0;
+            }
+         }
+         part {
+            name: "elm.bubble.rightbottom.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+  /*             rel1 {
+                  to: "elm.swallow.end";
+                  relative: 1.0 1.0;
+               }
+               rel2.to: "elm.swallow.end";*/
+               rel1{
+                to: "elm.text";
+                relative: 1.0 1.0;
+               }
+               rel2.to: "elm.text";
+               align: 0.0 0.0;
+               min: ENTRY_BUBBLE_READ_RIGHTBOTTOM_PAD;
+               fixed: 1 1;
+            }
+         }
+         part {
+            name: "elm.icon.top.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               align: 0.0 0.0;
+               rel1 {
+                  to: "elm.bubble.rightbottom.pad";
+                  relative: 0.0 1.0;
+               }
+               rel2 {
+                  to: "elm.bubble.rightbottom.pad";
+                  relative: 0.0 1.0;
+               }
+               min: 0 0;
+            }
+            description {
+               state: "contents_on" 0.0;
+               inherit: "default" 0.0;
+               min: 0 ENTRY_BUBBLE_ICON_TOP_PAD;
+            }
+         }
+         part {
+            name: "elm.swallow.icon1";
+            type: SWALLOW;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to_x: "elm.text";
+                  to_y: "elm.icon.top.pad";
+                  relative: 0.0 1.0;
+               }
+               rel2 {
+                  to_x: "elm.text";
+                  to_y: "elm.icon.top.pad";
+                  relative: 0.0 1.0;
+               }
+               min: 0 0;
+               align: 0.0 0.0;
+               visible: 0;
+            }
+            description {
+               state: "contents_on" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+            }
+         }
+
+               part {
+                       name: "pad_top";
+                       type: SPACER;
+                       description {
+                       state: "default" 0.0;
+                       min: 10 10;
+                       max: -1 10;
+                               rel1 {
+                               to: "elm.text";
+                                       relative: 0.0 1.0;
+                      }
+                               rel2 {
+                               to: "elm.text";
+                               relative: 1.0 1.0;
+                               }
+                       }
+               }
+
+               part {
+                       name: "pad_bottom";
+                       type: SPACER;
+                       description {
+                       state: "default" 0.0;
+                       min: 10 10;
+                       max: -1 10;
+                               rel1 {
+                               to_x: "elm.text";
+                                       relative: 0.0 1.0;
+                               to_y: "elm.image.bg";
+                               relative: 0.0 1.0;
+                               }
+                               rel2 {
+                               to_x: "elm.text";
+                               relative: 1.0 1.0;
+                               to_y: "elm.image.bg";
+                               relative: 1.0 1.0;
+                               }
+                       align: 0.5 1;
+                       }
+               }
+/*
+               part {
+                       name: "time";
+                       type:TEXT;
+            mouse_events: 1;
+            scale: 1;
+               description {
+               state: "default" 0.0;
+               min: 1 1;
+               align: 1.0 0.5;
+                       rel1 {
+                               to: "pad_top";
+                                       relative: 1.0 1.0;
+                       }
+                       rel2 {
+                       to: "pad_bottom";
+                       relative: 1.0 0.0;
+                       }
+               visible: 1;
+                               //color_class: "T058";
+               color: ENTRY_BUBBLE_TIME_COLOR;
+               text {
+                       min: 1 1;
+                       align: 0.5 0.5;
+                       //text_class: "T058";
+                       size: 10;
+               }
+                       }
+               }
+*/
+         part{
+                       name: "time";
+                       type:TEXT;
+                       mouse_events: 1;
+            scale: 1;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 0.65 0.8; }
+                               rel2 { relative: 0.85 0.95; }
+                               visible: 1;
+                               //color_class: "T058";
+               color: ENTRY_BUBBLE_TIME_COLOR;
+               text {
+                       min: 1 1;
+                       align: 0.5 0.5;
+                       //text_class: "T058";
+                       size: 10;
+               }                               
+                       }                               
+               }
+         part {
+            name: "elm.icon.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to: "elm.swallow.icon1";
+                  relative: 1.0 0.0;
+               }
+               rel2 {
+                  to: "elm.swallow.icon1";
+                  relative: 1.0 1.0;
+               }
+               min: ENTRY_BUBBLE_ICON_PAD 0;
+               align: 0.0 0.5;
+            }
+         }
+         part {
+            name: "elm.swallow.icon2";
+            type: SWALLOW;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to: "elm.icon.pad";
+                  relative: 1.0 0.0;
+               }
+               rel2 {
+                  to: "elm.icon.pad";
+                  relative: 1.0 1.0;
+               }
+               min: 0 0;
+               align: 0.0 0.5;
+               visible: 0;
+            }
+            description {
+               state: "contents_on" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+            }
+         }
+         part {
+            name: "elm.bottom.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               rel1 {
+                  to_y: "elm.swallow.icon1";
+                  relative: 0.0 1.0;
+               }
+               min: 0 0;
+            }
+         }
+         part {
+            name: "elm.status.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to: "elm.bubble.rightbottom.pad";
+                  relative: 1.0 1.0;
+               }
+               rel2.to: "elm.bubble.rightbottom.pad";
+               min: ENTRY_BUBBLE_STATUS_TEXT_ICON_PAD;
+               align: 0.0 1.0;
+               fixed: 1 1;
+            }
+         }
+         part { name: "elm.text.time";
+            type: TEXT;
+            scale: 1;
+            description { state: "default" 0.0;
+               color_class: "T0220";
+               text {
+                  text_class: "T0220";
+                  min: 1 1;
+                  align: 0.0 1.0;
+               }
+               rel1 {
+                  to: "elm.status.pad";
+                  relative: 1.0 0.0;
+               }
+               rel2 {
+                  to: "elm.status.pad";
+                  relative: 1.0 0.0;
+               }
+               align: 0.0 1.0;
+               min: ENTRY_BUBBLE_STATUS_TIME_SIZE;
+               fixed: 1 1;
+            }
+            description { state: "disabled" 0.0;
+               inherit: "default" 0.0;
+               visible: 0;
+            }
+         }
+         part { name: "elm.text.status";
+            type: TEXT;
+            scale: 1;
+            description { state: "default" 0.0;
+               color_class: "T0220";
+               text {
+                  text_class: "T0220";
+                  min: 0 1;
+                  align: 0.0 1.0;
+               }
+               rel1.to: "elm.text.time";
+               rel2 {
+                  to: "elm.text.time";
+                  relative: 1.0 0.0;
+               }
+               align: 0.0 1.0;
+               min: ENTRY_BUBBLE_STATUS_TIME_SIZE;
+               fixed: 1 1;
+            }
+            description { state: "disabled" 0.0;
+               inherit: "default" 0.0;
+               visible: 0;
+            }
+         }
+         part {
+            name: "elm.swallow.status";
+            type: SWALLOW;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to: "elm.status.pad";
+                  relative: 1.0 0.0;
+               }
+               rel2 {
+                  to: "elm.status.pad";
+                  relative: 1.0 0.0;
+               }
+               align: 0.0 1.0;
+               fixed: 1 1;
+               visible: 0;
+            }
+            description { state: "enabled" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+            }
+         }
+      }
+      programs {
+         program { name: "focus";
+            signal: "load";
+            source: "";
+            action: FOCUS_SET;
+            target: "elm.text";
+         }
+          program { name: "disable";
+            signal: "elm,state,disabled";
+            source: "elm";
+            action: STATE_SET "disabled" 0.0;
+            target: "elm.text";
+            target: "event.rect";
+         }
+         program { name: "enable";
+            signal: "elm,state,enabled";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.text";
+            target: "event.rect";
+         }
+         program { name: "mouse_down";
+            signal: "mouse,down,*";
+            source: "event.rect";
+            action:  STATE_SET "pressed" 0.0;
+            target: "elm.image.bg";
+         }
+         program { name: "mouse_up";
+            signal: "mouse,up,*";
+            source: "event.rect";
+            action:  STATE_SET "default" 0.0;
+            target: "elm.image.bg";
+         }
+         program { name: "go_callerid_on";
+            signal: "elm,state,callerid,enabled";
+            source: "elm";
+            action: STATE_SET "callerid_on" 0.0;
+            target: "elm.bubble.callerid.pad";
+            target: "elm.swallow.callerid";
+            target: "elm.callerid.bottom.pad";
+         }
+         program { name: "go_callerid_off";
+            signal: "elm,state,callerid,disabled";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.bubble.callerid.pad";
+            target: "elm.swallow.callerid";
+            target: "elm.callerid.bottom.pad";
+         }
+         program { name: "go_groupchat_on";
+            signal: "elm,state,groupchat,enabled";
+            source: "elm";
+            action: STATE_SET "gc" 0.0;
+            target: "elm.text";
+         }
+         program { name: "go_groupchat_off";
+            signal: "elm,state,groupchat,disabled";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.text";
+         }
+         program { name: "go_textstatus_on";
+            signal: "elm,state,text,status,enabled";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.text.time";
+            target: "elm.text.status";
+            after: "go_contentstatus_off";
+         }
+         program { name: "go_textstatus_off";
+            signal: "elm,state,text,status,disabled";
+            source: "elm";
+            action: STATE_SET "disabled" 0.0;
+            target: "elm.text.time";
+            target: "elm.text.status";
+         }
+         program { name: "go_contentstatus_on";
+            signal: "elm,state,content,status,enabled";
+            source: "elm";
+            action: STATE_SET "enabled" 0.0;
+            target: "elm.swallow.status";
+            after: "go_textstatus_off";
+         }
+         program { name: "go_contentstatus_off";
+            signal: "elm,state,content,status,disabled";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.swallow.status";
+         }
+         program { name: "show_middle_pad";
+            signal: "elm,state,middle,pad,enabled";
+            source: "elm";
+            action: STATE_SET "show" 0.0;
+            target: "elm.rect.middle.pad";
+         }
+         program { name: "hide_middle_pad";
+            signal: "elm,state,middle,pad,disabled";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.rect.middle.pad";
+         }
+         program { name: "go_contents_on";
+            signal: "elm,state,contents,enabled";
+            source: "elm";
+            action: STATE_SET "contents_on" 0.0;
+            target: "elm.icon.top.pad";
+            target: "elm.swallow.icon1";
+            target: "elm.swallow.icon2";
+         }
+         program { name: "go_contents_off";
+            signal: "elm,state,contents,disabled";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.icon.top.pad";
+            target: "elm.swallow.icon1";
+            target: "elm.swallow.icon2";
+         }
+         program { name: "media_status_vcontact";
+            signal: "elm,state,set,vcontact,status";
+            source: "elm";
+            action: STATE_SET "vcontact" 0.0;
+            target: "media_status_icon";
+         }
+      }
+   }
+
+/******************* sandeep ***************/
+
+/***************** land *******************/
+
+group { name: "elm/entry/base-noedit/readmessage_audio_land";
+      parts {
+         part{
+                       name: "swallow.audio_bg";
+                       type: RECT;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 0.0 0.0; }
+                               rel2 { relative: 0.5 1.0; }
+                               color: 0 0 0 0;                                 
+                       }                               
+               }
+         part {
+            name: "elm.bubble.callerid.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel2.relative: 0.0 0.0;
+               align: 0.0 0.0;
+               min: 0 0;
+               fixed: 1 1;
+            }
+            description {
+               state: "callerid_on" 0.0;
+               inherit: "default" 0.0;
+               min: ENTRY_BUBBLE_CALLERID_PAD 0;
+            }
+         }
+         part {
+            name: "elm.callerid.icon.pad";
+            type: SPACER;
+            scale: 1;
+            description { state: "default" 0.0;
+            rel2.relative: 0.0 0.0;
+               align: 0.0 0.0;
+               min: ENTRY_BUBBLE_CALLERID_ICON_PAD 0;
+               fixed: 1 1;
+            }
+         }
+         part {
+            name: "elm.swallow.callerid";
+            type: SWALLOW;
+            scale: 1;
+            description { state: "default" 0.0;
+               min: ENTRY_BUBBLE_CALLERID_WIDTH ENTRY_BUBBLE_CALLERID_HEIGHT;
+               max: ENTRY_BUBBLE_CALLERID_WIDTH ENTRY_BUBBLE_CALLERID_HEIGHT;
+               fixed: 1 1;
+               align: 0.0 0.0;
+               rel1 {
+                  to: "elm.callerid.icon.pad";
+                  relative: 1.0 0.0;
+               }
+               rel2 {
+                  to: "elm.callerid.icon.pad";
+                  relative: 1.0 0.0;
+               }
+               visible: 0;
+            }
+            description { state: "callerid_on" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+            }
+         }
+         part {
+            name: "elm.callerid.bottom.pad";
+            type: SPACER;
+            scale: 1;
+            description { state: "default" 0.0;
+            }
+            description { state: "callerid_on" 0.0;
+               rel1 {
+                  to: "elm.swallow.callerid";
+                  relative: 0.0 1.0;
+               }
+               rel2 {
+                  to_x: "elm.swallow.callerid";
+                  relative: 0.0 1.0;
+               }
+               align: 0.0 0.0;
+               min: 0 0;
+            }
+         }
+         part {
+            name: "elm.bubble.groupchat.pad";
+            type: SPACER;
+            scale: 1;
+            description { state: "default" 0.0;
+               rel1 {
+                  to: "elm.bubble.callerid.pad";
+                  relative: 1.0 0.0;
+               }
+               rel2 {
+                  to: "elm.bubble.callerid.pad";
+                  relative: 1.0 0.0;
+               }
+               align: 0.0 0.0;
+               min: 0 0;
+               fixed: 1 1;
+            }
+            description {
+               state: "groupchat_on";
+               inherit: "default" 0.0;
+               min: 0 ENTRY_BUBBLE_GROUPCHAT_PAD;
+            }
+         }
+         part {
+            name: "elm.groupchat.text.pad";
+            type: SPACER;
+            scale: 1;
+            description { state: "default" 0.0;
+               rel1.to: "elm.bubble.groupchat.pad";
+               rel2 {
+                  to: "elm.bubble.groupchat.pad";
+                  relative: 0.0 1.0;
+               }
+               align: 0.0 0.5;
+               min: ENTRY_BUBBLE_GROUPCHAT_TEXT_PAD 0;
+               fixed: 1 0;
+            }
+         }
+        part {
+            name: "elm.text.groupchat";
+            type: TEXT;
+            scale: 1;
+            description { state: "default" 0.0;
+               align: 0.0 0.0;
+               text {
+                  font: "Tizen:style=Regular";
+                  size: ENTRY_BUBBLE_GROUPCHAT_SIZE_INC;
+                  align: 0.0 0.0;
+                  text_class: "tizen";
+                  min: 1 1;
+               }
+               rel1 {
+                  to: "elm.groupchat.text.pad";
+                  relative: 1.0 0.0;
+               }
+               rel2 {
+                  to: "elm.groupchat.text.pad";
+                  relative: 1.0 0.0;
+               }
+               color: ENTRY_BUBBLE_GROUPCHAT_COLOR_INC;
+               visible: 0;
+            }
+            description { state: "groupchat_on" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+            }
+         }
+
+         part {
+            name: "elm.bubble.status.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1.relative: 1.0 0.0;
+               align: 1.0 0.5;
+               min: ENTRY_BUBBLE_STATUS_PAD 0;
+               fixed: 1 0;
+            }
+         }
+
+        part {
+            name: "elm.bubble.lefttop_gc.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to_x: "elm.bubble.callerid.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+                  relative: 1.0 1.0;
+               }
+               rel2 {
+                  to_x: "elm.bubble.callerid.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+               }
+               align: 0.0 0.0;
+               min: ENTRY_BUBBLE_READ_LEFTTOP_GC_PAD;
+               fixed: 1 1;
+            }
+         }
+         part {
+            name: "elm.bubble.righttop_gc.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+        /*       rel1 {
+                  to_x: "elm.bubble.status.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+                  relative: 0.0 1.0;
+               }
+               rel2 {
+                  to_x: "elm.bubble.status.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+                  relative: 0.0 1.0;
+               }
+               align: 1.0 0.0;*/
+               rel1 {
+               to: "elm.bubble.lefttop_gc.pad";
+               relative: 0.0 0.0;
+               offset: 374 0;
+               }
+               rel2 {
+               to: "elm.bubble.lefttop_gc.pad";
+               relative: 0.0 0.0;
+               offset: 374 0;
+               }
+               align: 0.0 0.0;
+               min: ENTRY_BUBBLE_READ_RIGHTTOP_GC_PAD;
+               fixed: 1 1;
+            }
+         }
+
+         part {
+            name: "elm.bubble.lefttop.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to_x: "elm.bubble.callerid.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+                  relative: 1.0 1.0;
+               }
+               rel2 {
+                  to_x: "elm.bubble.callerid.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+               }
+               align: 0.0 0.0;
+               min: ENTRY_BUBBLE_READ_LEFTTOP_PAD;
+               fixed: 1 1;
+            }
+         }
+         part {
+            name: "elm.bubble.righttop.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+    /*           rel1 {
+                  to_x: "elm.bubble.status.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+                  relative: 0.0 1.0;
+               }
+               rel2 {
+                  to_x: "elm.bubble.status.pad";
+                  to_y: "elm.bubble.groupchat.pad";
+                  relative: 0.0 1.0;
+               }*/
+               rel1 {
+               to: "elm.bubble.lefttop.pad";
+               relative: 0.0 0.0;
+               offset: 374 0;
+               }
+               rel2 {
+               to: "elm.bubble.lefttop.pad";
+               relative: 0.0 0.0;
+               offset: 374 0;
+               }
+               
+               align: 0.0 0.0;
+               min: ENTRY_BUBBLE_READ_RIGHTTOP_PAD;
+               fixed: 1 1;
+            }
+         }
+         part {
+            name: "elm.image.bg.ef";
+            type: IMAGE;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1.to: "elm.bubble.lefttop.pad";
+               rel2.to: "swallow.audio_bg";
+               image {
+                  normal: "telegram_bubble_bg_receive_ef.#.png";
+               }
+               color: 106 126 204 255;
+            }
+            description { state: "pressed" 0.0;
+               inherit: "default" 0.0;
+               color_class: "W042";
+            }
+            description { state: "disabled" 0.0;
+               inherit: "default" 0.0;
+               color_class: "W0551";
+            }
+         }
+         part {
+            name: "elm.image.bg";
+            type: IMAGE;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1.to: "elm.bubble.lefttop.pad";
+               rel2.to: "swallow.audio_bg";
+               image {
+                  normal: "telegram_bubble_bg_receive.#.png";
+               }
+               color: 106 126 204 255;
+            }
+            description { state: "pressed" 0.0;
+               inherit: "default" 0.0;
+               color_class: "W042";
+            }
+            description { state: "disabled" 0.0;
+               inherit: "default" 0.0;
+               color_class: "W0551";
+            }
+         }
+
+part {
+name: "elm.text.gc";
+type:TEXT;
+            mouse_events: 1;
+            scale: 1;
+
+ description {
+            state: "default" 0.0;
+            min: 1 1;
+            align: 0.0 1.0;
+            rel1 {
+                  to: "elm.bubble.lefttop_gc.pad";
+                  relative: 1.0 1.0;
+               }
+               rel2 {
+                  to: "elm.bubble.righttop_gc.pad";
+                  relative: 0.0 1.0;
+               }
+            visible: 1;
+            color_class: "T058";
+            text {
+               font: "Tizen:style=Regular";
+               size: ENTRY_BUBBLE_GROUPCHAT_SIZE_INC;
+               align: 0.0 0.0;
+               text_class: "tizen";
+               min: 1 1;
+            }
+}
+}
+
+        part {
+            name: "elm.text";
+            type: TEXTBLOCK;
+            mouse_events: 1;
+            scale: 1;
+            entry_mode: PLAIN;
+            select_mode: BLOCK_HANDLE;
+            cursor_mode: BEFORE;
+            multiline: 1;
+            description {
+               state: "default" 0.0;
+               align: 0.0 0.0;
+               min: ENTRY_BUBBLE_TEXT_MIN;
+               rel1 {
+                  to: "elm.bubble.lefttop.pad";
+                  relative: 1.0 1.0;
+               }
+               rel2 {
+                  to: "elm.bubble.righttop.pad";
+                  relative: 0.0 1.0;
+               }
+               text {
+                  style: "entry_bubble_receive_textblock_style";
+                  min: 0 1;
+                  max: 1 0;
+                               align: 0.0 0.0;
+               }
+            }
+            description { state: "gc" 0.0;
+               inherit: "default" 0.0;
+               rel1 {
+                  to: "elm.bubble.lefttop_gc.pad";
+                  relative: 1.0 1.0;
+               }
+               rel2 {
+                  to: "elm.bubble.righttop_gc.pad";
+                  relative: 0.0 1.0;
+               }
+            }
+            description { state: "disabled" 0.0;
+               inherit: "default" 0.0;
+               text {
+                  style: "entry_textblock_disabled_style";
+               }
+            }
+         }
+         part
+               {
+                       name: "media_status_icon";
+                       type: SWALLOW;
+                       description
+                       {
+                               state: "default" 0.0;
+                               visible: 1;
+                               align: 0.5 0;
+                               max: MEDIA_WIDTH MEDIA_HEIGHT-MEDIA_DETAILS_LAYOUT_HT;
+                               rel1
+                               {
+                                       to: "elm.text";
+                                       relative: 0.0 0.0;
+                               }
+                               rel2
+                               {
+                                       to: "elm.text";
+                                       relative: 1.0 1.0;
+                                       offset:0 -(MEDIA_DETAILS_LAYOUT_HT);
+                               }
+                       }
+                       description
+                       {
+                               state: "vcontact" 0.0;
+                               inherit: "default" 0.0;
+                               max: VCONTACT_WIDTH VCONTACT_HEIGHT;
+                               rel2
+                               {
+                                       to: "elm.text";
+                                       relative: 1.0 1.0;
+                               }
+                       }
+               }
+         part { name: "event.rect";
+            type: RECT;
+            repeat_events: 1;
+            scale: 1;
+            description { state: "default" 0.0;
+               color: 0 0 0 0;
+               rel1.to: "elm.image.bg";
+               rel2.to: "elm.image.bg";
+            }
+            description { state: "disabled" 0.0;
+               inherit: "default" 0.0;
+               visible: 0;
+            }
+         }
+         part {
+            name: "elm.rect.middle.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to: "elm.text";
+                  relative: 0.0 1.0;
+               }
+               rel2.to: "elm.text";
+               align: 0.5 0.0;
+               min: 0 0;
+            }
+            description {
+               state: "show" 0.0;
+               inherit: "default" 0.0;
+               min: 0 ENTRY_BUBBLE_MIDDLE_PAD;
+            }
+         }
+         part {
+            name: "elm.swallow.end";
+            type: SWALLOW;
+            scale: 1;
+            description { state: "default" 0.0;
+               rel1 {
+                  to: "elm.rect.middle.pad";
+                  relative: 0.0 1.0;
+               }
+               rel2.to: "elm.rect.middle.pad";
+               align: 0.0 0.0;
+            }
+         }
+         part {
+            name: "elm.bubble.rightbottom.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+  /*             rel1 {
+                  to: "elm.swallow.end";
+                  relative: 1.0 1.0;
+               }
+               rel2.to: "elm.swallow.end";*/
+               rel1{
+                to: "elm.text";
+                relative: 1.0 1.0;
+               }
+               rel2.to: "elm.text";
+               align: 0.0 0.0;
+               min: ENTRY_BUBBLE_READ_RIGHTBOTTOM_PAD;
+               fixed: 1 1;
+            }
+         }
+         part {
+            name: "elm.icon.top.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               align: 0.0 0.0;
+               rel1 {
+                  to: "elm.bubble.rightbottom.pad";
+                  relative: 0.0 1.0;
+               }
+               rel2 {
+                  to: "elm.bubble.rightbottom.pad";
+                  relative: 0.0 1.0;
+               }
+               min: 0 0;
+            }
+            description {
+               state: "contents_on" 0.0;
+               inherit: "default" 0.0;
+               min: 0 ENTRY_BUBBLE_ICON_TOP_PAD;
+            }
+         }
+         part {
+            name: "elm.swallow.icon1";
+            type: SWALLOW;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to_x: "elm.text";
+                  to_y: "elm.icon.top.pad";
+                  relative: 0.0 1.0;
+               }
+               rel2 {
+                  to_x: "elm.text";
+                  to_y: "elm.icon.top.pad";
+                  relative: 0.0 1.0;
+               }
+               min: 0 0;
+               align: 0.0 0.0;
+               visible: 0;
+            }
+            description {
+               state: "contents_on" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+            }
+         }
+
+               part {
+                       name: "pad_top";
+                       type: SPACER;
+                       description {
+                       state: "default" 0.0;
+                       min: 10 10;
+                       max: -1 10;
+                               rel1 {
+                               to: "elm.text";
+                                       relative: 0.0 1.0;
+                      }
+                               rel2 {
+                               to: "elm.text";
+                               relative: 1.0 1.0;
+                               }
+                       }
+               }
+
+               part {
+                       name: "pad_bottom";
+                       type: SPACER;
+                       description {
+                       state: "default" 0.0;
+                       min: 10 10;
+                       max: -1 10;
+                               rel1 {
+                               to_x: "elm.text";
+                                       relative: 0.0 1.0;
+                               to_y: "elm.image.bg";
+                               relative: 0.0 1.0;
+                               }
+                               rel2 {
+                               to_x: "elm.text";
+                               relative: 1.0 1.0;
+                               to_y: "elm.image.bg";
+                               relative: 1.0 1.0;
+                               }
+                       align: 0.5 1;
+                       }
+               }
+/*
+               part {
+                       name: "time";
+                       type:TEXT;
+            mouse_events: 1;
+            scale: 1;
+               description {
+               state: "default" 0.0;
+               min: 1 1;
+               align: 1.0 0.5;
+                       rel1 {
+                               to: "pad_top";
+                                       relative: 1.0 1.0;
+                       }
+                       rel2 {
+                       to: "pad_bottom";
+                       relative: 1.0 0.0;
+                       }
+               visible: 1;
+                               //color_class: "T058";
+               color: ENTRY_BUBBLE_TIME_COLOR;
+               text {
+                       min: 1 1;
+                       align: 0.5 0.5;
+                       //text_class: "T058";
+                       size: 10;
+               }
+                       }
+               }
+*/
+         part{
+                       name: "time";
+                       type:TEXT;
+                       mouse_events: 1;
+            scale: 1;
+                       description{
+                               state: "default" 0.0;
+                               rel1 { relative: 0.3 0.8; }
+                               rel2 { relative: 0.5 0.95; }
+                               visible: 1;
+                               //color_class: "T058";
+               color: ENTRY_BUBBLE_TIME_COLOR;
+               text {
+                       min: 1 1;
+                       align: 0.5 0.5;
+                       //text_class: "T058";
+                       size: 10;
+               }                               
+                       }                               
+               }
+         part {
+            name: "elm.icon.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to: "elm.swallow.icon1";
+                  relative: 1.0 0.0;
+               }
+               rel2 {
+                  to: "elm.swallow.icon1";
+                  relative: 1.0 1.0;
+               }
+               min: ENTRY_BUBBLE_ICON_PAD 0;
+               align: 0.0 0.5;
+            }
+         }
+         part {
+            name: "elm.swallow.icon2";
+            type: SWALLOW;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to: "elm.icon.pad";
+                  relative: 1.0 0.0;
+               }
+               rel2 {
+                  to: "elm.icon.pad";
+                  relative: 1.0 1.0;
+               }
+               min: 0 0;
+               align: 0.0 0.5;
+               visible: 0;
+            }
+            description {
+               state: "contents_on" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+            }
+         }
+         part {
+            name: "elm.bottom.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               rel1 {
+                  to_y: "elm.swallow.icon1";
+                  relative: 0.0 1.0;
+               }
+               min: 0 0;
+            }
+         }
+         part {
+            name: "elm.status.pad";
+            type: SPACER;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to: "elm.bubble.rightbottom.pad";
+                  relative: 1.0 1.0;
+               }
+               rel2.to: "elm.bubble.rightbottom.pad";
+               min: ENTRY_BUBBLE_STATUS_TEXT_ICON_PAD;
+               align: 0.0 1.0;
+               fixed: 1 1;
+            }
+         }
+         part { name: "elm.text.time";
+            type: TEXT;
+            scale: 1;
+            description { state: "default" 0.0;
+               color_class: "T0220";
+               text {
+                  text_class: "T0220";
+                  min: 1 1;
+                  align: 0.0 1.0;
+               }
+               rel1 {
+                  to: "elm.status.pad";
+                  relative: 1.0 0.0;
+               }
+               rel2 {
+                  to: "elm.status.pad";
+                  relative: 1.0 0.0;
+               }
+               align: 0.0 1.0;
+               min: ENTRY_BUBBLE_STATUS_TIME_SIZE;
+               fixed: 1 1;
+            }
+            description { state: "disabled" 0.0;
+               inherit: "default" 0.0;
+               visible: 0;
+            }
+         }
+         part { name: "elm.text.status";
+            type: TEXT;
+            scale: 1;
+            description { state: "default" 0.0;
+               color_class: "T0220";
+               text {
+                  text_class: "T0220";
+                  min: 0 1;
+                  align: 0.0 1.0;
+               }
+               rel1.to: "elm.text.time";
+               rel2 {
+                  to: "elm.text.time";
+                  relative: 1.0 0.0;
+               }
+               align: 0.0 1.0;
+               min: ENTRY_BUBBLE_STATUS_TIME_SIZE;
+               fixed: 1 1;
+            }
+            description { state: "disabled" 0.0;
+               inherit: "default" 0.0;
+               visible: 0;
+            }
+         }
+         part {
+            name: "elm.swallow.status";
+            type: SWALLOW;
+            scale: 1;
+            description {
+               state: "default" 0.0;
+               rel1 {
+                  to: "elm.status.pad";
+                  relative: 1.0 0.0;
+               }
+               rel2 {
+                  to: "elm.status.pad";
+                  relative: 1.0 0.0;
+               }
+               align: 0.0 1.0;
+               fixed: 1 1;
+               visible: 0;
+            }
+            description { state: "enabled" 0.0;
+               inherit: "default" 0.0;
+               visible: 1;
+            }
+         }
+      }
+      programs {
+         program { name: "focus";
+            signal: "load";
+            source: "";
+            action: FOCUS_SET;
+            target: "elm.text";
+         }
+          program { name: "disable";
+            signal: "elm,state,disabled";
+            source: "elm";
+            action: STATE_SET "disabled" 0.0;
+            target: "elm.text";
+            target: "event.rect";
+         }
+         program { name: "enable";
+            signal: "elm,state,enabled";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.text";
+            target: "event.rect";
+         }
+         program { name: "mouse_down";
+            signal: "mouse,down,*";
+            source: "event.rect";
+            action:  STATE_SET "pressed" 0.0;
+            target: "elm.image.bg";
+         }
+         program { name: "mouse_up";
+            signal: "mouse,up,*";
+            source: "event.rect";
+            action:  STATE_SET "default" 0.0;
+            target: "elm.image.bg";
+         }
+         program { name: "go_callerid_on";
+            signal: "elm,state,callerid,enabled";
+            source: "elm";
+            action: STATE_SET "callerid_on" 0.0;
+            target: "elm.bubble.callerid.pad";
+            target: "elm.swallow.callerid";
+            target: "elm.callerid.bottom.pad";
+         }
+         program { name: "go_callerid_off";
+            signal: "elm,state,callerid,disabled";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.bubble.callerid.pad";
+            target: "elm.swallow.callerid";
+            target: "elm.callerid.bottom.pad";
+         }
+         program { name: "go_groupchat_on";
+            signal: "elm,state,groupchat,enabled";
+            source: "elm";
+            action: STATE_SET "gc" 0.0;
+            target: "elm.text";
+         }
+         program { name: "go_groupchat_off";
+            signal: "elm,state,groupchat,disabled";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.text";
+         }
+         program { name: "go_textstatus_on";
+            signal: "elm,state,text,status,enabled";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.text.time";
+            target: "elm.text.status";
+            after: "go_contentstatus_off";
+         }
+         program { name: "go_textstatus_off";
+            signal: "elm,state,text,status,disabled";
+            source: "elm";
+            action: STATE_SET "disabled" 0.0;
+            target: "elm.text.time";
+            target: "elm.text.status";
+         }
+         program { name: "go_contentstatus_on";
+            signal: "elm,state,content,status,enabled";
+            source: "elm";
+            action: STATE_SET "enabled" 0.0;
+            target: "elm.swallow.status";
+            after: "go_textstatus_off";
+         }
+         program { name: "go_contentstatus_off";
+            signal: "elm,state,content,status,disabled";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.swallow.status";
+         }
+         program { name: "show_middle_pad";
+            signal: "elm,state,middle,pad,enabled";
+            source: "elm";
+            action: STATE_SET "show" 0.0;
+            target: "elm.rect.middle.pad";
+         }
+         program { name: "hide_middle_pad";
+            signal: "elm,state,middle,pad,disabled";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.rect.middle.pad";
+         }
+         program { name: "go_contents_on";
+            signal: "elm,state,contents,enabled";
+            source: "elm";
+            action: STATE_SET "contents_on" 0.0;
+            target: "elm.icon.top.pad";
+            target: "elm.swallow.icon1";
+            target: "elm.swallow.icon2";
+         }
+         program { name: "go_contents_off";
+            signal: "elm,state,contents,disabled";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.icon.top.pad";
+            target: "elm.swallow.icon1";
+            target: "elm.swallow.icon2";
+         }
+         program { name: "media_status_vcontact";
+            signal: "elm,state,set,vcontact,status";
+            source: "elm";
+            action: STATE_SET "vcontact" 0.0;
+            target: "media_status_icon";
+         }
+      }
+   }
+
+/**************land ********************/
+
+
+
 group { name: "elm/entry/base-noedit/readmessage1";
       parts {
          part {
diff --git a/TelegramTizen/res/images/telegram_audio_player_pause_dim.png b/TelegramTizen/res/images/telegram_audio_player_pause_dim.png
new file mode 100644 (file)
index 0000000..e5b3c4b
Binary files /dev/null and b/TelegramTizen/res/images/telegram_audio_player_pause_dim.png differ
diff --git a/TelegramTizen/res/images/telegram_audio_player_pause_normal.png b/TelegramTizen/res/images/telegram_audio_player_pause_normal.png
new file mode 100644 (file)
index 0000000..37304c1
Binary files /dev/null and b/TelegramTizen/res/images/telegram_audio_player_pause_normal.png differ
diff --git a/TelegramTizen/res/images/telegram_audio_player_pause_press.png b/TelegramTizen/res/images/telegram_audio_player_pause_press.png
new file mode 100644 (file)
index 0000000..d77f0d2
Binary files /dev/null and b/TelegramTizen/res/images/telegram_audio_player_pause_press.png differ
diff --git a/TelegramTizen/res/images/telegram_audio_player_play_dim.png b/TelegramTizen/res/images/telegram_audio_player_play_dim.png
new file mode 100644 (file)
index 0000000..85533f3
Binary files /dev/null and b/TelegramTizen/res/images/telegram_audio_player_play_dim.png differ
diff --git a/TelegramTizen/res/images/telegram_audio_player_play_normal.png b/TelegramTizen/res/images/telegram_audio_player_play_normal.png
new file mode 100644 (file)
index 0000000..7f42d8e
Binary files /dev/null and b/TelegramTizen/res/images/telegram_audio_player_play_normal.png differ
diff --git a/TelegramTizen/res/images/telegram_audio_player_play_press.png b/TelegramTizen/res/images/telegram_audio_player_play_press.png
new file mode 100644 (file)
index 0000000..44df1b7
Binary files /dev/null and b/TelegramTizen/res/images/telegram_audio_player_play_press.png differ
diff --git a/TelegramTizen/res/images/telegram_icon_expand_close.png b/TelegramTizen/res/images/telegram_icon_expand_close.png
new file mode 100644 (file)
index 0000000..a4e9bd1
Binary files /dev/null and b/TelegramTizen/res/images/telegram_icon_expand_close.png differ
diff --git a/TelegramTizen/res/images/telegram_icon_expand_open.png b/TelegramTizen/res/images/telegram_icon_expand_open.png
new file mode 100644 (file)
index 0000000..f3727a0
Binary files /dev/null and b/TelegramTizen/res/images/telegram_icon_expand_open.png differ
index 57cd17f..a2d5c8c 100644 (file)
 #include "ucol.h"
 #include <notification.h>
 #include <badge.h>
-static void
-popup_block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+
+static void popup_block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
 {
        evas_object_del(obj);
 }
 
-static void
-popup_timeout_cb(void *data, Evas_Object *obj, void *event_info)
+static void popup_timeout_cb(void *data, Evas_Object *obj, void *event_info)
 {
        evas_object_del(obj);
 }
@@ -387,11 +386,18 @@ void load_main_list_data(appdata_s *ad)
                                                        } else if(media_type == tgl_message_media_photo) {
                                                                item->last_message = strdup("Image");
                                                        } else if(media_type == tgl_message_media_document) {
-                                                               if (msg->message && strlen(msg->message) > 0) {
+                                                               tgl_media_s *media_msg = NULL;
+                                                               media_msg = get_media_details_from_db(atoll(msg->media_id));
+
+/*                                                             if (msg->message && strlen(msg->message) > 0) {
                                                                        item->last_message = strdup(msg->message);
                                                                } else {
                                                                        item->last_message = strdup("Document");
-                                                               }
+                                                               }*/
+
+                                                               item->last_message = strdup(media_msg->doc_type);
+
+                                                               free_media_details(media_msg);
                                                        } else if(media_type == tgl_message_media_geo) {
                                                                item->last_message = strdup("Geo location");
                                                        } else if(media_type == tgl_message_media_contact) {
@@ -2002,7 +2008,10 @@ static int _on_service_client_msg_received_cb(void *data, bundle *const rec_msg)
                        }
 
                        if (app->current_app_state == TG_SETTINGS_SCREEN_STATE) {
-
+                               Evas_Object* set_pro_pic = evas_object_data_get(app->nf, "settings_user_profile_pic");
+                               if (set_pro_pic) {
+                                       elm_image_file_set(profile_pic, file_path, NULL);
+                               }
                        }
                }
        } else if (strcmp(rec_key_val, "self_username_updated") == 0) {
@@ -2983,7 +2992,7 @@ static bool app_create(void *data)
        ad->s_notififcation = NULL;
        ad->panel = NULL;
        ad->is_server_ready = EINA_FALSE;
-       ad->msg_count = 0;
+       //ad->msg_count = 0;
        create_base_gui(ad);
        int err = badge_new(TELEGRAM_APP_ID);
        if (BADGE_ERROR_NONE != err) {
diff --git a/TelegramTizen/src/tg_audio_player.c b/TelegramTizen/src/tg_audio_player.c
new file mode 100644 (file)
index 0000000..158e4d4
--- /dev/null
@@ -0,0 +1,185 @@
+/*
+ * tg_audio_player.c
+ *
+ *  Created on: Oct 22, 2015
+ *      Author: sandeep
+ */
+
+
+#include "tg_audio_player.h"
+
+static void _player_interrupted_cb(player_interrupted_code_e code, void *data)
+{
+       tg_player_handler *player = data;
+
+       if (!player)
+               return;
+
+       player_state_e state;
+       player_get_state(player->handler, &state);
+       player->state = TG_AUDIO_PLAYER_STATE_INTERRUPTED;
+       player->state_callback(player, player->state, player->user_data);
+       return;
+}
+
+static void _player_completed_cb(void *data)
+{
+       tg_player_handler *player = data;
+
+       if (!player)
+               return;
+
+       player->state = TG_AUDIO_PLAYER_STATE_END;
+       player->state_callback(player, player->state, player->user_data);
+       return;
+}
+
+static void _player_error_cb(int error_code, void *user_data)
+{
+       tg_player_handler *player = user_data;
+
+       if (!player)
+               return;
+
+       player->state = TG_AUDIO_PLAYER_STATE_ERROR;
+       player->state_callback(player, player->state, player->user_data);
+       return;
+}
+
+tg_player_handler* init_audio_player(const char *audio_file, tg_player_state_changed state_change, tg_player_progress_updated progress_update, void *user_data)
+{
+       if (!audio_file)
+               return NULL;
+       tg_player_handler *player = NULL;
+       if (access(audio_file, F_OK) != -1) {
+               tg_player_handler *player = (tg_player_handler*)malloc(sizeof(tg_player_handler));
+               if (player) {
+                       player->timer = NULL;
+                       player->current_pos = 0;
+                       player->state = TG_AUDIO_PLAYER_STATE_NONE;
+                       player->progress_callback = progress_update;
+                       player->state_callback = state_change;
+                       player->user_data = user_data;
+
+                       int error_code = 0;
+                       error_code = player_create(&player->handler);
+                       if (error_code == PLAYER_ERROR_NONE) {
+                               player_set_sound_type(player->handler, SOUND_TYPE_MEDIA);
+                               player_set_volume(player->handler, 1.0, 1.0);
+                               player_set_looping(player->handler, false);
+                       }
+                       error_code = player_set_interrupted_cb(player->handler, _player_interrupted_cb, player);
+                       if (error_code != PLAYER_ERROR_NONE) {
+                               free(player);
+                               return NULL;
+                       }
+                       error_code = player_set_completed_cb(player->handler, _player_completed_cb, player);
+                       if (error_code != PLAYER_ERROR_NONE) {
+                               free(player);
+                               return NULL;
+                       }
+                       error_code = player_set_error_cb(player->handler, _player_error_cb, NULL);
+                       if (error_code != PLAYER_ERROR_NONE) {
+                               free(player);
+                               return NULL;
+                       }
+                       error_code = player_set_uri(player->handler, audio_file);
+                       if (error_code != PLAYER_ERROR_NONE) {
+                               free(player);
+                               return NULL;
+                       }
+                       error_code = player_prepare(player->handler);
+                       if (error_code == PLAYER_ERROR_NONE) {
+                               usleep(1000);
+                               player->state = TG_AUDIO_PLAYER_STATE_INITIALIZED;
+                               player->state_callback(player, player->state, user_data);
+                       } else {
+                               //failed to create player, free all items.
+                               free(player);
+                               return NULL;
+                       }
+
+               }
+       }
+       return player;
+}
+
+
+static Eina_Bool audio_progress_updated(void *data)
+{
+       tg_player_handler *player = data;
+
+       if (!player) {
+               return ECORE_CALLBACK_CANCEL;
+       }
+
+       int total_duration = 0;
+       player_get_duration(player->handler, &total_duration);
+
+       int cur_pos = 0;
+       player_get_play_position(player->handler, &cur_pos);
+
+       player->progress_callback(player, cur_pos, total_duration, player->user_data);
+
+       return ECORE_CALLBACK_RENEW;
+}
+void play_audio_player(tg_player_handler *player)
+{
+       if (!player)
+               return;
+       int error_code = 0;
+       if (player->state == TG_AUDIO_PLAYER_STATE_INITIALIZED || player->state == TG_AUDIO_PLAYER_STATE_INTERRUPTED || player->state == TG_AUDIO_PLAYER_STATE_PAUSE) {
+               error_code = player_start(player->handler);
+               if (error_code == PLAYER_ERROR_NONE) {
+                       player->state = TG_AUDIO_PLAYER_STATE_PLAYING;
+
+                       if (player->timer) {
+                               ecore_timer_del(player->timer);
+                               player->timer = NULL;
+                       }
+                       player->timer = ecore_timer_add(0.001, audio_progress_updated, player);
+                       player->state_callback(player, player->state, player->user_data);
+               }
+       }
+}
+
+void pause_audio_player(tg_player_handler *player)
+{
+       if (!player)
+               return;
+       int error_code = 0;
+       if (player->state == TG_AUDIO_PLAYER_STATE_PLAYING) {
+               error_code = player_pause(player->handler);
+               if (error_code == PLAYER_ERROR_NONE) {
+                       player->state = TG_AUDIO_PLAYER_STATE_PAUSE;
+                       if (player->timer) {
+                               ecore_timer_del(player->timer);
+                               player->timer = NULL;
+                       }
+                       player->state_callback(player, player->state, player->user_data);
+               }
+       }
+}
+
+void destroy_audio_player(tg_player_handler *player)
+{
+       if (!player)
+               return;
+       int error_code = 0;
+
+       error_code = player_stop(player->handler);
+       if (error_code == PLAYER_ERROR_NONE) {
+
+       }
+
+       error_code = player_unprepare(player->handler);
+       if (error_code == PLAYER_ERROR_NONE) {
+               if (player->timer) {
+                       ecore_timer_del(player->timer);
+                       player->timer = NULL;
+               }
+       }
+       player_destroy(player->handler);
+       player->state = TG_AUDIO_PLAYER_STATE_NONE;
+}
+
index 5dcb587..3d1add4 100644 (file)
@@ -13,7 +13,8 @@
 #include <Elementary.h>
 #include "tg_user_info_view.h"
 #include "tg_chat_info_view.h"
-
+#include "tg_audio_player.h"
+#include <metadata_extractor.h>
 /************************ Menu Handler ********************/
 
 void on_messaging_menu_option_selected_cb(void *data, Evas_Object *obj, void *event_info)
@@ -495,8 +496,6 @@ int get_image_size(long long media_id)
        return media_size;
 }
 
-
-
 void on_media_chat_item_clicked(void* data, Evas_Object *entry, void* event_info)
 {
        Evas_Object *button = evas_object_data_get(entry, "button_object");
@@ -517,7 +516,6 @@ void on_media_chat_item_clicked(void* data, Evas_Object *entry, void* event_info
                return;
        }
 
-
        long long media_id = atoll(temp_media_id);
 
        char *media_file = get_media_path_from_db(media_id);
@@ -623,6 +621,348 @@ static Evas_Object *get_media_layout_with_play(char *img_path, Evas_Object *pare
 
        return rec_video_layout;
 }
+
+void audio_player_progress_updated(void* handler, int current, int total, void *user_data)
+{
+       Evas_Object *parent = user_data;
+       Evas_Object *progressbar = evas_object_data_get(parent, "progress_control");
+
+
+       int seconds = (int) (current / 1000) % 60 ;
+       int minutes = (int) ((current / (1000*60)) % 60);
+
+       char tot_dur[256] = {0,};
+       char *format = NULL;
+       if (seconds < 10 && minutes < 10) {
+               format = "0%d:0%d";
+       } else if (seconds > 10 && minutes < 10) {
+               format = "%d:0%d";
+       } else if (seconds < 10 && minutes > 10) {
+               format = "0%d:%d";
+       } else {
+               format = "0%d:0%d";
+       }
+
+       sprintf(tot_dur, format, minutes, seconds);
+       elm_object_part_text_set(progressbar, "elm.text.bottom.left", tot_dur);
+
+       double current_status = (double)((double)current/(double)total);
+
+       elm_progressbar_value_set(progressbar, current_status);
+
+}
+
+void audio_player_state_changed(void* handler, TG_AUDIO_PLAYER_STATE state, void *user_data)
+{
+       tg_player_handler *audio_payer = handler;
+       Evas_Object *parent = user_data;
+
+       if (!audio_payer || !parent) {
+               return;
+       }
+
+       Eina_Bool is_play_mode = (Eina_Bool)evas_object_data_get(parent, "is_play_mode");
+       switch(audio_payer->state) {
+       case TG_AUDIO_PLAYER_STATE_NONE:
+               break;
+       case TG_AUDIO_PLAYER_STATE_INITIALIZED:
+               evas_object_data_set(parent, "tg_audio_player", audio_payer);
+               play_audio_player(audio_payer);
+               break;
+       case TG_AUDIO_PLAYER_STATE_PLAYING:
+               elm_image_file_set(parent, ui_utils_get_resource(TG_PAUSE_NORMAL_ICON), NULL);
+               is_play_mode = !is_play_mode;
+               evas_object_data_set(parent, "is_play_mode", is_play_mode);
+               break;
+       case TG_AUDIO_PLAYER_STATE_INTERRUPTED:
+               elm_image_file_set(parent, ui_utils_get_resource(TG_PLAY_NORMAL_ICON), NULL);
+               is_play_mode = !is_play_mode;
+               evas_object_data_set(parent, "is_play_mode", is_play_mode);
+               break;
+       case TG_AUDIO_PLAYER_STATE_PAUSE:
+               elm_image_file_set(parent, ui_utils_get_resource(TG_PLAY_NORMAL_ICON), NULL);
+               is_play_mode = !is_play_mode;
+               evas_object_data_set(parent, "is_play_mode", is_play_mode);
+               break;
+       case TG_AUDIO_PLAYER_STATE_ERROR:
+               break;
+       case TG_AUDIO_PLAYER_STATE_END:
+               destroy_audio_player(audio_payer);
+               free(audio_payer);
+
+               is_play_mode = EINA_FALSE;
+               evas_object_data_set(parent, "is_play_mode", is_play_mode);
+               evas_object_data_set(parent, "tg_audio_player", NULL);
+               elm_image_file_set(parent, ui_utils_get_resource(TG_PLAY_NORMAL_ICON), NULL);
+               audio_player_progress_updated(NULL, 0, 1, parent);
+               break;
+       default:
+               break;
+       }
+
+}
+
+static void on_message_play_pause_clicked(void *data, Evas_Object *obj, void *event_info)
+{
+       if (!data)
+               return;
+
+       appdata_s * ad = evas_object_data_get(data, "app_data");
+       char *audio_file = evas_object_data_get(data, "audio_file_path");
+       char *media_id = evas_object_data_get(data, "media_id");
+       if (!audio_file  || strlen(audio_file) <= 0 || strstr(audio_file, "_null_") != NULL) {
+               //there is no file. download it.
+               Evas_Object *progressbar = evas_object_data_get(data, "progress_control");
+               Eina_Bool is_download_in_progress = (Eina_Bool)evas_object_data_get(progressbar, "is_download_in_progress");
+
+               if (is_download_in_progress) {
+
+               } else {
+                       elm_object_style_set(progressbar, "pending");
+                       Eina_Bool ret = send_request_for_media_downloading(ad->service_client, ad->peer_in_cahtting_data->use_data->peer_id, atoll(media_id));
+                       if (!ret) {
+                               show_toast(ad, "Please check your network connection.");
+                               return;
+                       }
+               }
+               return;
+       }
+
+       tg_player_handler *audio_payer = evas_object_data_get(data, "tg_audio_player");
+
+       if (!audio_payer) {
+               audio_payer = init_audio_player(audio_file, &audio_player_state_changed, &audio_player_progress_updated, data);
+
+               if (!audio_payer) {
+                       show_toast(ad, "Unsupported file.");
+               }
+               return;
+       }
+
+       if (audio_payer->state == TG_AUDIO_PLAYER_STATE_PAUSE || audio_payer->state == TG_AUDIO_PLAYER_STATE_INTERRUPTED) {
+
+               play_audio_player(audio_payer);
+
+       } else if (audio_payer->state == TG_AUDIO_PLAYER_STATE_PLAYING) {
+
+               pause_audio_player(audio_payer);
+
+       }
+}
+
+static void on_message_play_pause_pressed(void *data, Evas_Object *obj, void *event_info)
+{
+       if (!data)
+               return;
+
+       Eina_Bool is_play_mode = (Eina_Bool)evas_object_data_get(data, "is_play_mode");
+       if (is_play_mode) {
+               elm_image_file_set(data, ui_utils_get_resource(TG_PAUSE_PRESS_ICON), NULL);
+       } else {
+               elm_image_file_set(data, ui_utils_get_resource(TG_PLAY_PRESS_ICON), NULL);
+       }
+}
+
+static void on_message_play_pause_unpressed(void *data, Evas_Object *obj, void *event_info)
+{
+       if (!data)
+               return;
+
+       Eina_Bool is_play_mode = (Eina_Bool)evas_object_data_get(data, "is_play_mode");
+       if (is_play_mode) {
+
+               elm_image_file_set(data, ui_utils_get_resource(TG_PAUSE_NORMAL_ICON), NULL);
+       } else {
+               elm_image_file_set(data, ui_utils_get_resource(TG_PLAY_NORMAL_ICON), NULL);
+       }
+}
+
+/*
+static Eina_Bool progress_timer_cb(void *data)
+{
+       double value = 0.0;
+       Evas_Object *progressbar = data;
+
+       value = elm_progressbar_value_get(progressbar);
+       if (value == 1.0) value = 0.0;
+       value = value + 0.01;
+       elm_progressbar_value_set(progressbar, value);
+
+       return ECORE_CALLBACK_RENEW;
+}
+*/
+
+static void progressbar_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+
+
+}
+
+static Evas_Object *create_audio_progressbar(Evas_Object *parent, int duration)
+{
+       Evas_Object *progressbar;
+
+       progressbar = elm_progressbar_add(parent);
+       evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.5);
+       evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_progressbar_value_set(progressbar, 0.0);
+       evas_object_event_callback_add(progressbar, EVAS_CALLBACK_DEL, progressbar_del_cb, NULL);
+       evas_object_show(progressbar);
+
+       elm_object_part_text_set(progressbar, "elm.text.top.left", "");
+       elm_object_part_text_set(progressbar, "elm.text.top.right", "");
+
+       elm_object_part_text_set(progressbar, "elm.text.bottom.left", "00:00");
+
+       int seconds = (int) (duration / 1000) % 60 ;
+       int minutes = (int) ((duration / (1000*60)) % 60);
+
+       char tot_dur[256] = {0,};
+       char *format = NULL;
+       if (seconds < 10 && minutes < 10) {
+               format = "0%d:0%d";
+       } else if (seconds > 10 && minutes < 10) {
+               format = "%d:0%d";
+       } else if (seconds < 10 && minutes > 10) {
+               format = "0%d:%d";
+       } else {
+               format = "0%d:0%d";
+       }
+
+       sprintf(tot_dur, format, minutes, seconds);
+
+       elm_object_part_text_set(progressbar, "elm.text.bottom.right", tot_dur);
+
+       return progressbar;
+}
+
+
+static Evas_Object *get_audio_layout_with_play(Evas_Object *parent)
+{
+       Evas_Object* chat_list = parent;
+       Evas_Object *rec_video_layout = NULL;
+       tgl_media_s *media_msg = NULL;
+       appdata_s* ad = evas_object_data_get(chat_list, "app_data");
+       int user_id = (int)evas_object_data_get(chat_list, "user_id");
+       int message_id = (int)evas_object_data_get(chat_list, "message_id");
+
+       peer_with_pic_s *sel_item =  eina_list_nth(ad->peer_list, user_id);
+       int buddy_id = sel_item->use_data->peer_id;
+
+       char* tablename = get_table_name_from_number(buddy_id);
+       tg_message_s* msg = get_message_from_message_table(message_id, tablename);
+       free(tablename);
+       if (!msg) {
+               return NULL;
+       }
+
+       Evas_Object *parent_obj = evas_object_data_get(chat_list, "parent_obj"); //entry
+
+       //if (msg->out) {
+
+               media_msg = get_media_details_from_db(atoll(msg->media_id));
+
+               char *audio_file = media_msg->file_path;
+
+               char edj_path[PATH_MAX] = {0, };
+               app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX);
+               rec_video_layout = elm_layout_add(parent);
+               elm_layout_file_set(rec_video_layout, edj_path, "bubble_audio_item_layout");
+               evas_object_size_hint_weight_set(rec_video_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+               evas_object_size_hint_align_set(rec_video_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+               evas_object_show(rec_video_layout);
+
+
+               /**************** play icon **********************/
+               Evas_Object* play_pause_btn = elm_button_add(parent);
+               elm_object_style_set(play_pause_btn, "transparent");
+               evas_object_size_hint_align_set(play_pause_btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
+               evas_object_size_hint_weight_set(play_pause_btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+               Evas_Object* play_pause_icon = elm_image_add(parent);
+               evas_object_size_hint_align_set(play_pause_icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
+               evas_object_size_hint_weight_set(play_pause_icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+               elm_image_file_set(play_pause_icon, ui_utils_get_resource(TG_PLAY_NORMAL_ICON), NULL);
+
+               elm_image_resizable_set(play_pause_icon, EINA_TRUE, EINA_TRUE);
+               evas_object_show(play_pause_icon);
+
+               elm_object_content_set(play_pause_btn, play_pause_icon);
+
+               Eina_Bool is_play_mode = EINA_TRUE;
+               evas_object_data_set(play_pause_icon, "is_play_mode", is_play_mode);
+
+               evas_object_data_set(play_pause_icon, "audio_file_path", strdup(audio_file));
+               evas_object_data_set(play_pause_icon, "app_data", ad);
+               evas_object_data_set(play_pause_icon, "user_id", (void*)user_id);
+               evas_object_data_set(play_pause_icon, "message_id", (void*)message_id);
+               evas_object_data_set(play_pause_icon, "media_id", strdup(msg->media_id));
+
+               evas_object_smart_callback_add(parent_obj, "clicked", on_message_play_pause_clicked, play_pause_icon);
+               evas_object_smart_callback_add(parent_obj, "pressed", on_message_play_pause_pressed, play_pause_icon);
+               evas_object_smart_callback_add(parent_obj, "unpressed", on_message_play_pause_unpressed, play_pause_icon);
+
+               evas_object_smart_callback_add(play_pause_btn, "clicked", on_message_play_pause_clicked, play_pause_icon);
+               evas_object_smart_callback_add(play_pause_btn, "pressed", on_message_play_pause_pressed, play_pause_icon);
+               evas_object_smart_callback_add(play_pause_btn, "unpressed", on_message_play_pause_unpressed, play_pause_icon);
+
+               elm_object_part_content_set(rec_video_layout, "swallow.play_icon", play_pause_btn);
+               /**************** play icon **********************/
+
+               /*************** progress bar ********************/
+               int total_duration = 0;
+               if (audio_file) {
+                       metadata_extractor_h metadata;
+                       metadata_extractor_create(&metadata);
+                       int ret = metadata_extractor_set_path(metadata, audio_file);
+                       char *value = NULL;
+                       ret = metadata_extractor_get_metadata(metadata, METADATA_DURATION, &value);
+                       metadata_extractor_destroy(metadata);
+
+
+                       if (value) {
+                               total_duration = atoi(value);
+                               free(value);
+                       }
+               } else {
+                       total_duration = media_msg->doc_duration;
+                       //convert into milli secs
+                       total_duration = 1000 * total_duration;
+               }
+               Evas_Object *progress = create_audio_progressbar(parent, total_duration);
+
+               evas_object_data_set(parent_obj, "play_pause_icon", play_pause_icon);
+               evas_object_data_set(parent_obj, "progress_bar", progress);
+
+               elm_object_part_content_set(rec_video_layout, "swallow.progress_icon", progress);
+
+               evas_object_data_set(play_pause_icon, "progress_control", (void*)progress);
+               Eina_Bool is_download_in_progress = EINA_FALSE;
+               evas_object_data_set(progress, "is_download_in_progress", (void*)is_download_in_progress);
+
+               /*************** progress bar ********************/
+
+       //}
+
+       if(msg->message) {
+               free(msg->message);
+               msg->message = NULL;
+       }
+
+       if(msg->media_id) {
+               free(msg->media_id);
+               msg->media_id = NULL;
+       }
+
+       free(msg);
+       free_media_details(media_msg);
+
+
+       return rec_video_layout;
+}
+
+
 static Evas_Object * item_provider(void *data, Evas_Object *entry, const char *item)
 {
 
@@ -686,25 +1026,40 @@ static Evas_Object * item_provider(void *data, Evas_Object *entry, const char *i
 
                        }
 
-                       if (msg->out) {
+                       if (media_msg && strstr(media_msg->doc_type, "audio") != NULL) {
+
+                               evas_object_data_set(chat_list, "parent_obj", (void*)entry);
+                               item_to_display = get_audio_layout_with_play(chat_list);
+
+                       } else if (msg->out) {
+
                                if (msg->media_type == tgl_message_media_photo) {
+
                                        item_to_display = get_image_from_path(img_path, entry);
+
                                } else {
-                                       if ((media_msg && strstr(media_msg->doc_type, "video") != NULL )|| (media_msg && strstr(media_msg->doc_type, "audio") != NULL)) {
+                                       if (media_msg && strstr(media_msg->doc_type, "video") != NULL) {
+
                                                item_to_display = get_media_layout_with_play(img_path, entry, EINA_TRUE);
+
                                        } else {
 
                                        }
                                }
+
                        } else {
                                if (!is_blur_image) {
 
                                        if (msg->media_type == tgl_message_media_photo) {
+
                                                item_to_display = get_image_from_path(img_path, entry);
                                                evas_object_data_set(entry, "image_object", (void*)item_to_display);
+
                                        } else {
-                                               if ((media_msg && strstr(media_msg->doc_type, "video") != NULL )|| (media_msg && strstr(media_msg->doc_type, "audio") != NULL)) {
+                                               if (media_msg && strstr(media_msg->doc_type, "video") != NULL) {
+
                                                        item_to_display = get_media_layout_with_play(img_path, entry, EINA_TRUE);
+
                                                } else {
 
                                                }
@@ -809,25 +1164,29 @@ static Evas_Object * item_provider(void *data, Evas_Object *entry, const char *i
 
                evas_object_data_set(entry, "media_id", (void*)strdup(msg->media_id));
 
-               evas_object_smart_callback_add(entry, "clicked", on_media_chat_item_clicked, NULL);
                if (item_to_display) {
 
-                       char edj_path[PATH_MAX] = {0, };
-                       app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX);
-                       layout = elm_layout_add(entry);
-                       elm_layout_file_set(layout, edj_path, "chat_image_layout");
-                       evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-                       evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
-                       evas_object_show(layout);
+                       if (media_msg && strstr(media_msg->doc_type, "audio") != NULL) {
+                               layout = item_to_display;
+                       } else {
+                               char edj_path[PATH_MAX] = {0, };
+                               app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX);
+                               layout = elm_layout_add(entry);
+                               elm_layout_file_set(layout, edj_path, "chat_image_layout");
+                               evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+                               evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+                               evas_object_show(layout);
 
-                       Evas_Object *rounded_layout = elm_layout_add(entry);
-                       elm_layout_file_set(rounded_layout, edj_path, "rounded_corner_layout");
-                       evas_object_size_hint_weight_set(rounded_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-                       evas_object_size_hint_align_set(rounded_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
-                       evas_object_show(rounded_layout);
-                       elm_object_part_content_set(rounded_layout, "content", item_to_display);
+                               Evas_Object *rounded_layout = elm_layout_add(entry);
+                               elm_layout_file_set(rounded_layout, edj_path, "rounded_corner_layout");
+                               evas_object_size_hint_weight_set(rounded_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+                               evas_object_size_hint_align_set(rounded_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+                               evas_object_show(rounded_layout);
+                               elm_object_part_content_set(rounded_layout, "content", item_to_display);
 
-                       elm_object_part_content_set(layout, "swallow.chat_image", rounded_layout);
+                               elm_object_part_content_set(layout, "swallow.chat_image", rounded_layout);
+                               evas_object_smart_callback_add(entry, "clicked", on_media_chat_item_clicked, NULL);
+                       }
                }
 
                if(msg->message) {
@@ -975,12 +1334,16 @@ Evas_Object *on_message_item_content_get_cb(void *data, Evas_Object *obj, const
                        evas_object_show(layout);
 
                        // To be handled for group chat
-#if 0
+
                        char temp_name[256] = {0,};
-                       snprintf(temp_name, sizeof(temp_name), "<font=Tizen:style=Regular color=#f16745 align=left><font_size=12>%s</br></font_size></font>", sender_name);
-#endif
+                       if (msg->media_type == tgl_message_media_photo || msg->media_type == tgl_message_media_document) {
+                               snprintf(temp_name, sizeof(temp_name), "<font=Tizen:style=Regular color=#000000 align=left><font_size=12>%s</br></br></font_size></font>", sender_name);
+                       } else {
+                               snprintf(temp_name, sizeof(temp_name), "<font=Tizen:style=Regular color=#000000 align=left><font_size=12>%s</br></font_size></font>", sender_name);
+                       }
+
                        Eina_Strbuf *buf = eina_strbuf_new();
-                       eina_strbuf_append(buf, "");
+                       eina_strbuf_append(buf, temp_name);
 
                        if (sender_name) {
                                free(sender_name);
@@ -999,9 +1362,37 @@ Evas_Object *on_message_item_content_get_cb(void *data, Evas_Object *obj, const
 
                                tgl_media_s *media_msg = get_media_details_from_db(atoll(msg->media_id));
                                if (msg->out) {
-                                       eina_strbuf_append(buf, "<item size=147x147 vsize=full href=itemprovider></item>");
+                                       if (media_msg) {
+                                               if (strstr(media_msg->doc_type, "audio") != NULL) {
+                                                       if (ad->target_direction == TELEGRAM_TARGET_DIRECTION_PORTRAIT || ad->target_direction == TELEGRAM_TARGET_DIRECTION_PORTRAIT_INVERSE) {
+                                                               eina_strbuf_append(buf, "<item size=247x30 vsize=full hsize=full href=itemprovider></item>");
+                                                       } else {
+                                                               eina_strbuf_append(buf, "<item size=190x30 vsize=full hsize=full href=itemprovider></item>");
+                                                       }
+
+                                               } else if (strstr(media_msg->doc_type, "video") != NULL) {
+                                                       eina_strbuf_append(buf, "<item size=147x147 vsize=full hsize=full href=itemprovider></item>");
+                                               } else {
+                                                       eina_strbuf_append(buf, "<item size=147x147 vsize=full href=itemprovider></item>");
+                                               }
+                                       }
                                } else {
-                                       eina_strbuf_append(buf, "<item size=100x147 vsize=full href=itemprovider></item>");
+                                       if (media_msg) {
+                                               if (strstr(media_msg->doc_type, "audio") != NULL) {
+
+                                                       if (ad->target_direction == TELEGRAM_TARGET_DIRECTION_PORTRAIT || ad->target_direction == TELEGRAM_TARGET_DIRECTION_PORTRAIT_INVERSE) {
+                                                               elm_object_style_set(entry, "readmessage_audio");
+                                                       } else {
+                                                               elm_object_style_set(entry, "readmessage_audio_land");
+                                                       }
+
+                                                       eina_strbuf_append(buf, "<item size=247x30 vsize=full hsize=full href=itemprovider></item>");
+                                               } else if (strstr(media_msg->doc_type, "video") != NULL) {
+                                                       eina_strbuf_append(buf, "<item size=100x147 vsize=full hsize=full href=itemprovider></item>");
+                                               } else {
+                                                       eina_strbuf_append(buf, "<item size=100x147 vsize=full href=itemprovider></item>");
+                                               }
+                                       }
                                }
                                free_media_details(media_msg);
                                elm_entry_entry_set(entry, eina_strbuf_string_get(buf));
@@ -1194,12 +1585,23 @@ void on_media_download_completed(appdata_s* ad, int buddy_id, long long media_id
                                        long long lmedia_id = atoll(media_id_str);
 
                                        if (media_id == lmedia_id) {
-                                               if (img_item) {
+                                               if (img_item || (strstr(media_type_str, "audio") != NULL)) {
+
 
                                                        if (strstr(file_path, "failed_to_load") != NULL) {
+
+                                                               if ((strstr(media_type_str, "audio") != NULL)) {
+                                                                       Evas_Object *play_pause_icon = evas_object_data_get(entry, "play_pause_icon");
+                                                                       Evas_Object *progressbar = evas_object_data_get(entry, "progress_bar");
+                                                                       evas_object_data_set(progressbar, "is_download_in_progress", EINA_FALSE);
+                                                                       evas_object_data_set(play_pause_icon, "audio_file_path", NULL);
+                                                                       //sandeep
+                                                                       elm_object_style_set(progressbar, "default");
+                                                                       return;
+                                                               }
+
                                                                // download failed.
                                                                if (size_btn) {
-
                                                                        Evas_Object* progress = elm_object_content_get(size_btn);
                                                                        if (progress) {
                                                                                evas_object_del(progress);
@@ -1214,11 +1616,60 @@ void on_media_download_completed(appdata_s* ad, int buddy_id, long long media_id
 
 
                                                        } else {
+
+                                                               if ((strstr(media_type_str, "audio") != NULL)) {
+                                                                       Evas_Object *play_pause_icon = evas_object_data_get(entry, "play_pause_icon");
+                                                                       Evas_Object *progressbar = evas_object_data_get(entry, "progress_bar");
+                                                                       evas_object_data_set(progressbar, "is_download_in_progress", EINA_FALSE);
+                                                                       elm_object_style_set(progressbar, "default");
+                                                                       evas_object_data_set(play_pause_icon, "audio_file_path", file_path);
+                                                                       //sandeep
+                                                                       metadata_extractor_h metadata;
+                                                                       metadata_extractor_create(&metadata);
+                                                                       int ret = metadata_extractor_set_path(metadata, file_path);
+                                                                       char *value = NULL;
+                                                                       ret = metadata_extractor_get_metadata(metadata, METADATA_DURATION, &value);
+                                                                       metadata_extractor_destroy(metadata);
+
+                                                                       int duration = 0;
+                                                                       if (value) {
+                                                                               duration = atoi(value);
+                                                                               free(value);
+                                                                       }
+
+                                                                       elm_object_part_text_set(progressbar, "elm.text.top.left", "");
+                                                                       elm_object_part_text_set(progressbar, "elm.text.top.right", "");
+
+                                                                       elm_object_part_text_set(progressbar, "elm.text.bottom.left", "00:00");
+
+                                                                       int seconds = (int) (duration / 1000) % 60 ;
+                                                                       int minutes = (int) ((duration / (1000*60)) % 60);
+
+                                                                       char tot_dur[256] = {0,};
+                                                                       char *format = NULL;
+                                                                       if (seconds < 10 && minutes < 10) {
+                                                                               format = "0%d:0%d";
+                                                                       } else if (seconds > 10 && minutes < 10) {
+                                                                               format = "%d:0%d";
+                                                                       } else if (seconds < 10 && minutes > 10) {
+                                                                               format = "0%d:%d";
+                                                                       } else {
+                                                                               format = "0%d:0%d";
+                                                                       }
+
+                                                                       sprintf(tot_dur, format, minutes, seconds);
+
+                                                                       elm_object_part_text_set(progressbar, "elm.text.bottom.right", tot_dur);
+
+
+                                                                       return;
+                                                               }
+
                                                                if (size_btn) {
                                                                        evas_object_del(size_btn);
                                                                }
 
-                                                               if ((strstr(media_type_str, "video") != NULL) || (strstr(media_type_str, "audio") != NULL)) {
+                                                               if ((strstr(media_type_str, "video") != NULL)) {
                                                                        Evas_Object* play_img = get_video_paly_icon(img_item);
                                                                        //Evas_Object* play_img = get_image_from_path(ui_utils_get_resource(MEDIA_PLAY_ICON), img_item);
                                                                        elm_object_part_content_set(img_item, "swallow.play_btn", play_img);
@@ -1341,8 +1792,7 @@ static Eina_Bool on_new_text_message_send_cb(void *data)
        if (!text_to_send || (strlen(text_to_send) == 0))
                return ECORE_CALLBACK_CANCEL;
 
-       ad->msg_count = ad->msg_count + 1001;
-       int unique_id = time(NULL) + ad->msg_count;
+       int unique_id = time(NULL);
        tg_message_s msg;
        msg.msg_id = unique_id;
        msg.from_id = ad->current_user_data->user_id.id;
@@ -1407,11 +1857,10 @@ static void on_text_message_send_clicked(void *data, Evas_Object *obj, void *eve
                return;
 
        if(add_date_item_to_chat(data)) {
-               ecore_timer_add(1, on_new_text_message_send_cb, chat_list);
+               ecore_timer_add(2, on_new_text_message_send_cb, chat_list);
                return;
        }
-       ad->msg_count = ad->msg_count + 1001;
-       int unique_id = time(NULL) + ad->msg_count;
+       int unique_id = time(NULL);
        tg_message_s msg;
        msg.msg_id = unique_id;
        msg.from_id = ad->current_user_data->user_id.id;
@@ -1550,13 +1999,31 @@ void on_user_presence_state_changed(appdata_s* ad, int buddy_id)
                int user_list_size = chat_info->user_list_size;
                int online_members = 0;
 
+               char *names_of_buddies = NULL;
+
+
                for (int i = 0; i < user_list_size; i++) {
+
                        int is_online = get_buddy_online_status(chat_info->chat_users[i]);
                        if (is_online > 0) {
                                online_members++;
                        }
+
+                       char *buddy_name = get_buddy_name_from_id(chat_info->chat_users[i]);
+
+                       if (buddy_name) {
+                               if (!names_of_buddies) {
+                                       names_of_buddies = (char*)malloc(strlen(buddy_name) + 1);
+                                       strcpy(names_of_buddies, buddy_name);
+                               } else {
+                                       names_of_buddies = (char*)realloc(names_of_buddies, strlen(names_of_buddies) + strlen(" / ") + strlen(buddy_name) + 1);
+                                       strcat(names_of_buddies, " / ");
+                                       strcat(names_of_buddies, buddy_name);
+                               }
+                       }
                }
 
+               evas_object_data_set(ad->nf, "names_of_buddies", (void*)names_of_buddies);
 
 
                if (online_members == 0) {
@@ -1648,8 +2115,7 @@ static Eina_Bool on_new_contact_message_send_cb(void *data)
 
        peer_with_pic_s *sel_item =  eina_list_nth(ad->peer_list, user_id);
 
-       ad->msg_count = ad->msg_count + 1001;
-       int unique_id = time(NULL) + ad->msg_count;
+       int unique_id = time(NULL);
 
        char unique_id_str[50];
        sprintf(unique_id_str, "%d", unique_id);
@@ -1713,20 +2179,17 @@ void send_contact_message_to_buddy(void *data, char *first_name, char *last_name
        int user_id = (int)evas_object_data_get(chat_list, "user_id");
 
        if(add_date_item_to_chat(data)) {
-
                evas_object_data_set(chat_list, "contact_first_name", strdup(first_name));
                evas_object_data_set(chat_list, "contact_last_name", strdup(last_name));
                evas_object_data_set(chat_list, "contact_phone_number", strdup(phone_number));
 
-               ecore_timer_add(1, on_new_contact_message_send_cb, chat_list);
+               ecore_timer_add(2, on_new_contact_message_send_cb, chat_list);
                return;
        }
 
-
        peer_with_pic_s *sel_item =  eina_list_nth(ad->peer_list, user_id);
 
-       ad->msg_count = ad->msg_count + 1001;
-       int unique_id = time(NULL) + ad->msg_count;
+       int unique_id = time(NULL);
 
        char unique_id_str[50];
        sprintf(unique_id_str, "%d", unique_id);
@@ -1783,8 +2246,7 @@ static Eina_Bool on_new_location_message_send_cb(void *data)
 
        peer_with_pic_s *sel_item =  eina_list_nth(ad->peer_list, user_id);
 
-       ad->msg_count = ad->msg_count + 1001;
-       int unique_id = time(NULL) + ad->msg_count;
+       int unique_id = time(NULL);
 
        char unique_id_str[50];
        sprintf(unique_id_str, "%d", unique_id);
@@ -1846,14 +2308,13 @@ void send_location_message_to_buddy(void *data, char *latitude, char *longitude)
        if(add_date_item_to_chat(data)) {
                evas_object_data_set(chat_list, "contact_latitude", strdup(latitude));
                evas_object_data_set(chat_list, "contact_longitude", strdup(longitude));
-               ecore_timer_add(1, on_new_location_message_send_cb, chat_list);
+               ecore_timer_add(2, on_new_location_message_send_cb, chat_list);
                return;
        }
 
        peer_with_pic_s *sel_item =  eina_list_nth(ad->peer_list, user_id);
 
-       ad->msg_count = ad->msg_count + 1001;
-       int unique_id = time(NULL) + ad->msg_count;
+       int unique_id = time(NULL);
 
        char unique_id_str[50];
        sprintf(unique_id_str, "%d", unique_id);
@@ -1909,8 +2370,7 @@ static Eina_Bool on_new_media_message_send_cb(void *data)
 
        peer_with_pic_s *sel_item =  eina_list_nth(ad->peer_list, user_id);
 
-       ad->msg_count = ad->msg_count + 1001;
-       int unique_id = time(NULL) + ad->msg_count;
+       int unique_id = time(NULL);
 
        char unique_id_str[50];
        sprintf(unique_id_str, "%d", unique_id);
@@ -1986,13 +2446,12 @@ void send_media_message_to_buddy(void *data, const char* file_path, enum tgl_mes
                evas_object_data_set(chat_list, "file_type", strdup(file_type_char));
                evas_object_data_set(chat_list, "file_path", strdup(file_path));
 
-               ecore_timer_add(1, on_new_media_message_send_cb, chat_list);
+               ecore_timer_add(2, on_new_media_message_send_cb, chat_list);
                return;
        }
        peer_with_pic_s *sel_item =  eina_list_nth(ad->peer_list, user_id);
 
-       ad->msg_count = ad->msg_count + 1001;
-       int unique_id = time(NULL) + ad->msg_count;
+       int unique_id = time(NULL);
 
        char unique_id_str[50];
        sprintf(unique_id_str, "%d", unique_id);
@@ -2583,13 +3042,115 @@ void refresh_messaging_view(appdata_s *ad)
                return;
 
        Evas_Object *chat_conv_list = evas_object_data_get(ad->nf, "chat_list");
-       if (!chat_conv_list) {
+       if (chat_conv_list) {
+               /*
                Evas_Coord w, h;
                elm_win_screen_size_get(ad->win, NULL, NULL, &w, &h);
                evas_object_size_hint_min_set(chat_conv_list, w, h);
+               */
+               elm_genlist_realized_items_update(chat_conv_list);
+               Elm_Object_Item *item = elm_genlist_last_item_get(chat_conv_list);
+               elm_genlist_item_show(item, ELM_GENLIST_ITEM_SCROLLTO_TOP);
+       }
+
+       Evas_Object *user_pic_layout = evas_object_data_get(ad->nf, "profile_pic_layout");
+
+       if (!user_pic_layout)
+               return;
+
+       switch (ad->target_direction) {
+       case TELEGRAM_TARGET_DIRECTION_PORTRAIT:
+       case TELEGRAM_TARGET_DIRECTION_PORTRAIT_INVERSE:
+       {
+               elm_layout_signal_emit(user_pic_layout, "pro_pic_default", "pro_pic_resize");
+               break;
+       }
+       case TELEGRAM_TARGET_DIRECTION_LANDSCAPE:
+       case TELEGRAM_TARGET_DIRECTION_LANDSCAPE_INVERSE:
+       {
+               elm_layout_signal_emit(user_pic_layout, "pro_pic_land", "pro_pic_resize");
+               break;
+       }
+
+       default:
+       {
+               break;
+       }
        }
+
 }
 
+static void on_expand_buton_clicked(void *data, Evas_Object *obj, void *event_info)
+{
+       Evas_Object *expand_pic = data;
+       if (!expand_pic)
+               return;
+
+       appdata_s *ad = evas_object_data_get(expand_pic, "app_data");
+       Evas_Object *parent_layout = evas_object_data_get(expand_pic, "parent_layout");
+
+       Eina_Bool is_expanded = (Eina_Bool)evas_object_data_get(expand_pic, "is_expanded");
+
+       if (!is_expanded) {
+
+               elm_image_file_set(expand_pic, ui_utils_get_resource(TG_EXPAND_CLOSE), NULL);
+
+               Evas_Object *grp_names_bg = elm_bg_add(ad->nf);
+               evas_object_size_hint_align_set(grp_names_bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
+               evas_object_size_hint_weight_set(grp_names_bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+               evas_object_color_set(grp_names_bg, 45, 165, 224, 255);
+           elm_image_resizable_set(grp_names_bg, EINA_TRUE, EINA_TRUE);
+           elm_image_fill_outside_set(grp_names_bg, EINA_TRUE);
+           evas_object_show(grp_names_bg);
+           elm_object_part_content_set(parent_layout, "swallow.group_detail_box,bg", grp_names_bg);
+
+           Evas_Object* grp_names_lbl = elm_entry_add(ad->nf);
+               elm_entry_cursor_end_set(grp_names_lbl);
+               evas_object_size_hint_weight_set(grp_names_lbl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+               evas_object_size_hint_align_set(grp_names_lbl, EVAS_HINT_FILL, EVAS_HINT_FILL);
+               elm_entry_single_line_set(grp_names_lbl,  EINA_FALSE);
+               elm_entry_scrollable_set (grp_names_lbl, EINA_TRUE);
+               elm_entry_cnp_mode_set(grp_names_lbl, ELM_CNP_MODE_NO_IMAGE);
+               elm_entry_context_menu_disabled_set(grp_names_lbl, EINA_TRUE);
+               elm_object_focus_set(grp_names_lbl, EINA_FALSE);
+           elm_entry_editable_set(grp_names_lbl, EINA_FALSE);
+
+               evas_object_show(grp_names_lbl);
+
+               char *names_of_buddies = evas_object_data_get(ad->nf, "names_of_buddies");
+               if (names_of_buddies) {
+                       int len = strlen(names_of_buddies);
+                       char *names_str = (char*)malloc(len + 256);
+                       sprintf(names_str, "<font=Tizen:style=Bold color=#FAFAFA align=center><font_size=40>%s</font_size></font>",names_of_buddies);
+                       elm_object_text_set(grp_names_lbl, names_str);
+                       free(names_str);
+               }
+
+               elm_object_part_content_set(parent_layout, "swallow.group_detail_box", grp_names_lbl);
+
+       } else {
+
+               elm_image_file_set(expand_pic, ui_utils_get_resource(TG_EXPAND_OPEN), NULL);
+
+               Evas_Object *grp_names_lbl = elm_object_part_content_get(parent_layout, "swallow.group_detail_box");
+               if (grp_names_lbl) {
+                       evas_object_del(grp_names_lbl);
+                       grp_names_lbl = NULL;
+               }
+
+               Evas_Object *grp_names_bg = elm_object_part_content_get(parent_layout, "swallow.group_detail_box,bg");
+               if (grp_names_bg) {
+                       evas_object_del(grp_names_bg);
+                       grp_names_bg = NULL;
+               }
+       }
+       is_expanded = !is_expanded;
+       evas_object_data_set(expand_pic, "is_expanded", is_expanded);
+
+
+}
+
+
 void launch_messaging_view_cb(appdata_s* ad, int user_id)
 {
        if (!ad)
@@ -2624,12 +3185,9 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id)
        evas_object_show(layout);
        elm_object_content_set(scroller, layout);
 
-
-
        peer_with_pic_s *sel_item =  eina_list_nth(ad->peer_list, user_id);
        tg_peer_info_s* user = sel_item->use_data;
 
-
        /*************************** message list ************************************/
 
        Evas_Object* msg_box_layout = elm_layout_add(ad->nf);
@@ -2675,11 +3233,15 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id)
        /********************** title layout ******************************/
 
        Evas_Object *title_layout = elm_layout_add(ad->nf);
-       elm_layout_file_set(title_layout, edj_path, "message_title_box");
+       elm_layout_file_set(title_layout, edj_path, "chat_title_box");
        evas_object_size_hint_weight_set(title_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(title_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
        evas_object_show(title_layout);
 
+       Evas_Object *back_btn = create_button(ad->nf, "naviframe/back_btn/default", NULL);
+       evas_object_smart_callback_add(back_btn, "clicked", on_message_back_button_clicked, ad);
+       elm_object_part_content_set(title_layout, "swallow.back_arrow", back_btn);
+
        Evas_Object *profile_pic = NULL;
        profile_pic = elm_image_add(layout);
        evas_object_size_hint_weight_set(profile_pic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -2709,14 +3271,7 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id)
        elm_object_part_content_set(user_pic_layout, "content", profile_pic);
        evas_object_data_set(ad->nf, "profile_picture", (void*)profile_pic);
        elm_object_part_content_set(title_layout, "swallow.profile_pic", user_pic_layout);
-
-       elm_object_part_content_set(main_layout, "swallow.item", title_layout);
-
-       Evas_Object *back_btn = create_button(ad->nf, "naviframe/back_btn/default", NULL);
-       evas_object_smart_callback_add(back_btn, "clicked", on_message_back_button_clicked, ad);
-       elm_object_part_content_set(title_layout, "swallow.back_arrow", back_btn);
-
-
+       evas_object_data_set(ad->nf, "profile_pic_layout", (void*)user_pic_layout);
 
        Evas_Object *profile_name = elm_label_add(title_layout);
        if ((user->peer_type == TGL_PEER_USER) && get_buddy_unknown_status(user->peer_id)) {
@@ -2747,11 +3302,38 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id)
        evas_object_data_set(ad->nf, "profile_time", (void*)profile_time);
        evas_object_smart_callback_add(profile_time, "clicked", on_user_info_button_clicked, ad);
 
-       //elm_object_content_set(title_scroller, title_layout);
 
        on_user_presence_state_changed(ad, sel_item->use_data->peer_id);
 
-       elm_object_part_content_set(layout, "swallow.title_box", main_layout);
+
+
+       /******************** expand ************************/
+       if (user->peer_type == TGL_PEER_CHAT) {
+               Evas_Object *expand_pic = NULL;
+               expand_pic = elm_image_add(layout);
+               evas_object_size_hint_weight_set(expand_pic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+               evas_object_size_hint_align_set(expand_pic, EVAS_HINT_FILL, EVAS_HINT_FILL);
+               elm_object_focus_set(expand_pic, EINA_FALSE);
+               elm_image_file_set(expand_pic, ui_utils_get_resource(TG_EXPAND_OPEN), NULL);
+               evas_object_show(expand_pic);
+               evas_object_data_set(expand_pic, "app_data", ad);
+               evas_object_data_set(expand_pic, "parent_layout", layout);
+
+               Eina_Bool is_expanded = EINA_FALSE;
+               evas_object_data_set(expand_pic, "is_expanded", is_expanded);
+               Evas_Object* expand_btn = elm_button_add(ad->layout);
+               elm_object_style_set(expand_btn, "transparent");
+               evas_object_smart_callback_add(expand_btn, "clicked", on_expand_buton_clicked, expand_pic);
+               elm_object_content_set(expand_btn, expand_pic);
+               evas_object_show(expand_btn);
+               elm_object_part_content_set(title_layout, "swallow.expand_btn", expand_btn);
+
+       }
+       /******************** expand ************************/
+
+
+       elm_object_part_content_set(layout, "swallow.title_box", title_layout);
+
 
        /********************** title layout ******************************/
 
@@ -2861,7 +3443,6 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id)
     evas_object_smart_callback_add(send_btn, "unpressed", on_message_smiley_unpressed, send_icon);
        elm_object_part_content_set(entry_box_layout, "swallow.send_icon", send_btn);
 
-       //elm_object_part_content_set(layout, "swallow.entry_box", entry_box_layout);
        /********************** entry layout*******************************/
 
        evas_object_data_set(ad->nf, "chat_list", (void*)chat_conv_list);
@@ -2870,10 +3451,11 @@ void launch_messaging_view_cb(appdata_s* ad, int user_id)
        evas_object_data_set(chat_conv_list, "text_entry", (void*)text_entry);
        evas_object_data_set(chat_conv_list, "profile_time", (void*)profile_time);
 
-       Elm_Object_Item *nf_it = elm_naviframe_item_simple_push(ad->nf, scroller);
 
+       Elm_Object_Item *nf_it = elm_naviframe_item_simple_push(ad->nf, scroller);
        elm_object_item_part_content_set(nf_it, "toolbar", entry_box_layout);
 
+
        Eina_Bool ret = load_chat_history(chat_conv_list);
 
        if (!ret) {
index e67db44..0af3ab8 100644 (file)
@@ -261,11 +261,8 @@ void on_image_select_result_cb(app_control_h request, app_control_h reply, app_c
                        if (file_path) {
                                appdata_s *ad = (appdata_s*)user_data;
                                if (ad) {
-                                       Evas_Object *profile_pic = evas_object_data_get(ad->nf, "user_profile_pic");
-                                       if (profile_pic) {
-                                               elm_image_file_set(profile_pic, file_path, NULL);
-                                               send_set_profile_pic_request(ad->service_client, ad->current_user_data->user_id.id, file_path);
-                                       }
+                                       show_loading_popup(ad);
+                                       send_set_profile_pic_request(ad->service_client, ad->current_user_data->user_id.id, file_path);
                                }
                                break;
                        }
@@ -317,7 +314,10 @@ char* on_camera_load_text_get_cb(void *data, Evas_Object *obj, const char *part)
 
 void on_camera_button_clicked(void *data, Evas_Object *obj, void *event_info)
 {
-       Evas_Object* cam_icon =  data;
+       appdata_s* ad = data;
+
+       if (!ad)
+               return;
 
        static Elm_Genlist_Item_Class itc;
        Evas_Object *popup;
@@ -325,7 +325,7 @@ void on_camera_button_clicked(void *data, Evas_Object *obj, void *event_info)
        Evas_Object *genlist;
        int i;
 
-       appdata_s* ad = evas_object_data_get(obj, "app_data");
+
        Evas_Object *win = ad->win;
 
        Elm_Object_Item *it = event_info;
@@ -685,7 +685,7 @@ char* _text_requested_cb(void *data, Evas_Object *obj, const char *part)
        if (!strcmp(part,"elm.text.main.left.top") || !strcmp(part,"elm.text")){
                switch(id) {
                        case 0:
-                               return strdup(ad->current_user_data->print_name);
+                               return replace(ad->current_user_data->print_name, '_', " ");
                        case 1:
                                return strdup(i18n_get_text("IDS_TGRAM_OPT_SET_BACKGROUND_IMAGE_ABB"));
                        default:
@@ -722,18 +722,19 @@ Evas_Object* _content_requested_cb(void *data, Evas_Object *obj, const char *par
                        if (ad->current_user_data->photo_path && strlen(ad->current_user_data->photo_path) > 0 && strstr(ad->current_user_data->photo_path, "_null_") == NULL) {
                                profile_pic = get_image_from_path(ad->current_user_data->photo_path, ad->nf);
                        } else  {
-                               profile_pic = get_image_from_path(ui_utils_get_resource(DEFAULT_PROFILE_PIC), ad->nf);
+                               profile_pic = get_image_from_path(ui_utils_get_resource(DEFAULT_LIST_THUMB_SINGLE_PIC), ad->nf);
+                               evas_object_color_set(profile_pic, 45, 165, 224, 255);
                        }
 
                        char edj_path[PATH_MAX] = {0, };
                        app_get_resource(TELEGRAM_INIT_VIEW_EDJ, edj_path, (int)PATH_MAX);
                        Evas_Object* user_pic_layout = elm_layout_add(ad->nf);
-                       elm_layout_file_set(user_pic_layout, edj_path, "circle_layout");
+                       elm_layout_file_set(user_pic_layout, edj_path, "search_circle_layout");
                        evas_object_size_hint_weight_set(user_pic_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
                        evas_object_size_hint_align_set(user_pic_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
                        evas_object_show(user_pic_layout);
                        elm_object_part_content_set(user_pic_layout, "content", profile_pic);
-                       evas_object_data_set(ad->nf, "user_profile_pic", profile_pic);
+                       evas_object_data_set(ad->nf, "settings_user_profile_pic", profile_pic);
 
                        eo = elm_layout_add(obj);
                        elm_layout_theme_set(eo, "layout", "list/B/type.1", "default");
@@ -802,6 +803,7 @@ static void ctxpopup_profile_select_cb(void *data, Evas_Object *obj, void *event
        }
 
        _ctxpopup_dismiss_cb(ad, NULL, NULL);
+       on_camera_button_clicked(ad, obj, event_info);
 
        /* please input here when set profile picture menu is clicked */
 }
@@ -917,7 +919,7 @@ void launch_settings_screen(appdata_s* ad)
        itc.func.state_get = NULL;
        itc.func.del = NULL;
 
-       elm_genlist_item_append(list, &itc, (void*) 0, NULL, ELM_GENLIST_ITEM_NONE, on_camera_button_clicked, (void*) 0);
+       elm_genlist_item_append(list, &itc, (void*) 0, NULL, ELM_GENLIST_ITEM_NONE, on_camera_button_clicked, (void*) ad);
        elm_genlist_item_append(list, &itc, (void*) 1, NULL, ELM_GENLIST_ITEM_NONE, on_settings_info_item_clicked, (void*)1);
 
        Elm_Object_Item* navi_item = elm_naviframe_item_push(ad->nf, i18n_get_text("IDS_TGRAM_OPT_SETTINGS"), NULL, NULL, list, NULL);
index 106453c..d07a50c 100644 (file)
@@ -1154,7 +1154,7 @@ static void ctxpopup_settings_select_cb(void *data, Evas_Object *obj, void *even
        }
 
        _ctxpopup_dismiss_cb(ad, NULL, NULL);
-
+       delete_floating_button(ad);
        launch_settings_screen(ad);
 }
 
index 22ae37a..484cb24 100644 (file)
@@ -53,6 +53,9 @@
 #define SEARCH_ICON FM_ICON_PATH"/search_icon.png"
 #define TG_ATTACH_ICON FM_ICON_PATH"/telegram_add_object.png"
 
+#define TG_EXPAND_OPEN       FM_ICON_PATH"telegram_icon_expand_close.png"
+#define TG_EXPAND_CLOSE       FM_ICON_PATH"telegram_icon_expand_open.png"
+
 //#define SMILEY_ICON_UNPRESSED FM_ICON_PATH"/ic_msg_panel_smiles_pressed.png"
 //#define SMILEY_ICON_PRESSED FM_ICON_PATH"/ic_msg_panel_smiles_unpressed.png"
 
 //#define TG_AUDIO_ICON       FM_ICON_PATH"Audio-Icon.png"
 #define TG_AUDIO_ICON       FM_ICON_PATH"Audio-wave.png"
 
+#define TG_PAUSE_DIM_ICON       FM_ICON_PATH"telegram_audio_player_pause_dim.png"
+#define TG_PAUSE_NORMAL_ICON       FM_ICON_PATH"telegram_audio_player_pause_normal.png"
+#define TG_PAUSE_PRESS_ICON       FM_ICON_PATH"telegram_audio_player_pause_press.png"
+
+#define TG_PLAY_DIM_ICON       FM_ICON_PATH"telegram_audio_player_play_dim.png"
+#define TG_PLAY_NORMAL_ICON       FM_ICON_PATH"telegram_audio_player_play_normal.png"
+#define TG_PLAY_PRESS_ICON       FM_ICON_PATH"telegram_audio_player_play_press.png"
+
 
 #define INIT_SCREEN_1       FM_ICON_PATH"screenshot_1.png"
 #define INIT_SCREEN_2       FM_ICON_PATH"screenshot_2.png"
@@ -561,7 +572,7 @@ typedef struct appdata {
        Elm_Theme *theme;
        int screen_mode_for_fb; // for floating button icon
        Evas_Object *menu_popup;
-       int msg_count;
+       //int msg_count;
 } appdata_s;
 
 extern void show_toast(appdata_s* ad, char* value);
index 8bc69db..bb08845 100644 (file)
@@ -270,4 +270,6 @@ void delete_media_from_unsent_db(int message_id);
 Eina_Bool is_user_present_peer_table(int id);
 Eina_Bool is_user_present_chat_table(int id);
 
+int update_current_date_to_table(char* tb_name, int recent_msg_date);
+
 #endif /* TG_DB_WRAPPER_H_ */
index d31942f..bdd6660 100644 (file)
@@ -690,7 +690,7 @@ void create_buddy_msg_table(const char* table_name)
        eina_list_free(col_types);
 }
 
-int insert_current_date_to_table(char* tb_name)
+int update_current_date_to_table(char* tb_name, int recent_msg_date)
 {
        struct tgl_message* last_msg = get_latest_message_from_message_table(tb_name);
        if (last_msg) {
@@ -707,6 +707,94 @@ int insert_current_date_to_table(char* tb_name)
                struct tm new_lt;
                (void) localtime_r(&new_t, &new_lt);
 
+               if (old_lt.tm_mday == new_lt.tm_mday && old_lt.tm_mon == new_lt.tm_mon && old_lt.tm_year == new_lt.tm_year) {
+                       // no need of new date
+                       return -1;
+               } else {
+                       int cur_time = time(NULL);
+                       time_t t = cur_time;
+
+                       char *format = NULL;
+                       format = "%a, %d%b. %Y";
+
+                       struct tm lt;
+                       char res[256];
+                       (void) localtime_r(&t, &lt);
+
+                       if (strftime(res, sizeof(res), format, &lt) == 0) {
+                               (void) fprintf(stderr,  "strftime(3): cannot format supplied "
+                                               "date/time into buffer of size %u "
+                                               "using: '%s'\n",
+                                               sizeof(res), format);
+                       }
+
+                       srand(time(NULL));
+                       int r = rand();
+                       struct tgl_message date_msg;
+                       date_msg.id = r;
+                       date_msg.media.type = tgl_message_media_none;
+                       date_msg.date = recent_msg_date - 1;
+                       date_msg.message = res;
+                       date_msg.message_len = strlen(res);
+                       date_msg.service = 2;
+                       date_msg.unread = 0;
+                       date_msg.out = 0;
+                       insert_msg_into_db(&date_msg, tb_name, t);
+                       return date_msg.id;
+               }
+
+       } else {
+               int cur_time = time(NULL);
+               time_t t = cur_time;
+
+               char *format = NULL;
+               format = "%a, %d%b. %Y";
+
+               struct tm lt;
+               char res[256];
+               (void) localtime_r(&t, &lt);
+
+               if (strftime(res, sizeof(res), format, &lt) == 0) {
+                       (void) fprintf(stderr,  "strftime(3): cannot format supplied "
+                                       "date/time into buffer of size %u "
+                                       "using: '%s'\n",
+                                       sizeof(res), format);
+               }
+               srand(time(NULL));
+               int r = rand();
+               struct tgl_message date_msg;
+               date_msg.id = r;
+               date_msg.media.type = tgl_message_media_none;
+               date_msg.date = recent_msg_date - 1;
+               date_msg.message = res;
+               date_msg.message_len = strlen(res);
+               date_msg.service = 2;
+               date_msg.unread = 0;
+               date_msg.out = 0;
+               insert_msg_into_db(&date_msg, tb_name, t);
+               return date_msg.id;
+       }
+       return -1;
+}
+
+
+
+int insert_current_date_to_table(char* tb_name)
+{
+       struct tgl_message* last_msg = get_latest_message_from_message_table(tb_name);
+       if (last_msg) {
+               int old_date = last_msg->date;
+               time_t old_t = old_date;
+
+               struct tm old_lt;
+               (void) localtime_r(&old_t, &old_lt);
+
+
+               int cur_time = time(NULL);
+               time_t new_t = cur_time;
+
+               struct tm new_lt;
+               (void) localtime_r(&new_t, &new_lt);
 
                if (old_lt.tm_mday == new_lt.tm_mday && old_lt.tm_mon == new_lt.tm_mon && old_lt.tm_year == new_lt.tm_year) {
                        // no need of new date
index f899101..806d852 100644 (file)
@@ -1438,7 +1438,7 @@ void tg_msg_receive(struct tgl_state *TLS, struct tgl_message *M)
                                        return;
                                }
 #endif
-                               int msg_id = insert_current_date_to_table(tb_name);
+                               int msg_id = update_current_date_to_table(tb_name, M->date);
                                free(tb_name);
                                if (msg_id > 0) {
                                        send_message_received_response(TLS->callback_data, M->from_id.id, M->to_id.id, msg_id, tgl_get_peer_type(M->to_id));
@@ -1446,7 +1446,7 @@ void tg_msg_receive(struct tgl_state *TLS, struct tgl_message *M)
                                        struct tg_temp_msg_data *msg_data = (struct tg_temp_msg_data*)malloc(sizeof(struct tg_temp_msg_data));
                                        msg_data->M = M;
                                        msg_data->TLS = TLS;
-                                       msg_data->send_timer = ecore_timer_add(3, on_msg_received_cb, msg_data);
+                                       msg_data->send_timer = ecore_timer_add(6, on_msg_received_cb, msg_data);
                                } else {
                                        if (M->media.type != tgl_message_media_none && (M->media.document.flags & FLAG_DOCUMENT_AUDIO)) {
                                                M->message = strdup("Audio");
@@ -1506,14 +1506,14 @@ void tg_msg_receive(struct tgl_state *TLS, struct tgl_message *M)
                                }
 
                                char* tb_name = get_table_name_from_number(user_id);
-                               int msg_id = insert_current_date_to_table(tb_name);
+                               int msg_id = update_current_date_to_table(tb_name, M->date);
                                free(tb_name);
                                if (msg_id > 0) {
                                        send_message_received_response(TLS->callback_data, M->from_id.id, M->to_id.id, msg_id, tgl_get_peer_type(M->to_id));
                                        struct tg_temp_msg_data *msg_data = (struct tg_temp_msg_data*)malloc(sizeof(struct tg_temp_msg_data));
                                        msg_data->M = M;
                                        msg_data->TLS = TLS;
-                                       msg_data->send_timer = ecore_timer_add(3, on_msg_received_cb, msg_data);
+                                       msg_data->send_timer = ecore_timer_add(6, on_msg_received_cb, msg_data);
                                } else {
                                        if (M->media.type != tgl_message_media_none && (M->media.document.flags & FLAG_DOCUMENT_AUDIO)) {
                                                M->message = strdup("Audio");