[TIZEN_3.0] merging code from tizen 2.4 branch 55/88155/3
authorRahul Dadhich <r.dadhich@samsung.com>
Wed, 14 Sep 2016 04:57:10 +0000 (10:27 +0530)
committerRahul Dadhich <r.dadhich@samsung.com>
Wed, 14 Sep 2016 06:29:14 +0000 (11:59 +0530)
Change-Id: I40a5994408f2507decd9058c59d492602ebf03e8
Signed-off-by: Rahul Dadhich <r.dadhich@samsung.com>
CMakeLists.txt
include/ge-albums.h
include/ge-data-type.h
include/ge-ugdata.h
res/black_theme/edc/attach-panel-gallery.edc
res/black_theme/images/Contents_broken_351X261.png
res/black_theme/images/No_thumbnail_351X261.png
res/black_theme/images/T01_album_icon_sd_card.png [changed mode: 0755->0644]
src/gallery-efl.c
src/view/ge-albums.c

index 872d8da..80a677b 100644 (file)
@@ -85,6 +85,7 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-ldl")
 # EDJ
 ADD_CUSTOM_COMMAND(OUTPUT attach-panel-gallery.edj
                 COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/res/${GE_IMG_DIR}
+                               -id  ${CMAKE_CURRENT_SOURCE_DIR}/res/${GE_IMG_C_DIR}
                                -sd  ${CMAKE_CURRENT_SOURCE_DIR}/res/${GE_SOUND_DIR}
                 ${CMAKE_CURRENT_SOURCE_DIR}/res/${GE_EDC_DIR}/attach-panel-gallery.edc
                                ${CMAKE_BINARY_DIR}/attach-panel-gallery.edj
index 822b87e..d472ae6 100644 (file)
@@ -24,6 +24,7 @@ int ge_update_gengrid(ge_ugdata *ugd);
 int ge_create_gengrid(ge_ugdata *ugd);
 int _ge_albums_update_view(ge_ugdata *ugd);
 Evas_Object* __ge_add_albums_split_view(ge_ugdata *ugd, Evas_Object *parent);
+void __ge_grid_reset_view(ge_ugdata *ugd);
 
 #endif /* _GE_ALBUMS_H_ */
 
index fdb1a79..1e0f950 100644 (file)
                } \
        } while (0)
 
