This patch resolves following JIRAs- 13/244713/2 submit/tizen/20200923.115427
authorJagrat Patidar <j1.patidar@samsung.com>
Wed, 23 Sep 2020 10:51:45 +0000 (16:21 +0530)
committerJagrat Patidar <j1.patidar@samsung.com>
Wed, 23 Sep 2020 11:05:18 +0000 (16:35 +0530)
[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 <j1.patidar@samsung.com>
src/firmware-update-ui.c
src/interaction.c
tizen-manifest.xml

index 88b10613dc22d760bf50703e0f69414262301f7f..8d7bbce32b8ec2b4b12d44044da7336daa58c9be 100755 (executable)
@@ -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);
 }
 
index 88c0e934e0b36dd5098ad48c80e0a16467e523bc..f2ca5280f44514048b35c8c5a864dc7b61668756 100755 (executable)
@@ -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);
index eb0b8e9a848556aab203a4f031603b98f6873587..6acabc993d0c1e781ebbef383f504a1fc786d85e 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <manifest xmlns="http://tizen.org/ns/packages" api-version="5.5" package="org.tizen.firmware-update-ui" version="1.0.0">
     <profile name="tizeniot"/>
-    <ui-application appid="org.tizen.firmware-update-ui" exec="firmware-update-ui" launch_mode="single" multiple="false" nodisplay="false" taskmanage="true" type="capp">
+    <ui-application appid="org.tizen.firmware-update-ui" exec="firmware-update-ui" launch_mode="single" multiple="false" nodisplay="false" taskmanage="false" type="capp">
         <label>firmware-update-ui</label>
         <metadata key="tizen-fota-manager" value="client"/>
     </ui-application>