collections {
group { name: "main";
parts {
- part { name: "txt_title";
- type: TEXT;
+ part { name: "bg";
+ type: RECT;
mouse_events: 0;
description { state: "default" 0.0;
align: 0.0 0.0;
rel1 { relative: 0.0 0.0; }
- rel2 { relative: 0.0 0.0; }
- text { font: "Tizen:style=regular"; size: 20; min: 1 1; }
+ rel2 { relative: 1.0 1.0; }
color: 0 0 0 255;
}
- }
+ part {
+ name: "loading";
+ type: SWALLOW;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.5 0.5; to: "bg"; }
+ rel2 { relative: 0.5 0.5; to: "bg"; }
+ align: 0.5 0.5;
+ visible: 1;
+ }
+ }
}
}
}
--- /dev/null
+images {
+ image: "1.png" COMP;
+ image: "2.png" COMP;
+ image: "3.png" COMP;
+ image: "4.png" COMP;
+ image: "5.png" COMP;
+ image: "6.png" COMP;
+ image: "7.png" COMP;
+ image: "8.png" COMP;
+ image: "9.png" COMP;
+ image: "10.png" COMP;
+ image: "11.png" COMP;
+ image: "12.png" COMP;
+ image: "13.png" COMP;
+ image: "14.png" COMP;
+ image: "15.png" COMP;
+ image: "16.png" COMP;
+ image: "17.png" COMP;
+ image: "18.png" COMP;
+ image: "19.png" COMP;
+ image: "20.png" COMP;
+ image: "21.png" COMP;
+ image: "22.png" COMP;
+ image: "23.png" COMP;
+ image: "24.png" COMP;
+ image: "25.png" COMP;
+ image: "26.png" COMP;
+ image: "27.png" COMP;
+}
+
+collections {
+ group {
+ name: "loading";
+
+ parts {
+ part {
+ name: "bg";
+ type: SPACER;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 0.0; }
+ rel2 { relative: 1.0 1.0; }
+ }
+ }
+ part {
+ name: "loading";
+ type: IMAGE;
+ scale: 1;
+ mouse_events: 0;
+ description {
+ rel1 { relative: 0.5 0.5; }
+ rel2 { relative: 0.5 0.5; }
+ state: "default" 0.0;
+ image {
+ normal: "27.png";
+ tween: "1.png";
+ tween: "2.png";
+ tween: "3.png";
+ tween: "4.png";
+ tween: "5.png";
+ tween: "6.png";
+ tween: "7.png";
+ tween: "8.png";
+ tween: "9.png";
+ tween: "10.png";
+ tween: "11.png";
+ tween: "12.png";
+ tween: "13.png";
+ tween: "14.png";
+ tween: "15.png";
+ tween: "16.png";
+ tween: "17.png";
+ tween: "18.png";
+ tween: "19.png";
+ tween: "20.png";
+ tween: "21.png";
+ tween: "22.png";
+ tween: "23.png";
+ tween: "24.png";
+ tween: "25.png";
+ tween: "26.png";
+ tween: "27.png";
+ }
+ align: 0.5 0.5;
+ min: 100 100;
+ visible: 1;
+ }
+ }
+ }
+
+ programs {
+ program {
+ name: "on";
+ signal: "show";
+ action: STATE_SET "default" 0.0;
+ target: "loading";
+ transition: LINEAR 1;
+ after: "wait";
+ }
+ program {
+ name: "wait";
+ in: 1 0;
+ after: "on";
+ }
+ program {
+ name: "end";
+ action: SIGNAL_EMIT "end" "loading";
+ }
+ }
+ }
+}
\ No newline at end of file
*/
#include <tizen.h>
+#include <Elementary.h>
#include "adventure.h"
#include "log.h"
#include "webview.h"
+#include "loading.h"
typedef struct appdata{
Evas_Object* win;
ui_app_exit();
}
+static Evas_Object *_create_adventure(Evas_Object *parent)
+{
+ Evas_Object *adventure = NULL;
+ char *path = NULL;
+ char full_path[PATH_LEN] = {0, };
+
+ adventure = elm_layout_add(parent);
+ retv_if(!adventure, NULL);
+
+ path = app_get_resource_path();
+ retv_if(!path, NULL);
+
+ snprintf(full_path, sizeof(full_path), "%s/edje/adventure.edj", path);
+
+ elm_layout_file_set(adventure, full_path, "main");
+ evas_object_size_hint_weight_set(adventure, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(adventure, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(adventure);
+
+ return adventure;
+}
+
+static void _destroy_adventure(Evas_Object *adventure)
+{
+ ret_if(!adventure);
+ evas_object_del(adventure);
+}
+
static void
create_base_gui(appdata_s *ad)
{
+ Evas_Object *adventure = NULL;
+ Evas_Object *loading = NULL;
+
/* Window */
ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
elm_win_conformant_set(ad->win, EINA_TRUE);
elm_win_resize_object_add(ad->win, ad->conform);
evas_object_show(ad->conform);
+ adventure = _create_adventure(ad->conform);
+ if (!adventure)
+ _E("cannot create the adventure ui");
+ else
+ elm_object_content_set(ad->conform, adventure);
+
+ loading = loading_create(adventure);
+ if (!loading)
+ _E("cannot load the loading image");
+ else
+ elm_object_part_content_set(adventure, "loading", loading);
+
/* Show window after base gui is set up */
evas_object_show(ad->win);
app_control(app_control_h app_control, void *data)
{
appdata_s *ad = data;
- Evas_Object *webview = NULL;
-
- webview = webview_create(ad->conform);
- ret_if(!webview);
- elm_object_content_set(ad->conform, webview);
-
- webview_set_url(webview, "http://www.naver.com");
}
static void
--- /dev/null
+#include <Elementary.h>
+#include <app.h>
+#include "log.h"
+#include "adventure.h"
+
+Evas_Object *loading_create(Evas_Object *parent)
+{
+ Evas_Object *loading = NULL;
+ char *path = NULL;
+ char full_path[PATH_LEN] = {0, };
+
+ retv_if(!parent, NULL);
+
+ path = app_get_resource_path();
+ retv_if(!path, NULL);
+
+ snprintf(full_path, sizeof(full_path), "%s/edje/loading.edj", path);
+
+ loading = elm_layout_add(parent);
+ goto_if(!loading, error);
+
+ elm_layout_file_set(loading, full_path, "loading");
+ evas_object_size_hint_weight_set(loading, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(loading, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(loading);
+
+ free(path);
+ return loading;
+
+error:
+ free(path);
+ return NULL;
+}
+
+
+
+void loading_destroy(Evas_Object *loading)
+{
+ ret_if(!loading);
+ evas_object_del(loading);
+}