[TIZEN_3.0] Resolved selection issue in date check 74/88174/1
authorRahul Dadhich <r.dadhich@samsung.com>
Wed, 14 Sep 2016 09:02:09 +0000 (14:32 +0530)
committerRahul Dadhich <r.dadhich@samsung.com>
Wed, 14 Sep 2016 09:02:09 +0000 (14:32 +0530)
Change-Id: Ia093ad38c91c49b7c66ed8d72fe3c249adbbf4cc
Signed-off-by: Rahul Dadhich <r.dadhich@samsung.com>
src/2dview/gl-timeline.c

index f33b71f..b793134 100644 (file)
@@ -2385,10 +2385,10 @@ void _gl_timeline_update_items_data_on_particular_date(void *data, _gl_date_item
        char *text = NULL;
 
        item = eina_list_nth(timeline_d->data_list, date_item->index);
-       int number_of_items_on_particular_date = _get_count_of_items_on_same_date(item, timeline_d->data_list, &text, date_item->index);
+       int number_of_items_on_particular_date = _get_count_of_items_on_same_date(item, timeline_d->data_list, &text, date_item->index + 1);
 
        int i;
-       for (i = date_item->index -1; i < (date_item->index -1 +number_of_items_on_particular_date); i++) {
+       for (i = date_item->index; i < (date_item->index +number_of_items_on_particular_date); i++) {
                item = eina_list_nth(timeline_d->data_list, i);
                if (!item) {
                        gl_dbgE("item not found ");
@@ -2499,7 +2499,7 @@ bool _gl_get_date_check_state(void *data, _gl_date_item_data *date_item, int num
        gl_media_s *item = NULL;
        bool flag = true;
        int i;
-       for (i = date_item->index -1; i < (date_item->index -1 +number_of_items_on_particular_date); i++) {
+       for (i = date_item->index; i < (date_item->index +number_of_items_on_particular_date); i++) {
                item = eina_list_nth(timeline_d->data_list, i);
                if (!item) {
                        gl_dbgE("item not found");
@@ -2519,10 +2519,10 @@ void _gl_timeline_update_date_check_on_particular_date(void *data, _gl_date_item
        gl_media_s *item = NULL;
        char *text = NULL;
        item = eina_list_nth(timeline_d->data_list, date_item->index);
-       int number_of_items_on_particular_date = _get_count_of_items_on_same_date(item, timeline_d->data_list, &text, date_item->index);
+       int number_of_items_on_particular_date = _get_count_of_items_on_same_date(item, timeline_d->data_list, &text, date_item->index + 1);
        bool flag = true;
        int i;
-       for (i = date_item->index -1; i < (date_item->index -1 +number_of_items_on_particular_date); i++) {
+       for (i = date_item->index; i < (date_item->index +number_of_items_on_particular_date); i++) {
                item = eina_list_nth(timeline_d->data_list, i);
                if (!item) {
                        gl_dbgE("item not found");
@@ -3317,7 +3317,7 @@ int _gl_timeline_create_grid_view(gl_timeline_s *timeline_d, Evas_Object *genlis
                        items_per_row = 4;
                }
                number_of_rows = ceil((double)number_of_items_on_particular_date / items_per_row);
-               date_item->index = i+1;
+               date_item->index = i;
                date_item->check_state = _gl_get_date_check_state(timeline_d, date_item, number_of_items_on_particular_date);
                it = elm_genlist_item_append(genlist, pGenGridZoomItc, (void*)date_item, NULL, ELM_GENLIST_ITEM_GROUP, __gl_timeline_date_check_sel_cb, timeline_d);