Display the progress bar during BT on / off
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 21 Mar 2013 23:23:06 +0000 (08:23 +0900)
committerGerrit Code Review <gerrit2@kim11>
Fri, 5 Apr 2013 06:04:34 +0000 (15:04 +0900)
[Issue] P130319-6531

[Problem] There's no loading circle during on/off Bluetooth
          in Settings.

[Cause] There was no UX guideline, so we didn't implement it.

[Solution] Request to add the progress bar in UX guideline.
           And Implement the progress bar

Change-Id: Id1df907b7a4dddb56698d42ef3fa8113bdbd28dc

src/ui/bt-main-view.c

index 0248fe7..2190bfe 100644 (file)
@@ -129,35 +129,37 @@ static Evas_Object *__bt_main_status_icon_get(void *data, Evas_Object *obj,
 
        ugd = (bt_ug_data *)data;
 
-       if (ugd->op_status == BT_ACTIVATING ||
-            ugd->op_status == BT_DEACTIVATING ||
-             ugd->op_status == BT_SEARCHING) {
-               __bt_main_set_controlbar_mode(ugd, BT_CONTROL_BAR_DISABLE);
-
-               if (ugd->op_status != BT_SEARCHING)
-                       return NULL;
-       }
-
        if (!strcmp(part, "elm.icon")) {
-               activated = (ugd->op_status == BT_DEACTIVATED) ? FALSE : TRUE;
+               if (ugd->op_status == BT_ACTIVATING ||
+                    ugd->op_status == BT_DEACTIVATING) {
+                       btn = elm_progressbar_add(obj);
+                       elm_object_style_set(btn, "list_process");
+                       evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0.5);
+                       evas_object_size_hint_weight_set(btn,
+                                       EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+                       elm_progressbar_pulse(btn, TRUE);
+               } else {
+                       activated = (ugd->op_status == BT_DEACTIVATED) ? FALSE : TRUE;
+
+                       if (activated == TRUE)
+                               __bt_main_set_controlbar_mode(ugd,
+                                                             BT_CONTROL_BAR_ENABLE);
+                       else
+                               __bt_main_set_controlbar_mode(ugd,
+                                                             BT_CONTROL_BAR_DISABLE);
+
+                       btn = elm_check_add(obj);
+                       elm_object_style_set(btn, "on&off");
+                       evas_object_show(btn);
+                       evas_object_pass_events_set(btn, EINA_TRUE);
+                       evas_object_propagate_events_set(btn, EINA_FALSE);
+                       elm_check_state_set(btn, activated);    /* set on or off */
+
+                       /* add smart callback */
+                       evas_object_smart_callback_add(btn, "changed",
+                                                      __bt_main_onoff_btn_cb, ugd);
+               }
 
-               if (activated == TRUE)
-                       __bt_main_set_controlbar_mode(ugd,
-                                                     BT_CONTROL_BAR_ENABLE);
-               else
-                       __bt_main_set_controlbar_mode(ugd,
-                                                     BT_CONTROL_BAR_DISABLE);
-
-               btn = elm_check_add(obj);
-               elm_object_style_set(btn, "on&off");
-               evas_object_show(btn);
-               evas_object_pass_events_set(btn, EINA_TRUE);
-               evas_object_propagate_events_set(btn, EINA_FALSE);
-               elm_check_state_set(btn, activated);    /* set on or off */
-
-               /* add smart callback */
-               evas_object_smart_callback_add(btn, "changed",
-                                              __bt_main_onoff_btn_cb, ugd);
                ugd->onoff_btn = btn;
        }