[TIZEN_3.0 UX Impl] changed progressbar style in copy/move operation. 33/84633/1
authorRahul Dadhich <r.dadhich@samsung.com>
Fri, 19 Aug 2016 14:38:09 +0000 (20:08 +0530)
committerRahul Dadhich <r.dadhich@samsung.com>
Fri, 19 Aug 2016 14:38:09 +0000 (20:08 +0530)
Change-Id: I6fc0b9f661b39bfa6613e92a66ddab95b2e6a1d3
Signed-off-by: Rahul Dadhich <r.dadhich@samsung.com>
inc/util/gl-strings.h
inc/widget/gl-progressbar.h
res/edje/gl-label.edc
res/edje/gl-progressbar.edc
src/2dview/gl-timeline.c
src/util/gl-util.c
src/widget/gl-progressbar.c

index f4e2a73..131435c 100755 (executable)
@@ -133,8 +133,8 @@ extern "C"
 
 #define GL_STR_ID_GALLERY "IDS_COM_BODY_GALLERY"
 #define GL_STR_ID_CHNAGE_NAME "IDS_COM_BODY_CHANGE_NAME"
-#define GL_STR_ID_MOVING "IDS_COM_POP_MOVING"
-#define GL_STR_ID_COPYING "IDS_COM_POP_COPYING_ING"
+#define GL_STR_ID_MOVING "IDS_GALLERY_POP_MOVING_ING"
+#define GL_STR_ID_COPYING "IDS_GALLERY_POP_COPYING_ING"
 #define GL_STR_ID_DELETING "IDS_COM_POP_DELETING"
 #define GL_STR_ID_YES "IDS_COM_SK_YES"
 #define GL_STR_ID_NO "IDS_COM_SK_NO"
index ba30919..c176f09 100644 (file)
@@ -23,6 +23,7 @@
 #define GL_FONT_STYLE_POP_E "</font_size></font></color>"
 
 int gl_pb_add_pbar_timer(void *data);
+int gl_pb_make_thread_pbar(void *data, Evas_Object * parent, char *title);
 int gl_pb_make_thread_pbar_wheel(void *data, Evas_Object * parent, char *title);
 int gl_pb_refresh_thread_pbar(void *data, int cur_cnt, int total_cnt);
 int gl_pb_del_pbar(void *data);