+#define GE_GENGRID_ITC_FREE(x) \
+               do { \
+                       if (x) { \
+                               x->item_style = NULL; \
+                               x->func.text_get = NULL; \
+                               x->func.content_get = NULL; \
+                               x->func.state_get = NULL; \
+                               x->func.del = NULL; \
+                               elm_genlist_item_class_free(x); \
+                       } \
+               } while(0)
+
 #define GE_GFREE(ptr) \
        do { \
                g_free(ptr); \
index 5fc17f8..39b91b7 100644 (file)
@@ -37,6 +37,10 @@ extern "C" {
 #define FULL_MODE_PORTRAIT_HEIGHT 1036
 #define LANDSCAPE_HEIGHT 528
 
+#define HALF_MODE_PORTRAIT_HEIGHT_WVGA 265
+#define FULL_MODE_PORTRAIT_HEIGHT_WVGA 632
+#define LANDSCAPE_HEIGHT_WVGA 345
+
 
 /*Image viewer UG service parameters-End*/
 
@@ -235,6 +239,8 @@ struct _ge_ugdata {
        Ecore_Event_Handler *key_down_handler;
        long long int selsize;
        long long int limitsize;
+       bool ug_launched;
+       app_control_h gallery_handle;
 };
 
 struct _ge_thumbs_t {
@@ -245,6 +251,8 @@ struct _ge_thumbs_t {
        Evas_Object *layout;
        Evas_Object *split_view;
        Elm_Gengrid_Item_Class *gic;
+       Elm_Gengrid_Item_Class *gic_first;
+       Elm_Gengrid_Item_Class *no_content;
        Elm_Object_Item *nf_it;
        Elm_Object_Item *done_it;
 
@@ -265,6 +273,8 @@ struct _ge_thumbs_t {
        ge_cluster *album;
        bool b_editmode;
        Evas_Object *gengrid;
+       Eina_List *check_list;
+       Eina_List *image_layout_list;
 };
 
 #ifdef __cplusplus
index 5631d0f..afdf4d6 100644 (file)
@@ -437,6 +437,9 @@ group {
 group {
                name: "elm/gengrid/item/gengrid_items/default";
                data.item: "contents" "content_swallow checkbox_swallow sd_card_icon";
+               images {
+                       image: No_thumbnail_351X261.png COMP;
+               }
                parts {
                        part {
                                name: "background";
@@ -450,6 +453,46 @@ group {
                                }
                        }
                        part {
+                               name: "bg";
+                               type: RECT;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to: "background"; offset: 2 2; }
+                                       rel2 { relative: 1.0 1.0; to: "background"; offset: -2 -2; }
+                                       color: 200 200 200 255;
+                               }
+                       }
+                       part {
+                               name: "default_image";
+                               type: IMAGE;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 {
+                                               relative: 0 0;
+                                               to: background;
+                                       }
+                                       rel2 {
+                                               relative: 1 1;
+                                               to: background;
+                                       }
+                                       image.normal: No_thumbnail_351X261.png;
+                               }
+                               description {
+                                       state: "hidden" 0.0;
+                                       rel1 {
+                                               relative: 0 0;
+                                               to: background;
+                                       }
+                                       rel2 {
+                                               relative: 1 1;
+                                               to: background;
+                                       }
+                                       visible: 0;
+                                       image.normal: No_thumbnail_351X261.png;
+                               }
+                       }
+                       part {
                                name: "content_swallow";
                                type: SWALLOW;
                                mouse_events: 1;
@@ -463,7 +506,8 @@ group {
                        part {
                                name: "checkbox_swallow";
                                type: SWALLOW;
-                               mouse_events: 1;
+                               mouse_events: 0;
+                               repeat_events: 1;
                                scale: 1;
                                description {
                                        state: "default" 0.0;
@@ -514,6 +558,20 @@ group {
                                transition: DECELERATE 0.2;
                                action: RUN_PLUGIN "touch_sound_plugin";
                        }
+                       program {
+                               name: "hide_default";
+                               source: "elm";
+                               signal: "hide_default_image";
+                               action: STATE_SET "hidden" 0.0;
+                               target: "default_image";
+                       }
+                       program {
+                               name: "show_default";
+                               source: "elm";
+                               signal: "show_default_image";
+                               action: STATE_SET "default" 0.0;
+                               target: "default_image";
+                       }
                }
        }
 
index 033ce0f..555f35a 100644 (file)
Binary files a/res/black_theme/images/Contents_broken_351X261.png and b/res/black_theme/images/Contents_broken_351X261.png differ
index f16aaf2..d9c343e 100644 (file)
Binary files a/res/black_theme/images/No_thumbnail_351X261.png and b/res/black_theme/images/No_thumbnail_351X261.png differ
old mode 100755 (executable)
new mode 100644 (file)
index f0803db..a0fed68
Binary files a/res/black_theme/images/T01_album_icon_sd_card.png and b/res/black_theme/images/T01_album_icon_sd_card.png differ
index 62cc9a3..c786136 100644 (file)
@@ -183,6 +183,59 @@ static int _ge_create_view(ge_ugdata *ugd)
        return 0;
 }
 
+void _ge_free_sel_info(ge_ugdata *ugd)
+{
+       ge_dbg("Deleting selected media data");
+       GE_CHECK(ugd);
+       Eina_List *l = NULL;
+       ge_sel_item_s *sit = NULL;
+
+       EINA_LIST_FOREACH(ugd->selected_elist, l, sit) {
+               _ge_data_util_free_sel_item(sit);
+       }
+       ugd->selected_elist = NULL;
+       ge_dbg("Deleting selected media data done");
+}
+
+void _ge_free_medias(ge_ugdata *ugd)
+{
+       ge_dbg("Deleting media data");
+       GE_CHECK(ugd);
+       GE_CHECK(ugd->thumbs_d);
+       if (ugd->thumbs_d->medias_elist) {
+               ge_dbg("Deleting media list");
+               _ge_data_util_free_mtype_items(&ugd->thumbs_d->medias_elist);
+       }
+       ge_dbg("Deleting media data done");
+}
+
+void _ge_free_thumb_data(ge_ugdata *ugd)
+{
+       ge_dbg("Deleting thumb data");
+       GE_CHECK(ugd);
+       GE_CHECK(ugd->thumbs_d);
+
+       GE_IF_DEL_IDLER(ugd->thumbs_d->append_idler);
+       GE_FREEIF(ugd->thumbs_d->album_uuid);
+
+       if (ugd->thumbs_d->check_list) {
+               ugd->thumbs_d->check_list = NULL;
+       }
+
+       if (ugd->thumbs_d->image_layout_list) {
+               ugd->thumbs_d->image_layout_list = NULL;
+       }
+
+       GE_GENGRID_ITC_FREE(ugd->thumbs_d->gic);
+       GE_GENGRID_ITC_FREE(ugd->thumbs_d->gic_first);
+       GE_GENGRID_ITC_FREE(ugd->thumbs_d->no_content);
+
+       GE_FREEIF(ugd->thumbs_d);
+
+       ge_dbg("Deleting thumb data done");
+
+}
+
 static int _ge_close_view(ge_ugdata *ugd)
 {
        GE_CHECK_VAL(ugd, -1);
@@ -225,6 +278,14 @@ static int _ge_close_view(ge_ugdata *ugd)
        _ge_db_update_finalize(ugd);
        /* Disconnet with libmedia-info */
        _ge_data_finalize(ugd);
+       if (ugd->gallery_handle) {
+               app_control_send_terminate_request(ugd->gallery_handle);
+               app_control_destroy(ugd->gallery_handle);
+               ugd->gallery_handle = NULL;
+       }
+       _ge_free_sel_info(ugd);
+       _ge_free_medias(ugd);
+       _ge_free_thumb_data(ugd);
        return 0;
 }
 
@@ -273,7 +334,7 @@ static int __ge_parse_param_file(ge_ugdata *ugd, app_control_h service)
                } else {
                        ugd->file_type_mode = GE_FILE_T_ALL;
                }
-
+               GE_FREE(mime);
                return 0;
        }
 
@@ -294,7 +355,7 @@ static int __ge_parse_param_file(ge_ugdata *ugd, app_control_h service)
                GE_FREE(file_type);
                return 0;
        }
-
+       GE_FREEIF(file_type);
 
 GE_DEFAULT_FILE_TYPE:
 
@@ -348,6 +409,7 @@ static int _ge_parse_param(ge_ugdata *ugd, app_control_h service)
        char *launch_type = NULL;
        char *select_mode = NULL;
        char *operation = NULL;
+       ugd->gallery_handle = NULL;
 
        app_control_get_operation(service, &operation);
        ge_sdbg("operation [%s]", operation);
@@ -556,7 +618,7 @@ static void * _ge_create(ui_gadget_h ug, enum ug_mode mode, app_control_h servic
        } else {
                ugd->is_attach_panel = false;
        }
-
+       GE_FREEIF(contact_id);
        if (ugd->overlap_mode) {
                ugd->b_hide_indicator = true;
        } else if (ugd->b_hide_indicator) {
@@ -600,6 +662,12 @@ static void _ge_start(ui_gadget_h ug, app_control_h service, void *priv)
 static void _ge_pause(ui_gadget_h ug, app_control_h service, void *priv)
 {
        ge_dbg("");
+       GE_CHECK(priv);
+       ge_ugdata *ugd = (ge_ugdata *)priv;
+       if (ugd->ug_launched) {
+               __ge_grid_reset_view(ugd);
+               ugd->ug_launched = false;
+       }
 }
 
 /**
@@ -612,14 +680,6 @@ static void _ge_pause(ui_gadget_h ug, app_control_h service, void *priv)
 static void _ge_resume(ui_gadget_h ug, app_control_h service, void *priv)
 {
        ge_dbg("");
-       GE_CHECK(priv);
-       ge_ugdata *ugd = (ge_ugdata *)priv;
-       /*update*/
-
-       if (ugd->ug_called_by_me == NULL &&
-               ugd->file_select_mode != GE_FILE_SELECT_T_SLIDESHOW) {
-               ge_update_view(ugd, GE_UPDATE_NONE);
-       }
 }
 
 /**
@@ -667,6 +727,14 @@ static void _ge_message(ui_gadget_h ug, app_control_h msg, app_control_h service
                app_control_get_extra_data(msg, APP_CONTROL_DATA_SELECTION_MODE, &display_mode);
                app_control_get_extra_data(msg, "__ATTACH_PANEL_INITIALIZE__", &initialized_mode);
 
+               char *max_cnt = NULL;
+               app_control_get_extra_data(msg, APP_CONTROL_DATA_TOTAL_COUNT, &max_cnt);
+               if (max_cnt) {
+                       ugd->max_count = _ge_atoi(max_cnt);
+                       GE_FREE(max_cnt);
+               }
+               ge_sdbg("max count: %d", ugd->max_count);
+
                if (display_mode) {
                        if (!strcmp(display_mode, "single")) {
                                //change to single selection
@@ -691,9 +759,7 @@ static void _ge_message(ui_gadget_h ug, app_control_h msg, app_control_h service
                                        }
                                }
 
-                               if (ugd->selected_elist) {
-                                       ugd->selected_elist = eina_list_free(ugd->selected_elist);
-                               }
+                               _ge_free_sel_info(ugd);
 
                                ugd->thumbs_d->tot_selected = 0;
                                elm_naviframe_item_title_enabled_set(ugd->nf_it, EINA_FALSE, EINA_FALSE);
@@ -701,10 +767,19 @@ static void _ge_message(ui_gadget_h ug, app_control_h msg, app_control_h service
                                //change to multi selection
                                ge_dbg("multiple_selection");
                                if (ugd->nocontents) {
+                                       double scale = elm_config_scale_get();
                                        if (ugd->rotate_mode == GE_ROTATE_LANDSCAPE_UPSIDEDOWN || ugd->rotate_mode == GE_ROTATE_LANDSCAPE) {
-                                               elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_h, LANDSCAPE_HEIGHT);
+                                               if ((scale - 1.8) < 0.0001) {
+                                                       elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_h, LANDSCAPE_HEIGHT_WVGA);
+                                               } else {
+                                                       elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_h, LANDSCAPE_HEIGHT);
+                                               }
                                        } else {
-                                               elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, FULL_MODE_PORTRAIT_HEIGHT);
+                                               if ((scale - 1.8) < 0.0001) {
+                                                       elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, FULL_MODE_PORTRAIT_HEIGHT_WVGA);
+                                               } else {
+                                                       elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, FULL_MODE_PORTRAIT_HEIGHT);
+                                               }
                                        }
                                }
                                ugd->attach_panel_display_mode = ATTACH_PANEL_FULL_MODE;
@@ -722,6 +797,8 @@ static void _ge_message(ui_gadget_h ug, app_control_h msg, app_control_h service
                                text = g_strdup_printf(pd_selected, ugd->thumbs_d->tot_selected);
                                elm_object_item_text_set(ugd->nf_it, text);
 
+                               GE_FREEIF(text);
+
                                /*Disable DONE Button if count is zero */
                                if (!ugd->thumbs_d->tot_selected) {
                                        btn = elm_object_item_part_content_get(ugd->nf_it , GE_NAVIFRAME_TITLE_RIGHT_BTN);
@@ -744,6 +821,8 @@ static void _ge_message(ui_gadget_h ug, app_control_h msg, app_control_h service
                                elm_gengrid_realized_items_update(ugd->albums_view);
                        }
                }
+               GE_FREEIF(display_mode);
+               GE_FREEIF(initialized_mode);
        }
 }
 
