diff options
author | amitpatel <amit.patel@samsung.com> | 2020-07-22 14:46:53 +0530 |
---|---|---|
committer | amitpatel <amit.patel@samsung.com> | 2020-07-22 14:46:53 +0530 |
commit | 2f0f7b9b5dcff4f4ae0bc1a69a8bc514c0d68200 (patch) | |
tree | fc4b2fec90dbaebc60fadb7d6a0579c832b198fa | |
parent | 9d2dcedbebb5a155892a0aab429fc07f8b7f3627 (diff) | |
download | video-player-2f0f7b9b5dcff4f4ae0bc1a69a8bc514c0d68200.tar.gz video-player-2f0f7b9b5dcff4f4ae0bc1a69a8bc514c0d68200.tar.bz2 video-player-2f0f7b9b5dcff4f4ae0bc1a69a8bc514c0d68200.zip |
popup notification for displaying messages.submit/tizen/20200727.115203submit/tizen/20200725.111737
Change-Id: I207ed932304c28b9f306684a3725b03a00e6be9c
Signed-off-by: amitpatel <amit.patel@samsung.com>
-rwxr-xr-x | playview/src/common/include/vp-play-util.h | 1 | ||||
-rwxr-xr-x | playview/src/common/vp-play-util.c | 46 | ||||
-rwxr-xr-x | playview/src/view/vp-play-normal-view.c | 21 |
3 files changed, 59 insertions, 9 deletions
diff --git a/playview/src/common/include/vp-play-util.h b/playview/src/common/include/vp-play-util.h index 02d4dac..71d9e48 100755 --- a/playview/src/common/include/vp-play-util.h +++ b/playview/src/common/include/vp-play-util.h @@ -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); diff --git a/playview/src/common/vp-play-util.c b/playview/src/common/vp-play-util.c index 077a3f0..035518a 100755 --- a/playview/src/common/vp-play-util.c +++ b/playview/src/common/vp-play-util.c @@ -473,6 +473,52 @@ bool vp_play_util_status_noti_show(const char *szStr) /** * + * @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 * @return */ diff --git a/playview/src/view/vp-play-normal-view.c b/playview/src/view/vp-play-normal-view.c index 6eb5fa3..f09f185 100755 --- a/playview/src/view/vp-play-normal-view.c +++ b/playview/src/view/vp-play-normal-view.c @@ -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); + } /** |