remove all FIXME in the exmaples. 25/100525/2
authorHermet Park <hermet@hermet.pe.kr>
Mon, 28 Nov 2016 10:15:07 +0000 (19:15 +0900)
committerHermet Park <chuneon.park@samsung.com>
Mon, 28 Nov 2016 10:22:15 +0000 (02:22 -0800)
and replace the folder name from data to res.

Change-Id: I68a32680fba3cca3baa71a9cab02aff4fe09bb9d

15 files changed:
CMakeLists.txt
packaging/ui-viewmgr.spec
res/edc/images/core_icon_badge_container.#.png [moved from data/edc/images/core_icon_badge_container.#.png with 100% similarity]
res/edc/images/core_theme_bg_01.png [moved from data/edc/images/core_theme_bg_01.png with 100% similarity]
res/edc/ui-viewmgr.edc [moved from data/edc/ui-viewmgr.edc with 100% similarity]
res/images/bg.png [moved from data/images/bg.png with 100% similarity]
res/images/icon_alarm.png [moved from data/images/icon_alarm.png with 100% similarity]
res/images/icon_timer.png [moved from data/images/icon_timer.png with 100% similarity]
res/images/icon_worldclock.png [moved from data/images/icon_worldclock.png with 100% similarity]
res/images/tizen.png [moved from data/images/tizen.png with 100% similarity]
src/examples/efl/c/contents.cpp
src/examples/efl/c/main.cpp
src/examples/efl/c/page1.cpp
src/examples/efl/cpp/contents.cpp
src/examples/efl/cpp/page1.h

index e332a10..fe34690 100644 (file)
@@ -12,7 +12,7 @@ SET(EDJDIR "/usr/share/edje/${LIBNAME}")
 
 SET(BINNAME ui.viewmgr.demo)
 SET(BINDIR /usr/apps/${BINNAME})
-SET(IMGDIR ${BINDIR}/data/images)
+SET(IMGDIR ${BINDIR}/res/images)
 SET(ICONDIR ${BINDIR}/shared/res)
 
 SET(CMAKE_SKIP_BUILD_RPATH TRUE)
@@ -46,19 +46,19 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/pc/${LIBNAME}.pc DESTINATION ${LIBDIR}
 
 #edj file
 ADD_CUSTOM_TARGET(${LIBNAME}.edj
-   COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/data/edc
-   ${CMAKE_SOURCE_DIR}/data/edc/${LIBNAME}.edc ${CMAKE_BINARY_DIR}/data/edc/${LIBNAME}.edj
-   DEPENDS ${CMAKE_SOURCE_DIR}/data/edc/${LIBNAME}.edc
+   COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/res/edc
+   ${CMAKE_SOURCE_DIR}/res/edc/${LIBNAME}.edc ${CMAKE_BINARY_DIR}/res/edc/${LIBNAME}.edj
+   DEPENDS ${CMAKE_SOURCE_DIR}/res/edc/${LIBNAME}.edc
    )
 ADD_DEPENDENCIES(${LIBNAME} ${LIBNAME}.edj)
-INSTALL(FILES ${CMAKE_BINARY_DIR}/data/edc/${LIBNAME}.edj DESTINATION ${EDJDIR})
+INSTALL(FILES ${CMAKE_BINARY_DIR}/res/edc/${LIBNAME}.edj DESTINATION ${EDJDIR})
 
 #xml file
 CONFIGURE_FILE(${BINNAME}.xml.in ${BINNAME}.xml @ONLY)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${BINNAME}.xml DESTINATION /usr/share/packages/)
 
 #image file
-INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/images/ DESTINATION ${IMGDIR} FILES_MATCHING PATTERN "*.png")
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images/ DESTINATION ${IMGDIR} FILES_MATCHING PATTERN "*.png")
 
 #icon file
 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/shared/res/ DESTINATION ${ICONDIR} FILES_MATCHING PATTERN "*.png")
index 3ddae03..1f0f374 100644 (file)
@@ -73,7 +73,7 @@ cp %{_builddir}/%{buildsubdir}/LICENSE %{buildroot}/usr/share/license/%{name}
 %{_datadir}/packages/ui.viewmgr.demo.xml
 %manifest ui.viewmgr.demo.manifest
 /usr/apps/ui.viewmgr.demo/bin/*
-/usr/apps/ui.viewmgr.demo/data/images/*
+/usr/apps/ui.viewmgr.demo/res/images/*
 /usr/apps/ui.viewmgr.demo/shared/res/*
 
 %files devel
similarity index 100%
rename from data/images/bg.png
rename to res/images/bg.png
similarity index 100%
rename from data/images/tizen.png
rename to res/images/tizen.png
index 24cf684..0342c19 100644 (file)
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ *
+ */
+
 #include "main.h"
 
 Eo*