@@ -816,16 +895,30 @@ UG_ROTATE_EVENT:
 
        if (ugd->rotate_mode == GE_ROTATE_LANDSCAPE_UPSIDEDOWN || ugd->rotate_mode == GE_ROTATE_LANDSCAPE) {
                if (ugd->nocontents) {
-                       elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_h, LANDSCAPE_HEIGHT);
+                       double scale = elm_config_scale_get();
+                       if ((scale - 1.8) < 0.0001) {
+                               elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_h, LANDSCAPE_HEIGHT_WVGA);
+                       } else {
+                               elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_h, LANDSCAPE_HEIGHT);
+                       }
                } else {
                        elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, landscape_size, landscape_size);
                }
        } else {
                if (ugd->nocontents) {
+                       double scale = elm_config_scale_get();
                        if (ugd->attach_panel_display_mode == ATTACH_PANEL_FULL_MODE) {
-                               elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, FULL_MODE_PORTRAIT_HEIGHT);
+                               if ((scale - 1.8) < 0.0001) {
+                                       elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, FULL_MODE_PORTRAIT_HEIGHT_WVGA);
+                               } else {
+                                       elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, FULL_MODE_PORTRAIT_HEIGHT);
+                               }
                        } else {
-                               elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, HALF_MODE_PORTRAIT_HEIGHT);
+                               if ((scale - 1.8) < 0.0001) {
+                                       elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, HALF_MODE_PORTRAIT_HEIGHT_WVGA);
+                               } else {
+                                       elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, HALF_MODE_PORTRAIT_HEIGHT);
+                               }
                        }
                } else {
                        elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, size, size);
