-#ifndef __YOUR_APPLICATION_LOG_H__
-#define __YOUR_APPLICATION_LOG_H__
+#ifndef __MOMENT_LOG_H__
+#define __MOMENT_LOG_H__
#include <dlog.h>
} \
}
-#endif /* __YOUR_APPLICATION_LOG_H__ */
+#endif /* __MOMENT_LOG_H__ */
Evas_Object *win;\r
Evas_Object *conform;\r
Evas_Object *ui_manager;\r
+ Evas_Object *main_view;\r
+ Evas_Object *scroller;\r
\r
- char *res_path;\r
+ Evas *e;\r
\r
int width;\r
int height;\r
#ifndef __MAIN_VIEW_H__\r
#define __MAIN_VIEW_H__\r
\r
-extern Evas_Object *main_view_create(Evas_Object *parent);\r
+#include <Elementary.h>\r
+#include "main.h"\r
+\r
+extern Evas_Object *main_view_create(Evas_Object *parent, moment_info_s *moment_info);\r
extern void *main_view_destroy(Evas_Object *main_view);\r
\r
#endif /* __MAIN_VIEW_H__ */\r
+collections {
+ group {
+ name: "main";
+
+ styles {
+ style {
+ name: "description_style";
+ base: "font=Tizen:style=Bold font_size=26 color=#ffffff align=center text_class=tizen";
+ tag: "br" "\n";
+ tag: "hilight" "+ font_weight=Bold";
+ tag: "b" "+ font_weight=Bold";
+ tag: "tab" "\t";
+ }
+ }
+
+ parts {
+ part {
+ name: "bg";
+ type: SPACER;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 1.0 1.0; }
+ }
+ }
+ part {
+ name: "map";
+ type: SWALLOW;
+ scale: 1;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.5 0.0; to: "bg"; }
+ rel2 { relative: 0.5 0.0; to: "bg"; }
+ align: 0.5 0.0;
+ visible: 1;
+ }
+ }
+ part {
+ name: "title";
+ type: TEXT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 1.0; to: "map"; }
+ rel2 { relative: 1.0 1.0; to: "map"; }
+ color: 0 0 0 255;
+ align: 0.5 0.0;
+ min: 0 50;
+ visible: 1;
+ text {
+ text: "";
+ font: "Tizen:style=Bold";
+ text_class: "tizen";
+ min: 0 0;
+ size: 32;
+ align: 0.5 0.5;
+ }
+ }
+ description {
+ state: "hide" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part {
+ name: "description";
+ type: TEXTBLOCK;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 1.0; to: "title"; }
+ rel2 { relative: 1.0 1.0; to: "title"; }
+ align: 0.5 0.0;
+ min: 0 100;
+ visible: 1;
+ text {
+ text: "";
+ style: "description_style";
+ }
+ }
+ description {
+ state: "hide" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part {
+ name: "button";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.5 1.0; to: "bg"; }
+ rel2 { relative: 0.5 1.0; to: "bg"; }
+ align: 0.5 1.0;
+ visible: 1;
+ }
+ description {
+ state: "hide" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part {
+ name: "search";
+ type: SWALLOW;
+ scale: 1;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.5 1.0; to: "map"; }
+ rel2 { relative: 0.5 1.0; to: "map"; }
+ align: 0.5 0.0;
+ visible: 1;
+ }
+ description {
+ state: "hide" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part {
+ name: "content";
+ type: SWALLOW;
+ scale: 1;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.5 1.0; to: "search"; }
+ rel2 { relative: 0.5 1.0; to: "bg"; }
+ align: 0.5 0.0;
+ visible: 1;
+ }
+ description {
+ state: "hide" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "hide";
+ source: "text";
+ action: STATE_SET "hide" 0.0;
+ target: "title";
+ target: "description";
+ }
+ program {
+ signal: "show";
+ source: "text";
+ action: STATE_SET "default" 0.0;
+ target: "title";
+ target: "description";
+ }
+
+ program {
+ signal: "hide";
+ source: "button";
+ action: STATE_SET "hide" 0.0;
+ target: "button";
+ }
+ program {
+ signal: "show";
+ source: "button";
+ action: STATE_SET "default" 0.0;
+ target: "button";
+ }
+
+ program {
+ signal: "hide";
+ source: "content";
+ action: STATE_SET "hide" 0.0;
+ target: "search";
+ target: "content";
+ }
+ program {
+ signal: "show";
+ source: "content";
+ action: STATE_SET "default" 0.0;
+ target: "search";
+ target: "content";
+ }
+ }
+ }
+}
+images {\r
+ image: "" COMP;\r
+}\r
+\r
collections {\r
group {\r
name: "main";\r
}\r
}\r
part {\r
- name: "map";\r
- type: SWALLOW;\r
+ name: "map_img";\r
+ type: IMAGE;\r
scale: 1;\r
mouse_events: 0;\r
description { state: "default" 0.0;\r
- rel1 { relative: 0.5 0.0; to: "bg"; }\r
- rel2 { relative: 0.5 0.0; to: "bg"; }\r
- align: 0.5 0.0;\r
- visible: 1;\r
- }\r
- }\r
- part {\r
- name: "title";\r
- type: TEXT;\r
- description {\r
- rel1 { relative: 0.0 1.0; to: "map"; }\r
- rel2 { relative: 1.0 1.0; to: "bg"; }\r
- visible: 1;\r
- }\r
- }\r
- part {\r
- name: "description";\r
- type: TEXTBLOCK;\r
- description {\r
- rel1 { relative: 0.0 1.0; to: "title"; }\r
- rel2 { relative: 1.0 1.0; to: "bg"; }\r
- visible: 1;\r
- }\r
- }\r
- part {\r
- name: "button";\r
- type: SWALLOW;\r
- description {\r
- rel1 { relative: 0.0 1.0; to: "description"; }\r
- rel2 { relative: 1.0 1.0; to: "bg"; }\r
+ rel1 { relative: 0.5 0.5; to: "bg"; }\r
+ rel2 { relative: 0.5 0.5; to: "bg"; }\r
+ align: 0.5 0.5;\r
visible: 1;\r
+ image {\r
+ normal: "";\r
+ }\r
}\r
}\r
}\r
image: "Aventure01_background.png" COMP;
}
-
collections {
- group { name: "main";
+ group {
+ name: "main";
parts {
part {
name: "bg";
normal: "Aventure01_background.png";
}
visible: 1;
- }
+ }
}
part {
name: "content";
visible: 1;
}
}
- }
- programs {
+ part {
+ name: "popup";
+ type: SWALLOW;
+ description {
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 1.0 1.0; }
+ visible: 1;
+ }
+ }
}
}
}
\r
_D("Window size (%d:%d)", moment_info->width, moment_info->height);\r
\r
+ moment_info->e = evas_object_evas_get(moment_info->win);\r
+\r
return true;\r
}\r
\r
#include <Elementary.h>\r
#include "main.h"\r
#include "log.h"\r
+#include "scroller"\r
\r
const char *const MAIN_VIEW_EDJE = "main_view.edj";\r
\r
-Evas_Object *main_view_create(Evas_Object *parent)\r
+static _clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
+{\r
+ moment_info_s *moment_info = data;\r
+\r
+ _D("Add button is clicked");\r
+\r
+ ret_if(!moment_info);\r
+\r
+ elm_object_signal_emit(moment_info->main_view\r
+\r
+ moment_info->scroller = scroller_create(moment_info->ui_manager);\r
+ ret_if(!moment_info->scroller);\r
+}\r
+\r
+Evas_Object *main_view_create(Evas_Object *parent, moment_info_s *moment_info)\r
{\r
Evas_Object *main_view = NULL;\r
Evas_Object *button = NULL;\r
main_view = elm_layout_add(parent);\r
retv_if(!main_view, NULL);\r
elm_layout_file_set(main_view, "main", NULL);\r
+ evas_object_size_hint_weight_set(main_view, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);\r
+ evas_object_size_hint_align_set(main_view, EVAS_HINT_FILL, EVAS_HINT_FILL);\r
evas_object_show(main_view);\r
\r
elm_object_part_text_set(main_view, "title", "No cities");\r
\r
button = elm_button_add(parent);\r
if (button) {\r
- evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);\r
+ elm_object_text_set(button, "+ Add");\r
elm_object_part_content_set(main_view, "button", button);\r
+ evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);\r
+ evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);\r
+ evas_object_smart_callback_add(button, "clicked", _clicked_cb, moment_info);\r
}\r
\r
return main_view;\r
elm_layout_file_set(map, "main", NULL);\r
evas_object_show(map);\r
\r
- elm_object_part_text_set(map, "title", "No cities");\r
- elm_object_part_text_set(map, "description", "After you add cities, they will be shown here.");\r
-\r
- button = elm_button_add(parent);\r
- if (button) {\r
- evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);\r
- elm_object_part_content_set(map, "button", button);\r
- }\r
-\r
return map;\r
}\r
\r
\r
ret_if(!map);\r
\r
- button = elm_object_part_content_unset(map, "button");\r
- if (button) {\r
- evas_object_del(button);\r
- }\r
-\r
evas_object_del(map);\r
}\r
{
Evas_Object *ui_manager = NULL;
Evas_Object *rect = NULL;
- Evas_Object *content = NULL;
-
+ char *path = NULL;
+ char full_path[] = {0, };
retv_if(!parent, NULL);
+ retv_if(!moment_info, NULL);
+
+ path = app_get_resource_path();
+ retv_if(!path, NULL);
+
+ snprintf(full_path, sizeof(full_path), "%s/edje/%s", path, MAIN_VIEW_EDJE);
+ free(path);
ui_manager = elm_layout_add(parent);
retv_if(!ui_manager, NULL);
+
elm_layout_file_set(ui_manager, full_path, "main");
evas_object_size_hint_weight_set(ui_manager, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(ui_manager, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(ui_manager);
- rect = evas_object_rectangle_add(evas_object_evas_get(parent));
+ rect = evas_object_rectangle_add(moment_info->e);
if (rect) {
evas_object_size_hint_min_set(rect, width, height);
+ evas_object_color_set(rect, 200, 200, 200, 200);
evas_object_show(rect);
elm_object_part_content_set(ui_manager, "bg", rect);
} else
_E("cannot add a rectangle");
+ moment_info->main_view = main_view_create(ui_manager, moment_info);
+ if (moment_info->main_view)
+ elm_object_part_content_set(ui_manager, "content", moment_info->main_view);
+ else
+ _E("cannot add the main view");
+
return ui_manager;
}