index ade0f7f..593d8b3 100644 (file)
@@ -24,7 +24,7 @@
 
       styles {
          style { name: "textblock_style";
-            base: "font=Tizen:style=Medium text_class=tizen font_size=24 color="LABEL_TEXT_BLOCK_STYLE_COLOR_INC" text_class=label";
+            base: "font=Tizen:style=Medium text_class=tizen font_size=14 color="LABEL_TEXT_BLOCK_STYLE_COLOR_INC" text_class=label";
             tag:  "br" "\n";
             tag:  "ps" "ps";
             tag:  "hilight" "+ font=Tizen:style=Bold text_class=tizen";
index d89fef1..a711e66 100644 (file)
 *
 */
 
-#define PROGRESSBAR_STATUS_TEXT_FONT_SIZE_INC 20
+#define PROGRESSBAR_STATUS_TEXT_FONT_SIZE_INC 10
 #define PROGRESSBAR_LIST_PROGRESS_STYLE_TEXT_COLOR_INC 0 0 0 255
 #define PROGRESSBAR_LIST_PROGRESS_STYLE_STATUS_TEXT_COLOR_INC 224 224 224 255
-#define PROGRESSBAR_LIST_PROGRESS_HEIGHT_INC 8
+#define PROGRESSBAR_LIST_PROGRESS_HEIGHT_INC 4
+
+#define PROGRESSBAR_DEFAULT_HEIGHT_INC 4
+#define PROGRESSBAR_DEFAULT_TEXT_HEIGHT_INC 21
+#define PROGRESSBAR_PENDING_HEIGHT_INC 4
+#define PROGRESSBAR_PENDING_TEXT_HEIGHT_INC 21
+#define PROGRESSBAR_PADDING_HEIGHT_INC 4
+#define PROGRESSBAR_LARGE_SIZE_INC 51 51
+#define PROGRESSBAR_MEDIUM_SIZE_INC 28 28
+#define PROGRESSBAR_SMALL_SIZE_INC 22 22
+
+group { name: "elm/progressbar/horizontal/gallery/default";
+      data.item: "vector_ux" "default";
+      parts {
+         part { name: "access";
+            type: RECT;
+            description { state: "default" 0.0;
+               fixed: 1 1;
+               color: 0 0 0 0;
+            }
+         }
+         part { name: "elm.swallow.bar";
+            type: SWALLOW;
+            description { state: "default" 0.0;
+               visible: 0;
+            }
+         }
+         part { name: "base";
+            type: SPACER;
+            scale: 1;
+            description { state: "default" 0.0;
+               min: 0 PROGRESSBAR_DEFAULT_HEIGHT_INC;
+            }
+         }
+         part { name: "elm.text.top.right";
+            type: TEXT;
+            scale: 1;
+            description { state: "default" 0.0;
+               rel1.relative: 0.0 0.0;
+               rel2.relative: 1.0 0.0;
+               rel1.to: "base";
+               rel2.to: "top_padding";
+               text {
+                  min: 0 0;
+                  align: 0.0 1.0;
+                  font: "Tizen:style=Regular"; size: "12";
+                  text_class: "tizen";
+               }
+               align: 0.0 1.0;
+               color: 102 102 102 255;
+               visible: 0;
+            }
+            description { state: "show" 0.0;
+               inherit: "default" 0.0;
+               min: 0 PROGRESSBAR_DEFAULT_TEXT_HEIGHT_INC;
+               text.min: 1 1;
+               visible: 1;
+            }
+         }
+         part { name: "top_padding";
+            type: SPACER;
+            scale: 1;
+            description { state: "default" 0.0;
+               min: 0 PROGRESSBAR_PADDING_HEIGHT_INC;
+               max: -1 PROGRESSBAR_PADDING_HEIGHT_INC;
+               fixed: 0 1;
+               rel1.to: "background";
+               rel2.to: "background";
+               rel1.relative: 0.0 0.0;
+               rel2.relative: 1.0 0.0;
+               align: 0.5 1.0;
+            }
+         }
+         part { name: "background";
+            type: RECT;
+            mouse_events: 0;
+            scale: 1;
+            description { state: "default" 0.0;
+               min: 0 PROGRESSBAR_DEFAULT_HEIGHT_INC;
+               max: -1 PROGRESSBAR_DEFAULT_HEIGHT_INC;
+               fixed: 0 1;
+               color: 145 145 145 179;
+            }
+         }
+         part { name: "tizen_vg_shape1";
+            type: SWALLOW;
+            mouse_events: 0;
+            scale: 1;
+            clip_to: "background";
+            description { state: "default" 0.0;
+               rel1.to: "background";
+               rel2.to: "background";
+            }
+         }
+         part { name: "drag.background";
+            type: SPACER;
+            scale: 1;
+            description { state: "default" 0.0;
+               rel1 {
+                  to_x: "background";
+                  to_y: "background";
+                  relative: 0.0 0.0;
+               }
+               rel2 {
+                  to_x: "background";
+                  to_y: "background";
+                  relative: 1.0 1.0;
+               }
+            }
+         }
+         part { name: "tizen_vg_shape2";
+            type: SWALLOW;
+            scale: 1;
+            clip_to: "tizen_vg_shape2_clipper";
+            description { state: "default" 0.0;
+               rel1.to: "elm.progress.progressbar";
+               rel2.to: "elm.progress.progressbar";
+            }
+         }
+         part { name: "tizen_vg_shape2_clipper";
+            type: RECT;
+            description { state: "default" 0.0;
+               color:61 184 204 77;
+            }
+         }
+         part { name: "tizen_vg_shape3";
+            type: SWALLOW;
+            scale: 1;
+            clip_to: "elm.progress.progressbar";
+            description { state: "default" 0.0;
+               rel1.to: "elm.progress.progressbar";
+               rel2.to: "elm.progress.progressbar";
+            }
+         }
+         part { name: "elm.progress.progressbar";
+            type: RECT;
+            description { state: "default" 0.0;
+               min: 0 0;
+               fixed: 1 1;
+               rel1 {
+                  to: "background";
+                  relative: 0.0 0.0;
+               }
+               rel2 {
+                  to_y: "background";
+                  to_x: "elm.cur.progressbar";
+                  offset: -1 -1;
+               }
+               color:61 184 204 255;
+            }
+            description { state: "invert" 0.0;
+               inherit: "default" 0.0;
+               rel1 {
+                  to_y: "background";
+                  to_x: "elm.cur.progressbar";
+               }
+               rel2 {
+                  to: "background";
+                  relative: 1.0 1.0;
+               }
+            }
+            description { state: "state_begin" 0.0;
+               inherit: "default" 0.0;
+               rel1 {
+                  to: "background";
+                  relative: 0.0 0.0;
+               }
+               rel2 {
+                  to: "background";
+                  relative: 0.1 1.0;
+               }
+            }
+            description { state: "state_end" 0.0;
+               inherit: "default" 0.0;
+               rel1 {
+                  to: "background";
+                  relative: 0.9 0.0;
+               }
+               rel2 {
+                  to: "background";
+                  relative: 1.0 1.0;
+               }
+            }
+         }
+         part { name: "elm.cur.progressbar";
+            mouse_events: 0;
+            scale: 1;
+            dragable {
+               confine: "drag.background";
+               x: 1 1 1;
+               y: 0 0 0;
+            }
+            description { state: "default" 0.0;
+               min: 0 28;
+               fixed: 1 1;
+               visible: 0;
+               rel1.to: "drag.background";
+               rel2.to: "drag.background";
+           }
+         }
+         part { name: "bottom_padding";
+            type: SPACER;
+            scale: 1;
+            description { state: "default" 0.0;
+               min: 0 PROGRESSBAR_PADDING_HEIGHT_INC;
+               max: -1 PROGRESSBAR_PADDING_HEIGHT_INC;
+               fixed: 0 1;
+               rel1.to: "background";
+               rel2.to: "background";
+               rel1.relative: 0.0 1.0;
+               rel2.relative: 1.0 1.0;
+               align: 0.5 0.0;
+            }
+         }
+         part { name: "elm.text.bottom.left";
+            type: TEXT;
+            scale: 1;
+            description { state: "default" 0.0;
+               rel1.to: "bottom_padding";
+               rel2.to: "base";
+               rel1.relative: 0.0 1.0;
+               rel2.relative: 1.0 1.0;
+               text {
+                  min: 0 0;
+                  align: 0.0 0.0;
+                  font: "Tizen:style=Regular"; size: "12";
+                  text_class: "tizen";
+               }
+               align: 0.0 0.0;
+               color: 102 102 102 255;
+               visible: 0;
+            }
+            description { state: "show" 0.0;
+               inherit: "default" 0.0;
+               text.min: 1 1;
+               visible: 1;
+               min: 0 PROGRESSBAR_DEFAULT_TEXT_HEIGHT_INC;
+            }
+         }
+         part { name: "elm.text.status";
+            type: TEXT;
+            scale: 1;
+            description { state: "default" 0.0;
+               rel1.to: "bottom_padding";
+               rel2.to: "base";
+               rel1.relative: 0.0 1.0;
+               rel2.relative: 1.0 1.0;
+               text {
+                  min: 0 0;
+                  align: 1.0 0.0;
+                  font: "Tizen:style=Regular"; size: "12";
+                  text_class: "tizen";
+               }
+               align: 1.0 0.0;
+               color: 102 102 102 255;
+               visible: 0;
+            }
+            description { state: "show" 0.0;
+               inherit: "default" 0.0;
+               text.min: 1 1;
+               min: 0 PROGRESSBAR_DEFAULT_TEXT_HEIGHT_INC;
+               visible: 1;
+            }
+         }
+         part { name: "elm.text.bottom.right";
+            type: TEXT;
+            scale: 1;
+            description { state: "default" 0.0;
+               rel1.to: "bottom_padding";
+               rel2.to: "base";
+               rel1.relative: 0.0 1.0;
+               rel2.relative: 1.0 1.0;
+               text {
+                  min: 0 0;
+                  align: 1.0 0.0;
+                  font: "Tizen:style=Regular"; size: "12";
+                  text_class: "tizen";
+               }
+               align: 1.0 0.0;
+               color: 102 102 102 255;
+               visible: 0;
+            }
+            description { state: "show" 0.0;
+               inherit: "default" 0.0;
+               text.min: 1 1;
+               visible: 1;
+               min: 0 PROGRESSBAR_DEFAULT_TEXT_HEIGHT_INC;
+            }
+         }
+      }
+      programs {
+         program { name: "text_top_right_show";
+            signal: "elm,state,top.right,visible";
+            source: "elm";
+            action: STATE_SET "show" 0.0;
+            target: "elm.text.top.right";
+         }
+         program { name: "text_top_right_text_hide";
+            signal: "elm,state,top.right,hidden";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.text.top.right";
+         }
+         program { name: "text_bottom_left_show";
+            signal: "elm,state,bottom.left,visible";
+            source: "elm";
+            action: STATE_SET "show" 0.0;
+            target: "elm.text.bottom.left";
+         }
+         program { name: "text_bottom_left_text_hide";
+            signal: "elm,state,bottom.left,hidden";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.text.bottom.left";
+         }
+         program { name: "text_bottom_right_show";
+            signal: "elm,state,bottom.right,visible";
+            source: "elm";
+            script {
+               set_state(PART:"elm.text.status", "default", 0.0);
+               set_state(PART:"elm.text.bottom.right", "show", 0.0);
+            }
+         }
+         program { name: "text_status_show";
+            signal: "elm,state,units,visible";
+            source: "elm";
+            script {
+               set_state(PART:"elm.text.bottom.right", "default", 0.0);
+               set_state(PART:"elm.text.status", "show", 0.0);
+            }
+         }
+         program { name: "text_status_text_hide";
+            signal: "elm,state,units,hidden";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.text.status";
+         }
+         program { name: "slide_to_end";
+            action: STATE_SET "state_end" 0.0;
+            transition: LINEAR 0.5;
+            target: "elm.progress.progressbar";
+            after: "slide_to_begin";
+         }
+         program { name: "slide_to_begin";
+            signal: "elm,state,slide,begin";
+            action: STATE_SET "state_begin" 0.0;
+            target: "elm.progress.progressbar";
+            transition: LINEAR 0.5;
+            after: "slide_to_end";
+         }
+         program { name: "start_pulse";
+            signal: "elm,state,pulse,start";
+            source: "elm";
+         }
+         program { name: "stop_pulse";
+            signal: "elm,state,pulse,stop";
+            source: "elm";
+            action: ACTION_STOP;
+            target: "slide_to_begin";
+            target: "slide_to_end";
+            target: "start_pulse";
+         }
+         program { name: "state_pulse";
+            signal: "elm,state,pulse";
+            source: "elm";
+            action: STATE_SET "state_begin" 0.0;
+            target: "elm.progress.progressbar";
+            action: STATE_SET "default" 0.0;
+            target: "elm.text.status";
+         }
+         program { name: "state_fraction";
+            signal: "elm,state,fraction";
+            source: "elm";
+            action: ACTION_STOP;
+            target: "slide_to_begin";
+            target: "slide_to_end";
+            target: "start_pulse";
+            action: STATE_SET "default" 0.0;
+            target: "elm.progress.progressbar";
+            target: "elm.text.status";
+         }
+         program { name: "set_invert_on";
+            signal: "elm,state,inverted,on";
+            source: "elm";
+            action: STATE_SET "invert" 0.0;
+            target: "elm.progress.progressbar";
+         }
+         program { name: "set_invert_off";
+            signal: "elm,state,inverted,off";
+            source: "elm";
+            action: STATE_SET "default" 0.0;
+            target: "elm.progress.progressbar";
+         }
+         program { name: "finished_animation";
+            signal: "elm,action,animation,finished";
+            source: "elm";
+            action: SIGNAL_EMIT "animation,finished" "";
+         }
+      }
+   }
 
    group { name: "elm/progressbar/horizontal/gallery/list_progress";
       images {
index 7917b80..0edb2c4 100644 (file)
@@ -2386,7 +2386,8 @@ void _gl_timeline_update_items_data_on_particular_date(void *data, _gl_date_item
        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);
 
-       for (int i = date_item->index -1; i < (date_item->index -1 +number_of_items_on_particular_date); i++) {
+       int i;
+       for (i = date_item->index -1; i < (date_item->index -1 +number_of_items_on_particular_date); i++) {
                item = eina_list_nth(timeline_d->data_list, i);
                if (!item) {
                        gl_dbgE("item not found ");
@@ -2496,7 +2497,8 @@ bool _gl_get_date_check_state(void *data, _gl_date_item_data *date_item, int num
        gl_timeline_s *timeline_d = (gl_timeline_s *)data;
        gl_media_s *item = NULL;
        bool flag = true;
-       for (int i = date_item->index -1; i < (date_item->index -1 +number_of_items_on_particular_date); i++) {
+       int i;
+       for (i = date_item->index -1; i < (date_item->index -1 +number_of_items_on_particular_date); i++) {
                item = eina_list_nth(timeline_d->data_list, i);
                if (!item) {
                        gl_dbgE("item not found");
@@ -2518,7 +2520,8 @@ void _gl_timeline_update_date_check_on_particular_date(void *data, _gl_date_item
        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);
        bool flag = true;
-       for (int i = date_item->index -1; i < (date_item->index -1 +number_of_items_on_particular_date); i++) {
+       int i;
+       for (i = date_item->index -1; i < (date_item->index -1 +number_of_items_on_particular_date); i++) {
                item = eina_list_nth(timeline_d->data_list, i);
                if (!item) {
                        gl_dbgE("item not found");
index d2d36f6..2b16846 100644 (file)
@@ -89,7 +89,11 @@ int _gl_use_thread_operate_medias(void *data, char *pbar_title, int all_cnt,
        /* Initialize thread mutex lock */
        gl_thread_init_lock(ad);
        /* Make progressbar */
-       gl_pb_make_thread_pbar_wheel(ad, ad->maininfo.win, pbar_title);
+       if (pbar_title && (!strcmp(GL_STR_ID_MOVING, pbar_title) || !strcmp(GL_STR_ID_COPYING, pbar_title))) {
+               gl_pb_make_thread_pbar(ad, ad->maininfo.win, pbar_title);
+       } else {
+               gl_pb_make_thread_pbar_wheel(ad, ad->maininfo.win, pbar_title);
+       }
        /* Set pb_cancel, indicates thread operation is beginning */
        gl_thread_set_cancel_state(ad, GL_PB_CANCEL_NORMAL);
        /* Initialize progressbar */
index edae48b..f9e41a5 100644 (file)
@@ -60,7 +60,6 @@ static Eina_Bool __gl_pb_pbar_timer_cb(void *data)
        return ECORE_CALLBACK_CANCEL;
 }
 
-#if 0
 /* We need to perform cancellation, not just delete popup */
 static inline void __gl_pb_ea_back_cb(void *data, Evas_Object *obj, void *ei)
 {
@@ -70,7 +69,6 @@ static inline void __gl_pb_ea_back_cb(void *data, Evas_Object *obj, void *ei)
        GL_CHECK(btn_cancel);
        evas_object_smart_callback_call(btn_cancel, "clicked", NULL);
 }
-#endif
 
 int gl_pb_make_thread_pbar_wheel(void *data, Evas_Object *parent, char *title)
 {
@@ -117,26 +115,89 @@ int gl_pb_make_thread_pbar_wheel(void *data, Evas_Object *parent, char *title)
        return 0;
 }
 
+int gl_pb_make_thread_pbar(void *data, Evas_Object *parent, char *title)
+{
+       GL_CHECK_VAL(data, -1);
+       gl_appdata *ad = (gl_appdata *)data;
+       Evas_Object *popup = NULL;
+       Evas_Object *progressbar = NULL;
+       Evas_Object *box = NULL;
+       Evas_Object *label = NULL;
+
+       gl_pb_del_pbar(ad);
+
+       popup = elm_popup_add(parent);
+
+       /*Delete the Popup if the Popup has a BACK event.*/
+       eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK,
+                                    __gl_pb_ea_back_cb, NULL);
+       if (!strcmp(GL_STR_ID_MOVING, title)) {
+               _gl_ui_set_translate_part_str(popup, GL_POPUP_TEXT, GL_STR_ID_MOVE);
+       } else {
+               _gl_ui_set_translate_part_str(popup, GL_POPUP_TEXT, GL_STR_ID_COPY);
+       }
+
+       evas_object_size_hint_weight_set(label, 0.0,
+                                        EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(label, 0.0,
+                       EVAS_HINT_FILL);
+       evas_object_show(label);
+       progressbar = elm_progressbar_add(popup);
+       elm_object_style_set(progressbar, "gallery/default");
+       elm_progressbar_unit_format_set(progressbar, NULL);
+       elm_progressbar_value_set(progressbar, 0.0);
+       evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL,
+                                       EVAS_HINT_FILL);
+       evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND,
+                                        EVAS_HINT_EXPAND);
+       evas_object_show(progressbar);
+       elm_object_part_text_set(progressbar, "elm.text.top.right", _gl_str(title));
+       box = elm_box_add(popup);
+       evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND,
+                                        EVAS_HINT_EXPAND);
+       elm_box_horizontal_set(box, EINA_FALSE);
+       elm_box_homogeneous_set(box, EINA_FALSE);
+       elm_box_pack_end(box, progressbar);
+       evas_object_show(box);
+
+       elm_object_content_set(popup, box);
+       Evas_Object *btn1 = NULL;
+       btn1 = _gl_but_create_but_popup(popup, GL_STR_ID_CANCEL,
+                                       __gl_pb_cancel_thread_pbar_cb, data);
+       elm_object_part_content_set(popup, "button1", btn1);
+
+       evas_object_show(popup);
+
+       ad->pbarinfo.popup = popup;
+       ad->pbarinfo.pbar = progressbar;
+       ad->pbarinfo.finished_cnt = 0;
+
+       return 0;
+}
+
+
 int gl_pb_refresh_thread_pbar(void *data, int cur_cnt, int total_cnt)
 {
        GL_CHECK_VAL(data, -1);
        char status_info[GL_POPUP_DESC_LEN_MAX] = { 0, };
+       char status_percent[GL_POPUP_DESC_LEN_MAX] = { 0, };
        double percent = 0.0;
        gl_appdata *ad = (gl_appdata *)data;
        GL_CHECK_VAL(ad->pbarinfo.pbar, -1);
-       GL_CHECK_VAL(ad->pbarinfo.status_label, -1);
 
        snprintf(status_info, sizeof(status_info),
-                GL_FONT_STYLE_POP_S"%d/%d"GL_FONT_STYLE_POP_E, cur_cnt,
+                "%d/%d", cur_cnt,
                 total_cnt);
        /* Save medias count already operated */
        ad->pbarinfo.finished_cnt = cur_cnt;
-       elm_object_text_set(ad->pbarinfo.status_label, status_info);
-       evas_object_show(ad->pbarinfo.status_label);
+       elm_object_part_text_set(ad->pbarinfo.pbar, "elm.text.bottom.left", status_info);
 
        if (total_cnt != 0) {
                percent = (double)cur_cnt / (double)total_cnt;
                elm_progressbar_value_set(ad->pbarinfo.pbar, percent);
+               snprintf(status_percent, sizeof(status_percent),
+                                "%d%%", (int)(percent*100));
+               elm_object_part_text_set(ad->pbarinfo.pbar, "elm.text.bottom.right", status_percent);
        }
 
        return 0;