index 0ebd9fb..b0e0798 100644 (file)
 #include "ge-nocontent.h"
 #include <notification.h>
 
-static Elm_Gengrid_Item_Class *gic_first = NULL;
-static Elm_Gengrid_Item_Class *no_content = NULL;
-
-
 #define DEFAULT_THUMBNAIL "/opt/usr/share/media/.thumb/thumb_default.png"
 
 /* Only for local medias */
@@ -893,16 +889,16 @@ Evas_Object *ge_thumb_show_part_icon_image(Evas_Object *obj, char *path,
        Evas_Object *layout = elm_layout_add(obj);
        GE_CHECK_NULL(layout);
 
-       Evas_Object *bg = elm_bg_add(layout);
+       Evas_Object *bg = elm_image_add(layout);
        if (bg == NULL) {
                evas_object_del(layout);
                return NULL;
        }
 
-       elm_bg_file_set(bg, path, NULL);
-       elm_bg_load_size_set(bg, item_w, item_h);
+       elm_image_file_set(bg, path, NULL);
+       elm_image_preload_disabled_set(bg, EINA_FALSE);
+       elm_image_fill_outside_set(bg, EINA_TRUE);
        evas_object_size_hint_max_set(bg, item_w, item_h);
-       evas_object_size_hint_aspect_set(bg, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
        evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
 
@@ -929,6 +925,7 @@ __ge_grid_done_cb(void *data, Evas_Object *obj, void *ei)
        int i = 0;
 
        _ge_data_get_sel_paths(ugd, &paths, &path_array, &sel_cnt);
+       _ge_free_sel_info(ugd);
        if (sel_cnt <= 0) {
                ge_dbgE("Invalid selected path count!");
                goto GE_SEND_RESULT_FINISHED;
@@ -1061,6 +1058,7 @@ __ge_check_state_changed_cb(void *data, Evas_Object *obj, void *ei)
        if (ugd->thumbs_d->tot_selected >= 0) {
                text = g_strdup_printf(pd_selected, ugd->thumbs_d->tot_selected);
                elm_object_item_text_set(ugd->nf_it, text);
+               GE_FREEIF(text);
        }
 }
 
@@ -1125,9 +1123,18 @@ __ge_gengrid_item_content_get(void *data, Evas_Object *obj, const char *part)
                }
 
                if (gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE) {
-                       layout = ge_thumb_show_part_icon_image(obj, path,
-                                                              ugd->thumbs_d->icon_w,
-                                                              ugd->thumbs_d->icon_h);
+                       if (ugd->thumbs_d->image_layout_list) {
+                               Evas_Object *bg = NULL;
+                               layout = eina_list_data_get(ugd->thumbs_d->image_layout_list);
+                               GE_CHECK_NULL(layout);
+                               ugd->thumbs_d->image_layout_list = eina_list_remove(ugd->thumbs_d->image_layout_list, layout);
+                               bg = elm_object_part_content_get(layout, "elm.swallow.icon");
+                               elm_image_file_set(bg, path, NULL);
+                       } else {
+                               layout = ge_thumb_show_part_icon_image(obj, path,
+                                               ugd->thumbs_d->icon_w,
+                                               ugd->thumbs_d->icon_h);
+                       }
                }
 
 
@@ -1135,15 +1142,21 @@ __ge_gengrid_item_content_get(void *data, Evas_Object *obj, const char *part)
 
        } else if (!g_strcmp0(part, "checkbox_swallow") && ugd->thumbs_d->b_editmode == true) {
                Evas_Object* ck = NULL;
-               ck = elm_check_add(obj);
-               GE_CHECK_NULL(ck);
+               if (ugd->thumbs_d->check_list) {
+                       ck = eina_list_data_get(ugd->thumbs_d->check_list);
+                       GE_CHECK_NULL(ck);
+                       ugd->thumbs_d->check_list = eina_list_remove(ugd->thumbs_d->check_list, ck);
 
+               } else {
+                       ck = elm_check_add(obj);
+                       GE_CHECK_NULL(ck);
+               }
                evas_object_propagate_events_set(ck, EINA_FALSE);
                evas_object_repeat_events_set(ck, EINA_FALSE);
                elm_check_state_set(ck, gitem->checked);
                ugd->thumbs_d->check = ck;
                evas_object_smart_callback_add(ck, "changed",
-                                              __ge_check_state_changed_cb, gitem);
+                               __ge_check_state_changed_cb, gitem);
                evas_object_show(ck);
 
                return ck;
