popup notification for displaying messages. 74/239174/1 submit/tizen/20200725.111737 submit/tizen/20200727.115203
authoramitpatel <amit.patel@samsung.com>
Wed, 22 Jul 2020 09:16:53 +0000 (14:46 +0530)
committeramitpatel <amit.patel@samsung.com>
Wed, 22 Jul 2020 09:16:53 +0000 (14:46 +0530)
Change-Id: I207ed932304c28b9f306684a3725b03a00e6be9c
Signed-off-by: amitpatel <amit.patel@samsung.com>
playview/src/common/include/vp-play-util.h
playview/src/common/vp-play-util.c
playview/src/view/vp-play-normal-view.c

index 02d4dac1b8b33687b066deb8726ea38ee1aff86e..71d9e488cc45b197259bf192fc990b10da228568 100755 (executable)
@@ -32,6 +32,7 @@ bool vp_play_util_get_subtitle_path(const char *szMediaURL,
                                                                        char **szSubtitle);
 double vp_play_util_get_sys_time(void);
 bool vp_play_util_status_noti_show(const char *szStr);
+bool vp_play_util_popup_toast_show(Evas_Object * pParent, const char *text);
 char *vp_play_util_remove_prefix_to_url(char *szURL);
 void vp_play_util_convert_file_size(long long lSize, char **szSize);
 void vp_play_util_get_convert_time(double dtime, char **szFileDate);
index 077a3f0f1cde9fb0da7ad158b533338dc94c7313..035518afe63fcfc862f62930b6f73df5c865b545 100755 (executable)
@@ -471,6 +471,52 @@ bool vp_play_util_status_noti_show(const char *szStr)
        return TRUE;
 }
 
+/**
+ *
+ * @param pUserData
+ * @param pObject
+ * @param event_info
+ */
+void vp_play_util_popup_toast_cb(void *pUserData,
+                                                                       Evas_Object * pObject,
+                                                                       void *event_info)
+{
+       evas_object_del(pObject);
+}
+
+/**
+ *
+ * @param parent
+ * @param text
+ * @return
+ */
+bool vp_play_util_popup_toast_show(Evas_Object * pParent, const char *text)
+{
+       if (!pParent) {
+               return false;
+       }
+
+       Evas_Object *popup = NULL;
+
+       popup = elm_popup_add(pParent);
+       elm_object_style_set(popup, "toast");
+
+       if (text) {
+               elm_object_text_set(popup, text);
+       }
+
+       elm_popup_align_set(popup, 0.5,  0.73);
+
+       evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, 
+                                                   EVAS_HINT_EXPAND);
+       elm_popup_timeout_set(popup, 2.0);
+
+       evas_object_smart_callback_add(popup, "timeout",
+                                                                  vp_play_util_popup_toast_cb, NULL);
+
+       evas_object_show(popup);
+       return true;
+}
 /**
  *
  * @param szURL
index 6eb5fa396df33bdbada093469eefb36a940575f8..f09f185c0b6fac5b57f381a9bfa077416242e071 100755 (executable)
@@ -2910,10 +2910,8 @@ static Evas_Event_Flags __vp_normal_gesture_double_click_end_cb(void
                                pNormalView->bSpeedDown = TRUE;
 
                                if (_vp_is_current_focus_available() != 0) {
-                                       VideoLogInfo
-                                               ("Cannot acquire focus. Setting video to pause state");
-                                       vp_play_util_status_noti_show
-                                               (VP_PLAY_STRING_UNABLE_TO_PLAY);
+                                       VideoLogInfo("Cannot acquire focus. Setting video to pause state");
+                                       vp_play_util_popup_toast_show(pPlayView->pWin, VP_PLAY_STRING_UNABLE_TO_PLAY);
                                        pNormalView->bManualPause = TRUE;
                                }
 
@@ -5299,8 +5297,7 @@ static void __vp_normal_ctx_popup_audio_only_cb(void *pUserData,
        } else {
                pNormalView->bAudioOnly = TRUE;
                pPlayView->bAudioOnly = TRUE;
-               vp_play_util_status_noti_show
-                       (VP_PLAY_STRING_AUDIO_ONLY_PLAYBACK_MSG);
+               vp_play_util_popup_toast_show(pPlayView->pWin, VP_PLAY_STRING_AUDIO_ONLY_PLAYBACK_MSG);
 
                if (!pPlayView->win_minicon) {
                        vp_minicontroller_create(pPlayView);
@@ -7429,7 +7426,7 @@ static Eina_Bool __vp_normal_naviframe_pop_cb(void *pUserData,
                                return EINA_TRUE;
                        }
 
-                       vp_play_util_status_noti_show(VP_PLAY_STRING_COM_WAIT_BACK);
+                       vp_play_util_popup_toast_show(pPlayView->pWin, VP_PLAY_STRING_COM_WAIT_BACK);
 
                        pNormalView->pExitWaitTimer =
                                ecore_timer_add(VP_NORMAL_EXIT_WAIT_TIMER_INTERVAL,
@@ -7741,8 +7738,14 @@ static void _vp_play_normal_view_show_video_only_popup(NormalView *
        VideoLogInfo
                ("Show toast popup: Only video data supported by this file. Now playing video.");
        _vp_normal_set_audio_only_image(pNormalView, FALSE);
-       vp_play_util_status_noti_show
-               (VP_PLAY_STRING_ERROR_ONLY_VIDEO_DATA_SUPPORTED);
+
+       PlayView * pPlayView = pNormalView->pPlayView;
+       if (!pPlayView) {
+               VideoLogError("pPlayView is NULL");
+               return;
+       }
+       vp_play_util_popup_toast_show(pPlayView->pWin, VP_PLAY_STRING_ERROR_ONLY_VIDEO_DATA_SUPPORTED);
+
 }
 
 /**