and replace the folder name from data to res.
Change-Id: I68a32680fba3cca3baa71a9cab02aff4fe09bb9d
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)
#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")
%{_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
+/*
+ * 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*
/* 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);
/* 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);
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);
+/*
+ * 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
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);
}
}
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);
/* 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);
/* 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);
//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)