@@ -1206,6 +1219,43 @@ __ge_gallery_ug_result_cb(app_control_h request, app_control_h reply, app_contro
        }
 }
 
+void
+__ge_grid_reset_view(ge_ugdata *ugd)
+{
+       ge_dbg("");
+       if (ugd->thumbs_d->tot_selected == 0) {
+               return;
+       }
+       ge_item* gitem = NULL;
+       char *pd_selected = GE_STR_PD_SELECTED;
+       int i;
+       ugd->selected_elist = eina_list_free(ugd->selected_elist);
+       for (i = 0; i < ugd->thumbs_d->medias_cnt; i++) {
+               gitem = eina_list_nth(ugd->thumbs_d->medias_elist, i);
+               if (gitem == NULL || gitem->item == NULL ||
+                               gitem->item->uuid == NULL) {
+                       ge_dbgE("Invalid gitem!");
+                       continue;
+               }
+               gitem->checked = false;
+               elm_gengrid_item_update(gitem->elm_item);
+       }
+       ugd->thumbs_d->tot_selected = 0;
+       char *text = g_strdup_printf(pd_selected, ugd->thumbs_d->tot_selected);
+       elm_object_item_text_set(ugd->nf_it, text);
+       GE_FREEIF(text);
+       Evas_Object *btn = NULL;
+       btn = elm_object_item_part_content_get(ugd->nf_it , GE_NAVIFRAME_TITLE_RIGHT_BTN);
+       if (btn == NULL) {
+               ge_dbgE("Failed to get part information");
+       }
+
+       if (ugd->thumbs_d->tot_selected == 0) {
+               elm_object_disabled_set(btn, EINA_TRUE);
+       }
+}
+
+
 static void
 __ge_launch_ug_gallery(void *data, Evas_Object *obj, void *ei)
 {
@@ -1227,12 +1277,12 @@ __ge_launch_ug_gallery(void *data, Evas_Object *obj, void *ei)
                app_control_add_extra_data(svc_handle, APP_CONTROL_DATA_TOTAL_COUNT, maximum_count);
                app_control_add_extra_data(svc_handle, "launch-type", "select-multiple");
                app_control_add_extra_data(svc_handle, "file-type", "image");
-               app_control_add_extra_data(svc_handle, "hide-personal", "true");
-               app_control_send_launch_request(svc_handle, __ge_gallery_ug_result_cb, data);
-               int ret = app_control_destroy(svc_handle);
+               int ret = app_control_send_launch_request(svc_handle, __ge_gallery_ug_result_cb, data);
+               ugd->gallery_handle = svc_handle;
 
                if (ret == 0) {
                        ge_dbg("Launched ug-gallery-efl successfully.");
+                       ugd->ug_launched = true;
                } else {
                        ge_dbgE("Launching ug-gallery-efl Failed.");
                }
@@ -1401,6 +1451,7 @@ __ge_gengrid_item_sel_cb(void *data, Evas_Object *obj, void *ei)
                if (gitem->ugd->thumbs_d->tot_selected >= 0) {
                        text = g_strdup_printf(pd_selected, gitem->ugd->thumbs_d->tot_selected);
                        elm_object_item_text_set(gitem->ugd->nf_it, text);
+                       GE_FREEIF(text);
                }
        }
 }
