Add Auto scroll enabling test page. 95/65195/5
authorWoochan Lee <wc0917.lee@samsung.com>
Fri, 8 Apr 2016 00:50:30 +0000 (09:50 +0900)
committerwoochan lee <wc0917.lee@samsung.com>
Fri, 8 Apr 2016 05:41:09 +0000 (22:41 -0700)
Change-Id: I6fb8335535afb11b8d848b2ea348406bc03bcb09

data/images/bg.png [new file with mode: 0644]
src/examples/efl/main.cpp
src/examples/efl/main.h
src/examples/efl/page14.h
src/examples/efl/page15.h [new file with mode: 0644]
src/lib/efl/ui_base_viewmgr.cpp

diff --git a/data/images/bg.png b/data/images/bg.png
new file mode 100644 (file)
index 0000000..b70406c
Binary files /dev/null and b/data/images/bg.png differ
index 21903ee..ecf4915 100644 (file)
@@ -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];
index f216175..80ee4b5 100644 (file)
@@ -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);
index c67a4cb..4aadebb 100644 (file)
@@ -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 (file)
index 0000000..b554f93
--- /dev/null
@@ -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());
+}
index 539cf0c..bbb90e7 100644 (file)
@@ -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;