[elm_navigationbar]: [Animation on push not animating the current content issue resolved]
authorshilpa singh <shilpa.singh@samsung.com>
Wed, 27 Oct 2010 18:23:05 +0000 (23:53 +0530)
committershilpa singh <shilpa.singh@samsung.com>
Wed, 27 Oct 2010 18:23:05 +0000 (23:53 +0530)
Animation disable set API provided.

src/lib/Elementary.h.in
src/lib/elm_navigationbar.c
src/lib/elm_pager.c

index 6f682bc..2e12549 100644 (file)
@@ -1370,6 +1370,7 @@ extern "C" {
    EAPI void         elm_pager_content_promote(Evas_Object *obj, Evas_Object *content);
    EAPI Evas_Object *elm_pager_content_bottom_get(const Evas_Object *obj);
    EAPI Evas_Object *elm_pager_content_top_get(const Evas_Object *obj);
+   EAPI void         elm_pager_animation_disable_set(Evas_Object *obj, Eina_Bool disable);
 
    /* available item styles:
     * default
@@ -2252,6 +2253,7 @@ extern "C" {
    EAPI const char  *elm_navigationbar_subtitle_label_get(Evas_Object *obj, Evas_Object *content);
    EAPI void         elm_navigationbar_subtitle_label_set(Evas_Object *obj, Evas_Object *content, const char *subtitle);
    EAPI void         elm_navigationbar_title_object_list_unset(Evas_Object *obj, Evas_Object *content, Eina_List **list);
+   EAPI void         elm_navigationbar_animation_disable_set(Evas_Object *obj, Eina_Bool disable);
 
      /* NavigationBar */
    typedef enum 
index dfe75aa..cdefcd0 100644 (file)
@@ -30,8 +30,10 @@ struct _Widget_Data
        Eina_List *stack;
        Evas_Object *base;
        Evas_Object *pager;
+       int pushed;
        Eina_Bool popped : 1;
        Eina_Bool hidden :1;
+       Eina_Bool disable_animation : 1;
  };
 
 struct _Item
@@ -347,6 +349,7 @@ _hide_finished(void *data, Evas_Object *obj, void *event_info)
        Widget_Data *wd =  elm_widget_data_get(navi_bar);
        evas_object_smart_callback_call(navi_bar, "hide,finished", event_info);
        wd->popped = EINA_TRUE;
+       wd->pushed = 0;
 }
 
 static int
@@ -511,6 +514,7 @@ elm_navigationbar_add(Evas_Object *parent)
        evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize, NULL);       
 
        _sizing_eval(obj);
+       wd->pushed = -1;
        return obj;
 }
 
@@ -543,6 +547,8 @@ elm_navigationbar_push(Evas_Object *obj,
        Item *prev_it = NULL;
 
        if (!wd) return;
+       if(!wd->disable_animation)
+               if(wd->pushed == 1) return;
 
        it = _check_item_is_added(obj, content);
        if (it) return;
@@ -616,8 +622,9 @@ elm_navigationbar_push(Evas_Object *obj,
        _transition_complete_cb(cb);
        free(cb);
        //push content to pager
+       if(!cb->first_page)
+               wd->pushed = 1;
        elm_pager_content_push(wd->pager, it->content); 
-
        //push item into the stack. it should be always the tail
        if (!_check_item_is_added(obj, content))
        wd->stack = eina_list_append(wd->stack, it);    
@@ -1374,4 +1381,21 @@ elm_navigationbar_subtitle_label_get(Evas_Object *obj,
        return NULL;
 }
 
+/**
+ * This disables content area animation on push/pop.
+ *
+ * @param[in] obj The NavigationBar object
+ * @param[in] disable  if EINA_TRUE animation is disabled.
+ *
+ * @ingroup NavigationBar
+ */
+EAPI void
+elm_navigationbar_animation_disable_set(Evas_Object *obj, 
+                                                       Eina_Bool disable)
+{
+       ELM_CHECK_WIDTYPE(obj, widtype)NULL;
+       Widget_Data *wd = elm_widget_data_get(obj);
+       wd->disable_animation = disable;
+       elm_pager_animation_disable_set(wd->pager, disable);
+}
 
index a52b275..29b89c4 100644 (file)
@@ -29,6 +29,7 @@ struct _Widget_Data
    Eina_List *stack;
    Item *top, *oldtop;
    Evas_Object *rect, *clip;
+   Eina_Bool disable_animation: 1;
 };
 
 struct _Item
@@ -113,7 +114,11 @@ _eval_top(Evas_Object *obj)
        if (wd->top)
          {
             o = wd->top->base;
-            if (wd->top->popme)
+               if(wd->disable_animation)
+                       {
+                               edje_object_signal_emit(o, "elm,action,hide,noanimate", "elm");
+                       }
+            else if (wd->top->popme)
                edje_object_signal_emit(o, "elm,action,pop", "elm");
             else
                edje_object_signal_emit(o, "elm,action,hide", "elm");
@@ -132,8 +137,10 @@ _eval_top(Evas_Object *obj)
        wd->top = ittop;
        o = wd->top->base;
        evas_object_show(o);
-       if (!animate)
-               edje_object_signal_emit(o, "elm,action,show,noanimate", "elm");
+       if ((!animate)||(wd->disable_animation))
+               {
+                       edje_object_signal_emit(o, "elm,action,show,noanimate", "elm");
+               }
        else if (wd->oldtop && wd->oldtop->popme)
            edje_object_signal_emit(o, "elm,action,show", "elm");
        else
@@ -466,3 +473,21 @@ elm_pager_content_top_get(const Evas_Object *obj)
    return it->content;
 }
 
+/**
+ * This disables content animation on push/pop.
+ *
+ * @param obj The pager object
+ * @param disable  if EINA_TRUE animation is disabled.
+ *
+ * @ingroup Pager
+ */
+EAPI void
+elm_pager_animation_disable_set(Evas_Object *obj, 
+                                                       Eina_Bool disable)
+{
+       ELM_CHECK_WIDTYPE(obj, widtype)NULL;
+       Widget_Data *wd = elm_widget_data_get(obj);
+       wd->disable_animation = disable;
+}
+
+