@@ -1522,7 +1573,7 @@ ge_update_gengrid(ge_ugdata *ugd)
                }
                elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, size, size);
                elm_gengrid_item_append(ugd->thumbs_d->gengrid,
-                                       gic_first,
+                                                               ugd->thumbs_d->gic_first,
                                        NULL, __ge_launch_ug_gallery,
                                        ugd);
 
@@ -1563,15 +1614,24 @@ ge_update_gengrid(ge_ugdata *ugd)
                        gitem->sequence = item_cnt + 1;
                }
        } else {
+               double scale = elm_config_scale_get();
                if (ugd->attach_panel_display_mode == ATTACH_PANEL_FULL_MODE) {
-                       elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, FULL_MODE_PORTRAIT_HEIGHT);
+                       if ((scale - 1.8) < 0.0001) {
+                               elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, FULL_MODE_PORTRAIT_HEIGHT_WVGA);
+                       } else {
+                               elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, FULL_MODE_PORTRAIT_HEIGHT);
+                       }
                } else {
-                       elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, HALF_MODE_PORTRAIT_HEIGHT);
+                       if ((scale - 1.8) < 0.0001) {
+                               elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, HALF_MODE_PORTRAIT_HEIGHT_WVGA);
+                       } else {
+                               elm_gengrid_item_size_set(ugd->thumbs_d->gengrid, win_w, HALF_MODE_PORTRAIT_HEIGHT);
+                       }
                }
 
                ugd->nocontents = _ge_nocontents_create(ugd);
                elm_gengrid_item_append(ugd->thumbs_d->gengrid,
-                                       no_content      ,
+                                                               ugd->thumbs_d->no_content       ,
                                        ugd, NULL,
                                        ugd);
        }
