viewmgr: Called deactivate method when view count is 1. 69/59869/4
authorWoochan Lee <wc0917.lee@samsung.com>
Fri, 19 Feb 2016 05:41:02 +0000 (14:41 +0900)
committerwoochan lee <wc0917.lee@samsung.com>
Fri, 19 Feb 2016 07:55:42 +0000 (23:55 -0800)
Change-Id: I9d05e190b15c17d565624a0c5f92e4a10344fbef

src/efl/ui_view.h
src/efl/ui_viewmgr.cpp
src/interface/ui_viewmgr_base.cpp

index b3d87b4..df0fd13 100644 (file)
@@ -29,6 +29,8 @@ class ui_controller;
 
 class ui_view: public ui_view_base
 {
+       friend class ui_viewmgr;
+
 public:
        ui_view(ui_controller *controller, const char *name = NULL);
        virtual ~ui_view();
index 87ed7d7..67ff19d 100644 (file)
@@ -167,6 +167,7 @@ bool ui_viewmgr::activate()
        }
 
        this->set_indicator(view->get_indicator());
+       view->active();
 
        evas_object_show(this->win);
 
@@ -180,6 +181,8 @@ bool ui_viewmgr::deactivate()
        //FIXME: based on the profile, we should app to go behind or terminate.
        if (true)
        {
+               ui_view *view = dynamic_cast<ui_view *>(this->get_last_view());
+               if (view) view->inactive();
                evas_object_lower(this->win);
        }
        else
@@ -193,10 +196,8 @@ bool ui_viewmgr::deactivate()
 
 bool ui_viewmgr::pop_view()
 {
-       if (!ui_viewmgr_base::pop_view())
-       {
-               return false;
-       }
+       if (this->get_view_count() == 1) this->deactivate();
+       else if(!ui_viewmgr_base::pop_view()) return false;
 
        ui_view *view = dynamic_cast<ui_view *>(this->get_last_view());
 
index ac8e29c..afc835d 100644 (file)
@@ -161,7 +161,9 @@ bool ui_viewmgr_base::pop_view()
                view->inactive();
                view->unload();
                view->destroy();
-               return true;
+               delete(view);
+
+               return false;
        }
 
        //last page to be popped.