Created album single view 39/239439/7 submit/tizen/20200811.071532
authormohitkr1 <mohit.kr1@samsung.com>
Fri, 24 Jul 2020 15:11:03 +0000 (20:41 +0530)
committermohitkr1 <mohit.kr1@samsung.com>
Tue, 11 Aug 2020 06:13:45 +0000 (11:43 +0530)
JIRA - 1561

Change-Id: I5fbacb3a7bfb4f59c0f9f736597a36a1632b524c
Signed-off-by: mohitkr1 <mohit.kr1@samsung.com>
inc/ge-albums.h
res/edje/gallery-efl-edc-res.h
res/edje/gallery-efl.edc
res/edje/images/00_album_box_bg.png [new file with mode: 0755]
src/view/ge-albums.c
src/view/ge-gridview.c
src/view/ge-main-view.c
src/widget/ge-thumb.c
src/widget/ge-tile.c

index 123d4ea8e3797f45ac777ec0ab92b7544c53609a..8eec683ec50e190c1eab189b06dc5d46924945c9 100755 (executable)
@@ -26,5 +26,7 @@ Evas_Object *__ge_add_albums_split_view(ge_ugdata * ugd,
 int __ge_split_view_append_albums(ge_ugdata * ugd, Evas_Object * parent,
                                                                  bool is_update);
 int __ge_albums_del_cbs(Evas_Object * view);
+Eina_Bool __ge_albums_sel_idler_cb(void *data);
+int __ge_albums_open_album(ge_cluster * album);
 
 #endif                                                 /* _GE_ALBUMS_H_ */
index d47c1a1a9ab9a73b4920c55167c32055b9cf7d0b..bec5ef29ff7eab9b8fc4c596d562415c906e5d7c 100755 (executable)
@@ -32,6 +32,7 @@
 
 /* gallery-efl-gengrid-item-thumbview.edc */
 #define        GE_EDC_IMAGE_BUTTON_VIDEO_PLAY "T01_video_play.png"
+#define GALLERY_EDC_ALBUM_BOX "00_album_box_bg.png"
 
 /* gallery-efl-check.edc */
 #define        GE_EDC_IMAGE_CHECK_ALBUM_BG "T01_album_edit_check_bg.png"
index ad73c5b9e9c2d07ef5d8aa5676a27561026523cd..185932c31288ccc046c53aa3872c8fd46f1a3f9d 100755 (executable)
@@ -65,6 +65,9 @@ collections {
 
 group {
                name: "gallery_efl/gridview";
+               images {
+                       image: GALLERY_EDC_ALBUM_BOX COMP;
+               }
                parts {
                        part {
                                name: "background";
@@ -82,9 +85,20 @@ group {
                                mouse_events: 1;
                                description {
                                        state: "default" 0.0;
-                                       rel1 { relative: 0.0 0.0; to: split.view; }
+                                       rel1 { relative: 0.0 0.0; to: split.view; offset: 0 -7;}
                                        rel2 { relative: 1.0 1.0; to: split.view; }
-                                       color: 230 230 230 255;
+                                       color: 255 255 255 0;
+                               }
+                       }
+                       part {
+                               name: "split.view.bg.cover";
+                               type: IMAGE;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       image.normal: GALLERY_EDC_ALBUM_BOX;
+                                       rel1 { relative: 0.0 0.0; to: split.view.bg.color; }
+                                       rel2 { relative: 1.0 1.0; to: split.view.bg.color; }
                                }
                        }
                        part {
@@ -96,7 +110,7 @@ group {
                                        min: 0 0;
                                        max: 0 0;
                                        align: 0 0;
-                                       rel1 { relative: 0.0 0.0; }
+                                       rel1 { relative: 0.03 0.03; }
                                        rel2 { relative: 1.0 1.0; }
                                        color : 0 255 0 255;
                                }
@@ -390,10 +404,10 @@ group {
        group { name: "ceter_algined_text_layout_split_view";
                styles {
                        style { name: "my_textblock_name_style_split_view";
-                       base: "font=Sans:style=Regular font_size=12 color=#000000 ellipsis=1.0";
+                       base: "font=Sans:style=Regular font_size=8 color=#000000 ellipsis=1.0";
                        }
                        style { name: "my_textblock_count_style_split_view";
-                       base: "font=Sans:style=Regular font_size=12 color=#000000";
+                       base: "font=Sans:style=Regular font_size=8 color=#000000";
                        }
                }
                script {
diff --git a/res/edje/images/00_album_box_bg.png b/res/edje/images/00_album_box_bg.png
new file mode 100755 (executable)
index 0000000..7602c15
Binary files /dev/null and b/res/edje/images/00_album_box_bg.png differ
index 13418b1794a1f96bff66e1e53fafe1a264409c43..53d50f14b9ebdd0e06110113c795474f4a26432b 100755 (executable)
@@ -184,7 +184,7 @@ static void __ge_albums_unrealized(void *data, Evas_Object * obj, void *ei)
  * @param album
  * @return
  */
-static int __ge_albums_open_album(ge_cluster * album)
+int __ge_albums_open_album(ge_cluster * album)
 {
        GE_CHECK_VAL(album, -1);
        GE_CHECK_VAL(album->cluster, -1);
@@ -227,7 +227,7 @@ static int __ge_split_albums_open_album(ge_cluster * album)
  * @param data
  * @return
  */
-static Eina_Bool __ge_albums_sel_idler_cb(void *data)
+Eina_Bool __ge_albums_sel_idler_cb(void *data)
 {
        ge_dbg("Select album ---");
        GE_CHECK_FALSE(data);
index 260c7bcfeb24ddc47a0d2c477df05c07514af6e9..68bd225d5c60e253f349977e30c0827d03f84658 100755 (executable)
@@ -1502,6 +1502,43 @@ void _my_custom_keydown_cb(void *data, int type, void *event)
                        __ge_main_back_cb(app_data, NULL);
                }
        }
+       ge_ugdata *ugd = (ge_ugdata *) data;
+
+       void *pop_cb = evas_object_data_get(ugd->naviframe,
+                                                                               GE_NAVIFRAME_POP_CB_KEY);
+       if (pop_cb) {
+               Eina_Bool(*_pop_cb) (void *ugd);
+               _pop_cb = pop_cb;
+
+               if (_pop_cb(ugd)) {
+                       /* Just pop edit view, dont destroy me */
+                       return;
+               }
+       }
+
+       app_control_add_extra_data(ugd->service, GE_FILE_SELECT_RETURN_COUNT,
+                                                          "0");
+       app_control_add_extra_data(ugd->service, GE_FILE_SELECT_RETURN_PATH,
+                                                          NULL);
+       app_control_add_extra_data(ugd->service, APP_CONTROL_DATA_SELECTED,
+                                                          NULL);
+
+       bool reply_requested;
+       app_control_is_reply_requested(ugd->service, &reply_requested);
+       if (reply_requested) {
+               ge_sdbg("send reply to caller");
+               app_control_h reply = NULL;
+               app_control_create(&reply);
+               app_control_reply_to_launch_request(reply, ugd->service,
+                                                                                       APP_CONTROL_RESULT_FAILED);
+               app_control_destroy(reply);
+       }
+       ge_dbg("Destroying handle");
+       if (ugd->service) {
+               app_control_destroy(ugd->service);
+               ugd->service = NULL;
+       }
+       ui_app_exit();
 }
 
 /**
@@ -1539,6 +1576,43 @@ static void __ge_albums_detail_cancel_cb(void *data, Evas_Object * obj,
        _ge_albums_update_view(app_data);
        elm_naviframe_item_pop(app_data->naviframe);
 
+       ge_ugdata *ugd = (ge_ugdata *) data;
+
+       void *pop_cb = evas_object_data_get(ugd->naviframe,
+                                                                               GE_NAVIFRAME_POP_CB_KEY);
+       if (pop_cb) {
+               Eina_Bool(*_pop_cb) (void *ugd);
+               _pop_cb = pop_cb;
+
+               if (_pop_cb(ugd)) {
+                       /* Just pop edit view, dont destroy me */
+                       return;
+               }
+       }
+
+       app_control_add_extra_data(ugd->service, GE_FILE_SELECT_RETURN_COUNT,
+                                                          "0");
+       app_control_add_extra_data(ugd->service, GE_FILE_SELECT_RETURN_PATH,
+                                                          NULL);
+       app_control_add_extra_data(ugd->service, APP_CONTROL_DATA_SELECTED,
+                                                          NULL);
+
+       bool reply_requested;
+       app_control_is_reply_requested(ugd->service, &reply_requested);
+       if (reply_requested) {
+               ge_sdbg("send reply to caller");
+               app_control_h reply = NULL;
+               app_control_create(&reply);
+               app_control_reply_to_launch_request(reply, ugd->service,
+                                                                                       APP_CONTROL_RESULT_FAILED);
+               app_control_destroy(reply);
+       }
+       ge_dbg("Destroying handle");
+       if (ugd->service) {
+               app_control_destroy(ugd->service);
+               ugd->service = NULL;
+       }
+       ui_app_exit();
 }
 
 /**
@@ -1743,7 +1817,7 @@ int _ge_grid_create_view(ge_ugdata * ugd, ge_thumbs_s * thumbs_d)
                (Edje_Message_Int *) malloc(sizeof(Edje_Message_Int) +
                                                                        sizeof(int));
        GE_CHECK_VAL(msg, -1);
-       msg->val = ((w < h) ? (w / 3) : (h / 3));
+       msg->val = ((w < h) ? (w / 4) : (h / 4));
        edje_object_message_send(elm_layout_edje_get(thumbs_d->layout),
                                                         EDJE_MESSAGE_INT, 1, msg);
        free(msg);
@@ -1769,11 +1843,11 @@ int _ge_grid_create_view(ge_ugdata * ugd, ge_thumbs_s * thumbs_d)
        evas_object_smart_callback_add(sel_all_btn, "clicked",
                                                                   __ge_grid_selall_cb, ugd);
        if (w < h) {
-               elm_gengrid_item_size_set(thumbs_d->split_view, (w / 3) - 40,
-                                                                 (w / 3) - 20);
+               elm_gengrid_item_size_set(thumbs_d->split_view, (w / 5) - 10,
+                                                                 (w / 5) + 20);
        } else {
-               elm_gengrid_item_size_set(thumbs_d->split_view, (h / 3) - 20,
-                                                                 (h / 3) - 40);
+               elm_gengrid_item_size_set(thumbs_d->split_view, (h / 5) - 10,
+                                                                 (h / 5) + 20);
        }
        elm_object_part_content_set(thumbs_d->layout, "contents",
                                                                thumbs_d->view);
index 5a19f8e720ed253a11efe33e4a23ea6fd129f9f6..5a25842a452f02663681ce7466a4aad9a2469a00 100755 (executable)
@@ -22,6 +22,7 @@
 #include "ge-albums.h"
 #include "ge-timeline.h"
 #include "app_manager.h"
+#include "ge-gridview.h"
 
 /**
  *
@@ -130,14 +131,56 @@ int _ge_main_create_view(ge_ugdata * ugd)
        /* Create layout of albums view */
 
        if (_ge_launch_in_time_view(ugd)) {
-               ugd->time_view_ly = __ge_time_create_ly(ugd, ugd->naviframe);
-               GE_CHECK_VAL(ugd->time_view_ly, -1);
+               _ge_data_get_clusters(ugd, GE_ALBUM_DATA_LOCAL);
+               ge_cluster *album_item = eina_list_nth(ugd->cluster_list->clist, 0);
+               if(album_item == NULL)
+               {
+                       ugd->albums_view_ly = __ge_main_create_ly(ugd, ugd->naviframe);
+                       GE_CHECK_VAL(ugd->albums_view_ly, -1);
+                       _ge_albums_create_view(ugd);
+                       return 0;
+               }
+               ge_ugdata *ugd = album_item->ugd;
+               Evas_Object *obj = ugd->albums_view;
+
+               ugd->album_item = album_item;
+               ge_dbg("");
+               if (ugd->sel_album_idler) {
+                       ge_dbg("Has selected an album");
+                       return 0;
+               }
+
+               Ecore_Idler *idl = NULL;
+               idl = ecore_idler_add(__ge_albums_sel_idler_cb, album_item);
+               ugd->sel_album_idler = idl;
+               /* Save scroller position before clearing gengrid */
+               _ge_ui_save_scroller_pos(obj);
 
-               _ge_timeline_create_view(ugd, ugd->time_view_ly);
        } else {
-               ugd->albums_view_ly = __ge_main_create_ly(ugd, ugd->naviframe);
-               GE_CHECK_VAL(ugd->albums_view_ly, -1);
-               _ge_albums_create_view(ugd);
+               _ge_data_get_clusters(ugd, GE_ALBUM_DATA_LOCAL);
+               ge_cluster *album_item = eina_list_nth(ugd->cluster_list->clist, 0);
+               if(album_item == NULL)
+               {
+                       ugd->albums_view_ly = __ge_main_create_ly(ugd, ugd->naviframe);
+                       GE_CHECK_VAL(ugd->albums_view_ly, -1);
+                       _ge_albums_create_view(ugd);
+                       return 0;
+               }
+               ge_ugdata *ugd = album_item->ugd;
+               Evas_Object *obj = ugd->albums_view;
+
+               ugd->album_item = album_item;
+               ge_dbg("");
+               if (ugd->sel_album_idler) {
+                       ge_dbg("Has selected an album");
+                       return 0;
+               }
+
+               Ecore_Idler *idl = NULL;
+               idl = ecore_idler_add(__ge_albums_sel_idler_cb, album_item);
+               ugd->sel_album_idler = idl;
+               /* Save scroller position before clearing gengrid */
+               _ge_ui_save_scroller_pos(obj);
        }
 
        return 0;
index 210214b77b7a47243ae83e3ae5f520a8ceabbd86..3aa228bf7fdce1897d086233ea78e8bdf074c259 100755 (executable)
@@ -37,6 +37,7 @@
 
 #define GE_GRID_3_PER_ROW 3
 #define GE_GRID_ITEM_S_CNT 5
+#define GE_GRID_5_PER_ROW_FACTOR 6.2
 
 /**
  *
@@ -166,7 +167,7 @@ int _ge_thumb_set_size(ge_ugdata * ugd, Evas_Object * view,
        elm_gengrid_align_get(view, &align_x, &align_y);
        ge_dbg("rotate_mode: %d, count: %d", rotate_mode, count);
 
-       _w = (int) (win_w / GE_GRID_3_PER_ROW);
+       _w = (int) (win_w / GE_GRID_5_PER_ROW_FACTOR);
        _h = (int) (GE_GRID_ITEM_SIZE_H_ZOOM_02 * scale);
        _w_l = (int) (win_h / GE_GRID_ITEM_S_CNT);
        _h_l = (int) (356 * scale);
@@ -194,7 +195,18 @@ int _ge_thumb_set_size(ge_ugdata * ugd, Evas_Object * view,
        /*if (count <= align_c)
           elm_gengrid_align_set(view, 0.5, 0.5);
           else */
-       elm_gengrid_align_set(view, 0.0, 0.0);
+       // Gengrid alignment according to item count
+       if (count == 1) {
+               elm_gengrid_align_set(view, 0.02, 0.0);
+       } else if (count == 2) {
+               elm_gengrid_align_set(view, 0.025, 0.0);
+       } else if (count == 3) {
+               elm_gengrid_align_set(view, 0.04, 0.0);
+       } else if (count == 4) {
+               elm_gengrid_align_set(view, 0.071, 0.0);
+       } else  {
+               elm_gengrid_align_set(view, 0.55, 0.0);
+       }
        if (size_w && size_h)
                ge_dbg("P: %dx%d, size_w: %d,size_h: %d", _w, _h, *size_w,
                           *size_h);
index f6fa02e38bf779150225927e1a14343827a24355..45649c50ad5cb811e939450773798f82889bb2f4 100755 (executable)
@@ -26,6 +26,7 @@
 /* Indicator show, minus 20 pixels */
 #define GE_TILE_2_PER_ROW 2
 #define GE_TILE_3_PER_ROW 3
+#define GE_TILE_5_PER_ROW 5
 #define GE_TILE_ITEM_CNT 6
 #define GE_TILE_ITEM_L_CNT 3
 /* Size of album icon */
@@ -155,7 +156,7 @@ int _ge_tile_update_item_size(ge_ugdata * ugd, Evas_Object * grid,
        ge_dbg("rotate_mode: %d, b_update: %d", rotate_mode, b_update);
 
        ge_dbg("scale: %f", scale);
-       w = (int) (win_w / GE_TILE_2_PER_ROW);
+       w = (int) (win_w / GE_TILE_5_PER_ROW);
        h = (int) (300 * scale);
        w_l = (int) (win_h / GE_TILE_3_PER_ROW);
        h_l = w_l;