@@ -1592,6 +1652,7 @@ ge_update_gengrid(ge_ugdata *ugd)
 
        char *text = g_strdup_printf(pd_selected, ugd->thumbs_d->tot_selected);
        elm_object_item_text_set(ugd->nf_it, text);
+       GE_FREEIF(text);
 
        return 0;
 }
@@ -1624,24 +1685,74 @@ __ge_grid_realized(void *data, Evas_Object *obj, void *ei)
                ge_dbgE("No content layout no need to update items");
                return;
        }
-       Elm_Object_Item *it = (Elm_Object_Item *)ei;
-       ge_item* gitem = elm_object_item_data_get(it);
+       GE_CHECK(ugd->thumbs_d);
+       Elm_Object_Item *item = (Elm_Object_Item *)ei;
+       ge_item* gitem = elm_object_item_data_get(item);
        GE_CHECK(gitem);
        GE_CHECK(gitem->item);
 
        ge_dbg("realized");
        if (!GE_FILE_EXISTS(gitem->item->thumb_url) &&
-               GE_FILE_EXISTS(gitem->item->file_url) &&
-               (gitem->store_type == GE_PHONE ||
-                gitem->store_type == GE_MMC ||
-                gitem->store_type == GE_ALL)) {
+                       GE_FILE_EXISTS(gitem->item->file_url) &&
+                       (gitem->store_type == GE_PHONE ||
+                                       gitem->store_type == GE_MMC ||
+                                       gitem->store_type == GE_ALL)) {
                ge_dbg("Generating Thumbs");
                _ge_data_create_thumb(gitem->item,
                                _ge_grid_thumb_created_cb,
-                                     gitem);
+                               gitem);
+       }
+
+       Elm_Gengrid_Item_Class *it = elm_gengrid_item_item_class_get(ei);
+       GE_CHECK(it);
+       if (!it->item_style) {
+               ge_dbgE("item style is NULL");
+               return;
+       }
+       if (!g_strcmp0(it->item_style, "gengrid_items")) {
+               elm_object_item_signal_emit(item, "hide_default_image", "elm");
+       } else {
+               ge_dbg("item style not matched");
+       }
+}
+
+static void
+__ge_grid_unrealized(void *data, Evas_Object *obj, void *ei)
+{
+       ge_dbg("Grid unrealized");
+       GE_CHECK(ei);
+
+       ge_ugdata *ugd = (ge_ugdata *)data;
+       GE_CHECK(ugd);
+       GE_CHECK(ugd->thumbs_d);
+       Elm_Object_Item *item = (Elm_Object_Item*)ei;
+       Elm_Gengrid_Item_Class *it = elm_gengrid_item_item_class_get(ei);
+       GE_CHECK(it);
+       if (!it->item_style) {
+               ge_dbgE("item style is NULL");
+               return;
+       }
+       if (!g_strcmp0(it->item_style, "gengrid_items")) {
+               Eina_List *l = NULL;
+               Evas_Object *content = NULL;
+               elm_gengrid_item_all_contents_unset(ei, &l);
+               EINA_LIST_FREE(l, content)
+               {
+                       if (evas_object_smart_type_check(content, "elm_check")) {
+                               ugd->thumbs_d->check_list = eina_list_append(ugd->thumbs_d->check_list, content);
+                               evas_object_smart_callback_del(content, "changed", __ge_check_state_changed_cb);
+                       } else if (evas_object_smart_type_check(content, "elm_layout")) {
+                               ugd->thumbs_d->image_layout_list = eina_list_append(ugd->thumbs_d->image_layout_list, content);
+                       } else {
+                                       evas_object_del(content);
+                               }
+                       } elm_object_item_signal_emit(item, "show_default_image", "elm");
+               } else {
+               ge_dbg("item style not matched");
        }
 }
 
+
 int
 ge_create_gengrid(ge_ugdata *ugd)
 {
@@ -1668,6 +1779,8 @@ ge_create_gengrid(ge_ugdata *ugd)
        ugd->thumbs_d->b_mainview = true;
        ugd->thumbs_d->b_editmode = false;
        ugd->thumbs_d->tot_selected = 0;
+       ugd->thumbs_d->check_list = NULL;
+       ugd->thumbs_d->image_layout_list = NULL;
 
        ugd->attach_panel_display_mode = ATTACH_PANEL_HALF_MODE;
        ugd->file_select_mode = GE_FILE_SELECT_T_ONE;
@@ -1729,6 +1842,7 @@ ge_create_gengrid(ge_ugdata *ugd)
                                               _ge_grid_move_stop_cb, ugd);
                evas_object_smart_callback_add(gengrid, "realized", __ge_grid_realized,
                                ugd);
