From: Woochan Lee Date: Sun, 27 Mar 2016 08:12:23 +0000 (+0900) Subject: Add view transition effect example X-Git-Tag: submit/tizen/20160617.075742~81^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fad057541cbfca39dc35ef70b150bfb45efe0859;p=platform%2Fcore%2Fuifw%2Fui-viewmgr.git Add view transition effect example page14 = zoom. page15 = none. Change-Id: I8dc6faa3d11bdeb5e2d2f680fcc92e1b2f1ae266 --- diff --git a/src/examples/efl/main.cpp b/src/examples/efl/main.cpp index 5a42973..f97ac27 100644 --- a/src/examples/efl/main.cpp +++ b/src/examples/efl/main.cpp @@ -15,6 +15,8 @@ * */ #include "main.h" +#include "page15.h" +#include "page14.h" #include "page13.h" #include "page12.h" #include "page11.h" diff --git a/src/examples/efl/page13.h b/src/examples/efl/page13.h index e61abc6..b768a39 100644 --- a/src/examples/efl/page13.h +++ b/src/examples/efl/page13.h @@ -35,7 +35,7 @@ protected: [](void *data, Evas_Object *obj, void *event_info) -> void { appdata_s *ad = static_cast(data); - ad->viewmgr->deactivate(); + create_page14(ad); }, this->ad); this->set_content(content, "Title"); diff --git a/src/examples/efl/page14.h b/src/examples/efl/page14.h new file mode 100644 index 0000000..35259f9 --- /dev/null +++ b/src/examples/efl/page14.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** This example create a simple view which is inheritance ui_view. + * Then push in viewmgr. + */ +class page14: public ui_view +{ +private: + appdata_s *ad; + +protected: + void on_load() + { + //Create a main content. + Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo
Page 14
zoom transition effect", + //Prev Button Callback + [](void *data, Evas_Object *obj, void *event_info) -> void + { + appdata_s *ad = static_cast(data); + ad->viewmgr->pop_view(); + }, + //Next Button Callback + [](void *data, Evas_Object *obj, void *event_info) -> void + { + appdata_s *ad = static_cast(data); + create_page15(ad); + }, + this->ad); + + this->set_transition_style("zoom"); + this->set_content(content, "Title"); + } + +public: + page14(appdata_s *ad) : ui_view("page14"), ad(ad) + { + ad->viewmgr->push_view(this); + } + + ~page14() + { + } +}; + +void create_page14(appdata_s *ad) +{ + new page14(ad); +} diff --git a/src/examples/efl/page15.h b/src/examples/efl/page15.h new file mode 100644 index 0000000..5e6aa45 --- /dev/null +++ b/src/examples/efl/page15.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** This example create a simple view which is inheritance ui_view. + * Then push in viewmgr. + */ +class page15: public ui_view +{ +private: + appdata_s *ad; + +protected: + void on_load() + { + //Create a main content. + Evas_Object *content = create_content(this->get_base(), "ViewMgr Demo
Page 15
none transition effect", + //Prev Button Callback + [](void *data, Evas_Object *obj, void *event_info) -> void + { + appdata_s *ad = static_cast(data); + ad->viewmgr->pop_view(); + }, + //Next Button Callback + [](void *data, Evas_Object *obj, void *event_info) -> void + { + appdata_s *ad = static_cast(data); + ad->viewmgr->deactivate(); + }, + this->ad); + + this->set_transition_style("none"); + this->set_content(content, "Title"); + } + +public: + page15(appdata_s *ad) : ui_view("page15"), ad(ad) + { + ad->viewmgr->push_view(this); + } + + ~page15() + { + } +}; + +void create_page15(appdata_s *ad) +{ + new page15(ad); +}