From: Woochan Lee Date: Fri, 8 Apr 2016 00:50:30 +0000 (+0900) Subject: Add Auto scroll enabling test page. X-Git-Tag: submit/tizen/20160617.075742~62 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c7fe99cc1d82adde58095e1031f6af50cba982db;p=platform%2Fcore%2Fuifw%2Fui-viewmgr.git Add Auto scroll enabling test page. Change-Id: I6fb8335535afb11b8d848b2ea348406bc03bcb09 --- diff --git a/data/images/bg.png b/data/images/bg.png new file mode 100644 index 0000000..b70406c Binary files /dev/null and b/data/images/bg.png differ diff --git a/src/examples/efl/main.cpp b/src/examples/efl/main.cpp index 21903ee..ecf4915 100644 --- a/src/examples/efl/main.cpp +++ b/src/examples/efl/main.cpp @@ -15,6 +15,7 @@ * */ #include "main.h" +#include "page15.h" #include "page14.h" #include "page13.h" #include "page12.h" @@ -53,6 +54,21 @@ create_toolbar(Evas_Object *parent, const char *style) } Evas_Object* +create_scrolling_content(Evas_Object *parent) +{ + Elm_Image *image; + + /* Image */ + image = elm_image_add(parent); + snprintf(buf, sizeof(buf), "%s/data/images/bg.png", BINDIR); + elm_image_file_set(image, buf, NULL); + elm_image_resizable_set(image, EINA_FALSE, EINA_FALSE); + evas_object_show(image); + + return image; +} + +Evas_Object* create_landscape_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb) { char buf[PATH_MAX]; diff --git a/src/examples/efl/main.h b/src/examples/efl/main.h index f216175..80ee4b5 100644 --- a/src/examples/efl/main.h +++ b/src/examples/efl/main.h @@ -40,4 +40,5 @@ typedef struct appdata { Evas_Object *create_landscape_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb); Evas_Object *create_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb); +Evas_Object *create_scrolling_content(Evas_Object *parent); Elm_Toolbar *create_toolbar(Evas_Object *parent, const char *style); diff --git a/src/examples/efl/page14.h b/src/examples/efl/page14.h index c67a4cb..4aadebb 100644 --- a/src/examples/efl/page14.h +++ b/src/examples/efl/page14.h @@ -35,7 +35,7 @@ protected: //Next Button Callback [](void *data, Evas_Object *obj, void *event_info) -> void { - UI_VIEWMGR->deactivate(); + create_page15(); }); this->set_content(content, "Page14"); diff --git a/src/examples/efl/page15.h b/src/examples/efl/page15.h new file mode 100644 index 0000000..b554f93 --- /dev/null +++ b/src/examples/efl/page15.h @@ -0,0 +1,50 @@ +/* + * 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 +{ +protected: + void on_load() + { + ui_view::on_load(); + + //Create a main content. + Evas_Object *content = create_scrolling_content(this->get_base()); + + this->set_content(content, "Page15 Scroller In Viewmgr"); + + //Title Right button + Elm_Button *right_btn = elm_button_add(this->get_base()); + elm_object_text_set(right_btn, "Next"); + evas_object_smart_callback_add(right_btn, "clicked", + [](void *data, Evas_Object *obj, void *event_info) -> void + { + UI_VIEWMGR->deactivate(); + }, + this); + this->set_title_right_btn(right_btn); + } +}; + +void create_page15() +{ + //Push this view in viewmgr. + UI_VIEWMGR->push_view(new page15()); +} diff --git a/src/lib/efl/ui_base_viewmgr.cpp b/src/lib/efl/ui_base_viewmgr.cpp index 539cf0c..bbb90e7 100644 --- a/src/lib/efl/ui_base_viewmgr.cpp +++ b/src/lib/efl/ui_base_viewmgr.cpp @@ -67,8 +67,8 @@ Elm_Layout *ui_base_viewmgr::set_transition_layout(string transition_style) { Elm_Layout *effect_layout = NULL; - elm_object_part_content_unset(this->get_base(), "pcontent"); - elm_object_part_content_unset(this->get_base(), "content"); + evas_object_hide(elm_object_part_content_unset(this->get_base(), "pcontent")); + evas_object_hide(elm_object_part_content_unset(this->get_base(), "content")); if (transition_style.compare(this->transition_style) == 0) return this->layout;