+               evas_object_smart_callback_add(gengrid, "unrealized", __ge_grid_unrealized, ugd);
        }
 
        ugd->thumbs_d->gic = elm_gengrid_item_class_new();
@@ -1741,31 +1855,31 @@ ge_create_gengrid(ge_ugdata *ugd)
                ugd->thumbs_d->gic->func.del = NULL;
        }
 
-       gic_first = elm_gengrid_item_class_new();
+       ugd->thumbs_d->gic_first = elm_gengrid_item_class_new();
 
-       if (gic_first) {
-               gic_first->item_style = "gengrid_first_item";
-               gic_first->func.text_get = __ge_gengrid_text_get_cb;
-               gic_first->func.content_get = NULL;
-               gic_first->func.state_get = NULL;
-               gic_first->func.del = NULL;
+       if (ugd->thumbs_d->gic_first) {
+               ugd->thumbs_d->gic_first->item_style = "gengrid_first_item";
+               ugd->thumbs_d->gic_first->func.text_get = __ge_gengrid_text_get_cb;
+               ugd->thumbs_d->gic_first->func.content_get = NULL;
+               ugd->thumbs_d->gic_first->func.state_get = NULL;
+               ugd->thumbs_d->gic_first->func.del = NULL;
 
        }
 
-       no_content = elm_gengrid_item_class_new();
+       ugd->thumbs_d->no_content = elm_gengrid_item_class_new();
 
-       if (no_content) {
-               no_content->item_style = "no_content";
-               no_content->func.text_get = NULL;
-               no_content->func.content_get = __ge_nocontent_get;
-               no_content->func.state_get = NULL;
-               no_content->func.del = NULL;
+       if (ugd->thumbs_d->no_content) {
+               ugd->thumbs_d->no_content->item_style = "no_content";
+               ugd->thumbs_d->no_content->func.text_get = NULL;
+               ugd->thumbs_d->no_content->func.content_get = __ge_nocontent_get;
+               ugd->thumbs_d->no_content->func.state_get = NULL;
+               ugd->thumbs_d->no_content->func.del = NULL;
        }
 
        if (ugd->thumbs_d->medias_cnt > 0) {
                elm_gengrid_item_size_set(gengrid, size, size);
                elm_gengrid_item_append(gengrid,
-                                       gic_first,
+                                                               ugd->thumbs_d->gic_first,
                                        NULL, __ge_launch_ug_gallery,
                                        ugd);
                /* From zeroth IMAGE item to last one */
@@ -1798,9 +1912,14 @@ ge_create_gengrid(ge_ugdata *ugd)
                }
        } else {
                ugd->nocontents = _ge_nocontents_create(ugd);
-               elm_gengrid_item_size_set(gengrid, win_w, HALF_MODE_PORTRAIT_HEIGHT);
+               double scale = elm_config_scale_get();
+               if ((scale - 1.8) < 0.0001) {
+                       elm_gengrid_item_size_set(gengrid, win_w, HALF_MODE_PORTRAIT_HEIGHT_WVGA);
+               } else {
+                       elm_gengrid_item_size_set(gengrid, win_w, HALF_MODE_PORTRAIT_HEIGHT);
+               }
                elm_gengrid_item_append(gengrid,
-                                       no_content,
+                                                               ugd->thumbs_d->no_content,
                                        ugd, NULL,
                                        ugd);
 
@@ -1810,7 +1929,10 @@ ge_create_gengrid(ge_ugdata *ugd)
        elm_object_part_content_set(ugd->albums_view, "contents", gengrid);
 
        char *pd_selected = GE_STR_PD_SELECTED;
-       ugd->nf_it = elm_naviframe_item_push(ugd->naviframe, g_strdup_printf(pd_selected, ugd->thumbs_d->tot_selected), NULL, NULL, ugd->albums_view, "basic/transparent");
+       char *text = g_strdup_printf(pd_selected, ugd->thumbs_d->tot_selected);
+       ugd->nf_it = elm_naviframe_item_push(ugd->naviframe, text, NULL, NULL, ugd->albums_view, "basic/transparent");
+
+       GE_FREEIF(text);
 
        /* Cancel Button */
        Evas_Object *btn1 = elm_button_add(ugd->naviframe);