From aeed5b7cffd65d8aed0ce099008d1350be3764d4 Mon Sep 17 00:00:00 2001 From: Jagrat Patidar Date: Wed, 23 Sep 2020 16:21:45 +0530 Subject: [PATCH] This patch resolves following JIRAs- [TIZENIOT-1995] Makes the popup bg disappear. [TIZENIOT-1996] Makes popup to not disappear when pressing back button Change-Id: I3ab9a60d220d44d0903ea487b461c8360556fd62 Signed-off-by: Jagrat Patidar --- src/firmware-update-ui.c | 25 ++++--------------------- src/interaction.c | 31 +++++++++++++++++++++---------- tizen-manifest.xml | 2 +- 3 files changed, 26 insertions(+), 32 deletions(-) diff --git a/src/firmware-update-ui.c b/src/firmware-update-ui.c index 88b1061..8d7bbce 100755 --- a/src/firmware-update-ui.c +++ b/src/firmware-update-ui.c @@ -28,13 +28,15 @@ win_back_cb(void *data, Evas_Object *obj, void *event_info) appdata_s *ad = data; /* Let window go to hide state. */ elm_win_lower(ad->win); + } static void create_base_gui(appdata_s *ad) { - ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE); + ad->win = elm_win_add(NULL, PACKAGE, ELM_WIN_BASIC); elm_win_autodel_set(ad->win, EINA_TRUE); + elm_win_alpha_set(ad->win, EINA_TRUE); if (elm_win_wm_rotation_supported_get(ad->win)) { int rots[4] = {0, 90, 180, 270}; @@ -54,28 +56,9 @@ create_base_gui(appdata_s *ad) /* Naviframe */ ad->nf = elm_naviframe_add(ad->conform); evas_object_show(ad->nf); - // elm_naviframe_prev_btn_auto_pushed_set(ad->nf, EINA_TRUE); + // elm_naviframe_prev_btn_auto_pushed_set(ad->nf, EINA_TRUE); elm_object_content_set(ad->conform, ad->nf); - Evas_Object *bg; - char buf[PATH_MAX]; - char *res_path = app_get_resource_path(); - snprintf(buf, sizeof(buf), "%simages/FirmwareUpdate_BG.png", res_path); - LOGI("Bg Image path : %s", buf); - if(res_path) free(res_path); - - bg = elm_bg_add(ad->nf); - elm_bg_option_set(bg, ELM_BG_OPTION_CENTER); - elm_bg_file_set(bg, buf, NULL); - Elm_Object_Item *nf_it = elm_naviframe_item_push(ad->nf, NULL, NULL, NULL, bg, "tabbar/notitle"); - //elm_naviframe_item_pop_cb_set(nf_it, naviframe_pop_cb, ad->nf); - - Evas_Object * toolbar = elm_bg_add(ad->nf); - toolbar = elm_bg_add(ad->nf); - elm_bg_option_set(toolbar, ELM_BG_OPTION_STRETCH); - elm_bg_file_set(toolbar, buf, NULL); - elm_object_item_part_content_set(nf_it, "tabbar", toolbar); - evas_object_show(ad->win); } diff --git a/src/interaction.c b/src/interaction.c index 88c0e93..f2ca528 100755 --- a/src/interaction.c +++ b/src/interaction.c @@ -21,21 +21,16 @@ static char path[PATH_MAX]; static void _popup_block_clicked_cb(void *data, Evas_Object *obj, void *event_info) { - //elm_popup_dismiss(obj); - evas_object_del(obj); } static void _popup_hide_cb(void *data, Evas_Object *obj, void *event_info) { - //elm_popup_dismiss(obj); - evas_object_del(obj); } static void _popup_hide_finished_cb(void *data, Evas_Object *obj, void *event_info) { - evas_object_del(obj); } static void @@ -118,7 +113,8 @@ void fota_show_result_popup(Evas_Object *nf,fota_operation e_oper, bool status, LOGI("Inside fota_show_result_popup"); char title[PATH_MAX], text[PATH_MAX]; Evas_Object *popup = elm_popup_add(nf); - elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); + elm_object_style_set(popup, "transparent"); + elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 0.5); evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); if (e_oper == FOTA_OPERATION_DOWNLOAD ) { @@ -189,7 +185,8 @@ _install_update_cb(void *data, Evas_Object *obj, void *event_info) snprintf(title, sizeof(title), "Updating. Don't turn off your device"); Evas_Object *popup = elm_popup_add(nf); - elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); + elm_object_style_set(popup, "transparent"); + elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 0.5); evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_part_text_set(popup, "title,text", title); @@ -198,6 +195,10 @@ _install_update_cb(void *data, Evas_Object *obj, void *event_info) evas_object_smart_callback_add(popup, "block,clicked", _popup_block_clicked_cb, NULL); evas_object_show(popup); + Evas_Object *prev_popup = elm_object_item_data_get(obj); + if (prev_popup) { + evas_object_del(prev_popup); + } LOGI("Start Update"); /* Install update-image downloaded at shared location on device */ int ret = update_control_initialize(); @@ -252,6 +253,9 @@ _download_image_cb(void *data, Evas_Object *obj, void *event_info) { LOGI("Inside _download_image_cb"); Evas_Object *nf = data; + + Evas_Object *prev_popup = elm_object_item_data_get(obj); + LOGI("System Command : %s", download_cmd); /* Copy update-image from attached USB to shared location on device */ @@ -263,7 +267,9 @@ _download_image_cb(void *data, Evas_Object *obj, void *event_info) } else { fota_show_install_popup(nf, UPDATE_TITLE); } - + if (prev_popup) { + evas_object_del(prev_popup); + } elm_popup_dismiss(nf); } @@ -281,7 +287,8 @@ void fota_show_install_popup(Evas_Object *nf, char *title) LOGI("Inside fota_show_install_popup"); Evas_Object *popup = elm_popup_add(nf); - elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); + elm_object_style_set(popup, "transparent"); + elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 0.5); evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_part_text_set(popup, "title,text", title); elm_object_text_set(popup,buf); @@ -301,6 +308,7 @@ void fota_show_install_popup(Evas_Object *nf, char *title) Evas_Object *btn2 = elm_button_add(popup); elm_object_text_set(btn2, "Install"); elm_object_part_content_set(popup, "button2", btn2); + elm_object_item_data_set(btn2, popup); evas_object_smart_callback_add(btn2, "clicked", _install_update_cb, nf); evas_object_show(popup); } @@ -322,7 +330,8 @@ void fota_show_download_popup(Evas_Object *nf, char *title) LOGI("Inside fota_show_download_popup"); Evas_Object *popup = elm_popup_add(nf); - elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); + elm_object_style_set(popup, "transparent"); + elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 0.5); evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_part_text_set(popup, "title,text", title); elm_object_text_set(popup,buf); @@ -343,6 +352,8 @@ void fota_show_download_popup(Evas_Object *nf, char *title) //elm_object_style_set(btn2, "popup"); elm_object_text_set(btn2, "Download"); elm_object_part_content_set(popup, "button2", btn2); + + elm_object_item_data_set(btn2, popup); evas_object_smart_callback_add(btn2, "clicked", _download_image_cb, nf); evas_object_show(popup); diff --git a/tizen-manifest.xml b/tizen-manifest.xml index eb0b8e9..6acabc9 100755 --- a/tizen-manifest.xml +++ b/tizen-manifest.xml @@ -1,7 +1,7 @@ - + -- 2.34.1