@@ -31,7 +48,14 @@ create_landscape_content(Eo *parent, const char *text, Evas_Smart_Cb prev_btn_cl
 
        /* Image */
        image = elm_image_add(grid);
-       snprintf(buf, sizeof(buf), "%s/data/images/tizen.png", BINDIR);
+
+       char *res_path = app_get_resource_path();
+       if (res_path)
+       {
+               snprintf(buf, sizeof(buf), "%s%s", res_path, "images/tizen.png");
+               free(res_path);
+       }
+
        elm_image_file_set(image, buf, NULL);
        evas_object_show(image);
        elm_grid_pack(grid, image, 50, 0, 50, 85);
@@ -234,7 +258,14 @@ create_scrolling_content(Eo *parent)
 
        /* Image */
        image = elm_image_add(parent);
-       snprintf(buf, sizeof(buf), "%s/data/images/bg.png", BINDIR);
+
+       char *res_path = app_get_resource_path();
+       if (res_path)
+       {
+               snprintf(buf, sizeof(buf), "%s%s", res_path, "images/bg.png");
+               free(res_path);
+       }
+
        elm_image_file_set(image, buf, NULL);
        elm_image_resizable_set(image, EINA_FALSE, EINA_FALSE);
        evas_object_show(image);
@@ -249,13 +280,8 @@ create_toolbar(Eo *parent, const char *style)
 
        toolbar = elm_toolbar_add(parent);
 
-       //FIXME: :( UI_View can set this style instead.
        elm_object_style_set(toolbar, style);
 
-       //FIXME: If not call below API, toolbar items create with min size.
-       //       It looks toolbar bug.
-       elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND);
-
        elm_toolbar_item_append(toolbar, NULL, "Tab1", NULL, NULL);
        elm_toolbar_item_append(toolbar, NULL, "Tab2", NULL, NULL);
        elm_toolbar_item_append(toolbar, NULL, "Tab3", NULL, NULL);
index 82ee7c4..f829b87 100644 (file)
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ *
+ */
+
 #include "main.h"
 
 static bool
index e110030..a5ffb21 100644 (file)
 static void
 prev_btn_clicked_cb(void *data, Eo *obj, void *event_info)
 {
-       //FIXME: deactivate??? or ui_app deactivate??? or ui_viewmgr pop???
-       int ret = ui_viewmgr_pop_view();
+       int ret = ui_viewmgr_deactivate();
        if (ret != UI_VIEWMGR_ERROR_NONE)
        {
-               dlog_print(DLOG_ERROR, LOG_TAG, "ui_viewmgr_pop_view() is failed. err = %d", ret);
+               dlog_print(DLOG_ERROR, LOG_TAG, "ui_viewmgr_deactivate() is failed. err = %d", ret);
        }
 }
 
index c25fe55..9fa3ee8 100644 (file)
@@ -23,13 +23,8 @@ createToolbar(Eo *parent, const char *style)
 
        toolbar = elm_toolbar_add(parent);
 
-       //FIXME: :( UiView can set this style instead.
        elm_object_style_set(toolbar, style);
 
-       //FIXME: If not call below API, toolbar items create with min size.
-       //       It looks toolbar bug.
-       elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND);
-
        elm_toolbar_item_append(toolbar, nullptr, "Tab1", nullptr, nullptr);
        elm_toolbar_item_append(toolbar, nullptr, "Tab2", nullptr, nullptr);
        elm_toolbar_item_append(toolbar, nullptr, "Tab3", nullptr, nullptr);
@@ -46,7 +41,14 @@ createScrollingContent(Eo *parent)
 
        /* Image */
        image = elm_image_add(parent);
-       snprintf(buf, sizeof(buf), "%s/data/images/bg.png", BINDIR);
+
+       char *res_path = app_get_resource_path();
+       if (res_path)
+       {
+               snprintf(buf, sizeof(buf), "%s%s", res_path, "images/bg.png");
+               free(res_path);
+       }
+
        elm_image_file_set(image, buf, nullptr);
        elm_image_resizable_set(image, EINA_FALSE, EINA_FALSE);
        evas_object_show(image);
@@ -85,7 +87,14 @@ createLandscapeContent(Eo *parent, const char *text, Evas_Smart_Cb _prevBtnClick
 
        /* Image */
        image = elm_image_add(grid);
-       snprintf(buf, sizeof(buf), "%s/data/images/tizen.png", BINDIR);
+
+       char *res_path = app_get_resource_path();
+       if (res_path)
+       {
+               snprintf(buf, sizeof(buf), "%s%s", res_path, "images/tizen.png");
+               free(res_path);
+       }
+
        elm_image_file_set(image, buf, nullptr);
        evas_object_show(image);
        elm_grid_pack(grid, image, 50, 0, 50, 85);
index 3e225fc..a15d562 100644 (file)
@@ -31,7 +31,7 @@ protected:
                                                                        //Prev Button Callback
                                                                        [](void *data, Eo *obj, void *event_info)
                                                                        {
-                                                                               UI_VIEWMGR->popView();
+                                                                               UI_VIEWMGR->deactivate();
                                                                        },
                                                                        //Next Button Callback
                                                                        [](void *data, Eo *obj, void *event_info)